diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-12-03 00:54:26 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-12-03 00:54:26 +0000 |
commit | f394078fde147dcf27e9b6a7965517388d64dcb6 (patch) | |
tree | 536486237c979bf4cb29fbd5555a4f746e6dcd54 /lib/CodeGen/CGValue.h | |
parent | e664977aca2a05a77abab5a06dc0fb69e870cfb9 (diff) | |
download | clang-f394078fde147dcf27e9b6a7965517388d64dcb6.tar.gz |
Track alignment in AggValueSlot. No functional change in this patch, but I'll be introducing uses of the specified alignment soon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145736 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGValue.h')
-rw-r--r-- | lib/CodeGen/CGValue.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/CodeGen/CGValue.h b/lib/CodeGen/CGValue.h index 48f7f53255..e507e71866 100644 --- a/lib/CodeGen/CGValue.h +++ b/lib/CodeGen/CGValue.h @@ -220,6 +220,7 @@ public: unsigned getAddressSpace() const { return Quals.getAddressSpace(); } unsigned getAlignment() const { return Alignment; } + void setAlignment(unsigned A) { Alignment = A; } // simple lvalue llvm::Value *getAddress() const { assert(isSimple()); return V; } @@ -308,6 +309,8 @@ class AggValueSlot { // Qualifiers Qualifiers Quals; + unsigned short Alignment; + /// DestructedFlag - This is set to true if some external code is /// responsible for setting up a destructor for the slot. Otherwise /// the code which constructs it should push the appropriate cleanup. @@ -363,13 +366,15 @@ public: /// for calling destructors on this object /// \param needsGC - true if the slot is potentially located /// somewhere that ObjC GC calls should be emitted for - static AggValueSlot forAddr(llvm::Value *addr, Qualifiers quals, + static AggValueSlot forAddr(llvm::Value *addr, unsigned align, + Qualifiers quals, IsDestructed_t isDestructed, NeedsGCBarriers_t needsGC, IsAliased_t isAliased, IsZeroed_t isZeroed = IsNotZeroed) { AggValueSlot AV; AV.Addr = addr; + AV.Alignment = align; AV.Quals = quals; AV.DestructedFlag = isDestructed; AV.ObjCGCFlag = needsGC; @@ -382,7 +387,7 @@ public: NeedsGCBarriers_t needsGC, IsAliased_t isAliased, IsZeroed_t isZeroed = IsNotZeroed) { - return forAddr(LV.getAddress(), LV.getQuals(), + return forAddr(LV.getAddress(), LV.getAlignment(), LV.getQuals(), isDestructed, needsGC, isAliased, isZeroed); } @@ -415,10 +420,15 @@ public: return Addr == 0; } + unsigned getAlignment() const { + return Alignment; + } + IsAliased_t isPotentiallyAliased() const { return IsAliased_t(AliasedFlag); } + // FIXME: Alignment? RValue asRValue() const { return RValue::getAggregate(getAddr(), isVolatile()); } |