mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Update PointerIntPairs to use enum class members.
LLVM r179073 fixed PointerIntPair to work with an enum class as the IntType member, so we can kill some boilerplate in a few type implementations that were explicitly casting to unsigned to work around PointerIntPair's limitations. Swift SVN r4652
This commit is contained in:
@@ -96,16 +96,16 @@ enum class FieldAccess : uint8_t {
|
||||
|
||||
namespace {
|
||||
class FieldEntry {
|
||||
llvm::PointerIntPair<VarDecl*, 2> VarAndAccess;
|
||||
llvm::PointerIntPair<VarDecl*, 2, FieldAccess> VarAndAccess;
|
||||
public:
|
||||
FieldEntry(VarDecl *var, FieldAccess access)
|
||||
: VarAndAccess(var, unsigned(access)) {}
|
||||
: VarAndAccess(var, access) {}
|
||||
|
||||
VarDecl *getVar() const {
|
||||
return VarAndAccess.getPointer();
|
||||
}
|
||||
FieldAccess getAccess() const {
|
||||
return FieldAccess(VarAndAccess.getInt());
|
||||
return VarAndAccess.getInt();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user