Skip to content

Commit 511bd67

Browse files
authored
Merge pull request #59999 from eeckstein/simplify-silnode-bits
SIL: simplify the SILNode inline bitfields.
2 parents d2a54af + 64ba6fd commit 511bd67

File tree

7 files changed

+486
-631
lines changed

7 files changed

+486
-631
lines changed

include/swift/SIL/SILArgument.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class SILArgument : public ValueBase {
6868

6969
SILBasicBlock *parentBlock;
7070
const ValueDecl *decl;
71+
USE_SHARED_UINT8;
7172

7273
protected:
7374
SILArgument(ValueKind subClassKind, SILBasicBlock *inputParentBlock,
@@ -81,19 +82,19 @@ class SILArgument : public ValueBase {
8182
const ValueDecl *inputDecl = nullptr)
8283
: ValueBase(subClassKind, type),
8384
parentBlock(nullptr), decl(inputDecl) {
84-
Bits.SILArgument.VOKind = static_cast<unsigned>(ownershipKind);
85+
sharedUInt8().SILArgument.valueOwnershipKind = uint8_t(ownershipKind);
8586
}
8687

8788
public:
8889
void operator=(const SILArgument &) = delete;
8990
void operator delete(void *, size_t) = delete;
9091

9192
ValueOwnershipKind getOwnershipKind() const {
92-
return static_cast<ValueOwnershipKind>(Bits.SILArgument.VOKind);
93+
return ValueOwnershipKind(sharedUInt8().SILArgument.valueOwnershipKind);
9394
}
9495

9596
void setOwnershipKind(ValueOwnershipKind newKind) {
96-
Bits.SILArgument.VOKind = static_cast<unsigned>(newKind);
97+
sharedUInt8().SILArgument.valueOwnershipKind = uint8_t(newKind);
9798
}
9899

99100
SILBasicBlock *getParent() const { return parentBlock; }

0 commit comments

Comments
 (0)