diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-11-16 00:42:57 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-11-16 00:42:57 +0000 |
commit | 2f77b3d57031ded0de2b7b977fb63b4660f82624 (patch) | |
tree | 69c8f2e92274b61cbcc8583fcbb2ad2b3f725d81 /lib/CodeGen/CodeGenFunction.h | |
parent | 1432569f88c6da4da902df7571621f3ea3f76596 (diff) |
Fix a bunch of really nasty bugs in how we compute alignment for reference lvalues. PR11376.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144745 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 09b8b2b373..740a13e122 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -1541,6 +1541,15 @@ public: return LValue::MakeAddr(V, T, Alignment, getContext(), CGM.getTBAAInfo(T)); } + LValue MakeNaturalAlignAddrLValue(llvm::Value *V, QualType T) { + unsigned Alignment; + if (T->isIncompleteType()) + Alignment = 0; + else + Alignment = getContext().getTypeAlignInChars(T).getQuantity(); + return LValue::MakeAddr(V, T, Alignment, getContext(), + CGM.getTBAAInfo(T)); + } /// CreateTempAlloca - This creates a alloca and inserts it into the entry /// block. The caller is responsible for setting an appropriate alignment on |