diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-03-22 22:36:39 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-03-22 22:36:39 +0000 |
commit | 610bb87e17d193d30f498577dc46068d8db41c5a (patch) | |
tree | b8304f7518bff0486f0dc4b6a016bf8af1a296e7 /clang/lib/CodeGen/CGValue.h | |
parent | e26928c5bedccb3deb2784eaa65d4f31e3e8c749 (diff) | |
download | bcm5719-llvm-610bb87e17d193d30f498577dc46068d8db41c5a.tar.gz bcm5719-llvm-610bb87e17d193d30f498577dc46068d8db41c5a.zip |
Make sure we correctly set the alignment for vector loads and stores associated with vector element lvalues. Patch by Kevin Schoedel (with some minor modifications by me).
llvm-svn: 153285
Diffstat (limited to 'clang/lib/CodeGen/CGValue.h')
-rw-r--r-- | clang/lib/CodeGen/CGValue.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGValue.h b/clang/lib/CodeGen/CGValue.h index 744a6e02f9c..ac704e7dca4 100644 --- a/clang/lib/CodeGen/CGValue.h +++ b/clang/lib/CodeGen/CGValue.h @@ -126,7 +126,8 @@ class LValue { // 'const' is unused here Qualifiers Quals; - /// The alignment to use when accessing this lvalue. + // The alignment to use when accessing this lvalue. (For vector elements, + // this is the alignment of the whole vector.) unsigned short Alignment; // objective-c's ivar @@ -267,22 +268,22 @@ public: } static LValue MakeVectorElt(llvm::Value *Vec, llvm::Value *Idx, - QualType type) { + QualType type, CharUnits Alignment) { LValue R; R.LVType = VectorElt; R.V = Vec; R.VectorIdx = Idx; - R.Initialize(type, type.getQualifiers()); + R.Initialize(type, type.getQualifiers(), Alignment); return R; } static LValue MakeExtVectorElt(llvm::Value *Vec, llvm::Constant *Elts, - QualType type) { + QualType type, CharUnits Alignment) { LValue R; R.LVType = ExtVectorElt; R.V = Vec; R.VectorElts = Elts; - R.Initialize(type, type.getQualifiers()); + R.Initialize(type, type.getQualifiers(), Alignment); return R; } |