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 | d20adbdce39e0385a6763488d2a21b2620eb7c9d (patch) | |
tree | 10a9fddbc5175fba4b1beecc56f1a8c404d5ba71 /clang/lib/CodeGen/CodeGenFunction.h | |
parent | ed8d58fcc1983f4f48622706ae387f9ad1ce758b (diff) | |
download | bcm5719-llvm-d20adbdce39e0385a6763488d2a21b2620eb7c9d.tar.gz bcm5719-llvm-d20adbdce39e0385a6763488d2a21b2620eb7c9d.zip |
Fix a bunch of really nasty bugs in how we compute alignment for reference lvalues. PR11376.
llvm-svn: 144745
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 09b8b2b373a..740a13e122b 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/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 |