summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprCXX.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-08-21 02:24:36 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-08-21 02:24:36 +0000
commit91a16fa3265686b90054715eea504d9b4a13438b (patch)
tree1231112a41bba5d9569021926912372d6c1fe842 /lib/CodeGen/CGExprCXX.cpp
parent4cac2a157c5a3d7c8f6cd79b52e891184623f29e (diff)
downloadclang-91a16fa3265686b90054715eea504d9b4a13438b.tar.gz
clang-91a16fa3265686b90054715eea504d9b4a13438b.tar.bz2
clang-91a16fa3265686b90054715eea504d9b4a13438b.tar.xz
IRgen: Change Emit{Load,Store}OfScalar to take a required Alignment argument and
update callers as best I can. - This is a work in progress, our alignment handling is very horrible / sketchy -- I am just aiming for monotonic improvement. - Serious review appreciated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111707 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprCXX.cpp')
-rw-r--r--lib/CodeGen/CGExprCXX.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp
index 8c67b8bba6..0faba72a8a 100644
--- a/lib/CodeGen/CGExprCXX.cpp
+++ b/lib/CodeGen/CGExprCXX.cpp
@@ -516,10 +516,13 @@ static void StoreAnyExprIntoOneUnit(CodeGenFunction &CGF, const CXXNewExpr *E,
const Expr *Init = E->getConstructorArg(0);
QualType AllocType = E->getAllocatedType();
-
+
+ unsigned Alignment =
+ CGF.getContext().getTypeAlignInChars(AllocType).getQuantity();
if (!CGF.hasAggregateLLVMType(AllocType))
CGF.EmitStoreOfScalar(CGF.EmitScalarExpr(Init), NewPtr,
- AllocType.isVolatileQualified(), AllocType);
+ AllocType.isVolatileQualified(), Alignment,
+ AllocType);
else if (AllocType->isAnyComplexType())
CGF.EmitComplexExprIntoAddr(Init, NewPtr,
AllocType.isVolatileQualified());