Skip to content

Commit 6ac0cf9

Browse files
dougsonosDoug Wyatt
and
Doug Wyatt
authored
[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 50835f0 commit 6ac0cf9

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
@@ -4698,26 +4698,25 @@ class FunctionEffect {
46984698
};
46994699

47004700
private:
4701-
LLVM_PREFERRED_TYPE(Kind)
4702-
unsigned FKind : 3;
4701+
Kind FKind;
47034702

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

47084707
public:
4709-
FunctionEffect() : FKind(unsigned(Kind::None)) {}
4708+
FunctionEffect() : FKind(Kind::None) {}
47104709

4711-
explicit FunctionEffect(Kind K) : FKind(unsigned(K)) {}
4710+
explicit FunctionEffect(Kind K) : FKind(K) {}
47124711

47134712
/// The kind of the effect.
4714-
Kind kind() const { return Kind(FKind); }
4713+
Kind kind() const { return FKind; }
47154714

47164715
/// Return the opposite kind, for effects which have opposites.
47174716
Kind oppositeKind() const;
47184717

47194718
/// For serialization.
4720-
uint32_t toOpaqueInt32() const { return FKind; }
4719+
uint32_t toOpaqueInt32() const { return uint32_t(FKind); }
47214720
static FunctionEffect fromOpaqueInt32(uint32_t Value) {
47224721
return FunctionEffect(Kind(Value));
47234722
}

0 commit comments

Comments
 (0)