diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-16 00:20:07 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-16 00:20:07 +0000 |
commit | b60e70f96363fab9412a6facdd06856418fd943a (patch) | |
tree | a6deab9e7d334ab3ca645da486a1648d9b5aff24 /clang/lib/CodeGen/CGValue.h | |
parent | 853734e55877a407009787cefa6c6537e04152a8 (diff) | |
download | bcm5719-llvm-b60e70f96363fab9412a6facdd06856418fd943a.tar.gz bcm5719-llvm-b60e70f96363fab9412a6facdd06856418fd943a.zip |
Patch to move RequiresGCollection bit to
AggValueSlot slot.
llvm-svn: 114045
Diffstat (limited to 'clang/lib/CodeGen/CGValue.h')
-rw-r--r-- | clang/lib/CodeGen/CGValue.h | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/clang/lib/CodeGen/CGValue.h b/clang/lib/CodeGen/CGValue.h index 42b8335ecd3..fa4cb3db043 100644 --- a/clang/lib/CodeGen/CGValue.h +++ b/clang/lib/CodeGen/CGValue.h @@ -323,12 +323,13 @@ public: /// An aggregate value slot. class AggValueSlot { - /// The address and associated flags. + /// The address. uintptr_t AddrAndFlags; - - static const uintptr_t VolatileFlag = 0x1; - static const uintptr_t LifetimeFlag = 0x2; - static const uintptr_t AddrMask = ~(VolatileFlag | LifetimeFlag); + + // Associated flags. + bool VolatileFlag : 1; + bool LifetimeFlag : 1; + bool RequiresGCollection : 1; public: /// ignored - Returns an aggregate value slot indicating that the @@ -336,6 +337,7 @@ public: static AggValueSlot ignored() { AggValueSlot AV; AV.AddrAndFlags = 0; + AV.VolatileFlag = AV.LifetimeFlag = AV.RequiresGCollection = 0; return AV; } @@ -346,32 +348,42 @@ public: /// is being externally managed; false if a destructor should be /// registered for any temporaries evaluated into the slot static AggValueSlot forAddr(llvm::Value *Addr, bool Volatile, - bool LifetimeExternallyManaged) { + bool LifetimeExternallyManaged, + bool RequiresGCollection=false) { AggValueSlot AV; AV.AddrAndFlags = reinterpret_cast<uintptr_t>(Addr); - if (Volatile) AV.AddrAndFlags |= VolatileFlag; - if (LifetimeExternallyManaged) AV.AddrAndFlags |= LifetimeFlag; + if (Volatile) AV.VolatileFlag = 1; + if (LifetimeExternallyManaged) AV.LifetimeFlag = 1; + if (RequiresGCollection) AV.RequiresGCollection = 1; return AV; } - static AggValueSlot forLValue(LValue LV, bool LifetimeExternallyManaged) { + static AggValueSlot forLValue(LValue LV, bool LifetimeExternallyManaged, + bool RequiresGCollection=false) { return forAddr(LV.getAddress(), LV.isVolatileQualified(), - LifetimeExternallyManaged); + LifetimeExternallyManaged, RequiresGCollection); } bool isLifetimeExternallyManaged() const { - return AddrAndFlags & LifetimeFlag; + return LifetimeFlag; } void setLifetimeExternallyManaged() { - AddrAndFlags |= LifetimeFlag; + LifetimeFlag = 1; } bool isVolatile() const { - return AddrAndFlags & VolatileFlag; + return VolatileFlag; } + bool isRequiresGCollection() const { + return RequiresGCollection; + } + void setRequiresGCollection() { + RequiresGCollection = 1; + } + llvm::Value *getAddr() const { - return reinterpret_cast<llvm::Value*>(AddrAndFlags & AddrMask); + return reinterpret_cast<llvm::Value*>(AddrAndFlags); } bool isIgnored() const { |