diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2010-08-21 02:24:36 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2010-08-21 02:24:36 +0000 |
| commit | 91a16fa3265686b90054715eea504d9b4a13438b (patch) | |
| tree | 1231112a41bba5d9569021926912372d6c1fe842 /lib/CodeGen/CGExprCXX.cpp | |
| parent | 4cac2a157c5a3d7c8f6cd79b52e891184623f29e (diff) | |
| download | clang-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.cpp | 7 |
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()); |
