Skip to content

Commit 8646155

Browse files
dougsonosDoug Wyatt
authored andcommitted
[NFC] Reduce size of FunctionEffect to 1 byte. (llvm#100753)
As a preliminary to PR llvm#99656 , reduce the size of `FunctionEffect` to 1 byte. --------- Co-authored-by: Doug Wyatt <[email protected]>
1 parent 44566d7 commit 8646155

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

clang/include/clang/AST/Type.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4719,26 +4719,25 @@ class FunctionEffect {
47194719
};
47204720

47214721
private:
4722-
LLVM_PREFERRED_TYPE(Kind)
4723-
unsigned FKind : 3;
4722+
Kind FKind;
47244723

47254724
// Expansion: for hypothetical TCB+types, there could be one Kind for TCB,
47264725
// then ~16(?) bits "SubKind" to map to a specific named TCB. SubKind would
47274726
// be considered for uniqueness.
47284727

47294728
public:
4730-
FunctionEffect() : FKind(unsigned(Kind::None)) {}
4729+
FunctionEffect() : FKind(Kind::None) {}
47314730

4732-
explicit FunctionEffect(Kind K) : FKind(unsigned(K)) {}
4731+
explicit FunctionEffect(Kind K) : FKind(K) {}
47334732

47344733
/// The kind of the effect.
4735-
Kind kind() const { return Kind(FKind); }
4734+
Kind kind() const { return FKind; }
47364735

47374736
/// Return the opposite kind, for effects which have opposites.
47384737
Kind oppositeKind() const;
47394738

47404739
/// For serialization.
4741-
uint32_t toOpaqueInt32() const { return FKind; }
4740+
uint32_t toOpaqueInt32() const { return uint32_t(FKind); }
47424741
static FunctionEffect fromOpaqueInt32(uint32_t Value) {
47434742
return FunctionEffect(Kind(Value));
47444743
}

0 commit comments

Comments
 (0)