diff options
author | John McCall <rjmccall@apple.com> | 2010-09-16 03:13:23 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-09-16 03:13:23 +0000 |
commit | 58649dc6095d47bbd0d4c56d180d084c3966d30e (patch) | |
tree | 1ad82658176cb24b5183b55637f4a5655157e21d /clang/lib/CodeGen/CGValue.h | |
parent | 561cd86acf50e1f5c881e286aeddbf141bbc6fa5 (diff) | |
download | bcm5719-llvm-58649dc6095d47bbd0d4c56d180d084c3966d30e.tar.gz bcm5719-llvm-58649dc6095d47bbd0d4c56d180d084c3966d30e.zip |
Initialize AggValueSlot's flags along all paths, plus minor beautification.
Prospective fix for broken commit in r114045.
llvm-svn: 114060
Diffstat (limited to 'clang/lib/CodeGen/CGValue.h')
-rw-r--r-- | clang/lib/CodeGen/CGValue.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGValue.h b/clang/lib/CodeGen/CGValue.h index fa4cb3db043..04467c564fd 100644 --- a/clang/lib/CodeGen/CGValue.h +++ b/clang/lib/CodeGen/CGValue.h @@ -347,14 +347,16 @@ public: /// \param LifetimeExternallyManaged - true if the slot's lifetime /// is being externally managed; false if a destructor should be /// registered for any temporaries evaluated into the slot + /// \param RequiresGCollection - true if the slot is located + /// somewhere that ObjC GC calls should be emitted for static AggValueSlot forAddr(llvm::Value *Addr, bool Volatile, bool LifetimeExternallyManaged, bool RequiresGCollection=false) { AggValueSlot AV; AV.AddrAndFlags = reinterpret_cast<uintptr_t>(Addr); - if (Volatile) AV.VolatileFlag = 1; - if (LifetimeExternallyManaged) AV.LifetimeFlag = 1; - if (RequiresGCollection) AV.RequiresGCollection = 1; + AV.VolatileFlag = Volatile; + AV.LifetimeFlag = LifetimeExternallyManaged; + AV.RequiresGCollection = RequiresGCollection; return AV; } @@ -368,18 +370,18 @@ public: return LifetimeFlag; } void setLifetimeExternallyManaged() { - LifetimeFlag = 1; + LifetimeFlag = true; } bool isVolatile() const { return VolatileFlag; } - bool isRequiresGCollection() const { + bool requiresGCollection() const { return RequiresGCollection; } void setRequiresGCollection() { - RequiresGCollection = 1; + RequiresGCollection = true; } llvm::Value *getAddr() const { |