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:
Joe Groff
2013-04-10 15:30:41 +00:00
parent 64ea9af92b
commit 6df319ab8e
3 changed files with 11 additions and 11 deletions

View File

@@ -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();
}
};