diff options
author | Daniel Dunbar <daniel@zuster.org> | 2011-04-01 00:13:33 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2011-04-01 00:13:33 +0000 |
commit | ea6b81a2ad3d3757c2d748ccab28c0c661cc38ed (patch) | |
tree | c2da87cbe2f3d0026a4683a34aa4d963ccbf88f8 /clang/lib/CodeGen/CGExpr.cpp | |
parent | d911f92c465bdc5d68a89b7729914be8dae85c65 (diff) | |
download | bcm5719-llvm-ea6b81a2ad3d3757c2d748ccab28c0c661cc38ed.tar.gz bcm5719-llvm-ea6b81a2ad3d3757c2d748ccab28c0c661cc38ed.zip |
Revert r128691, "IRgen: Improve GCC compatibility when dealing with packed
arrays by propagating", it's breaking test in ways I don't understand yet.
llvm-svn: 128693
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index cd68f8fdaf6..ab88a38babf 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -1424,7 +1424,6 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) { // We know that the pointer points to a type of the correct size, unless the // size is a VLA or Objective-C interface. llvm::Value *Address = 0; - unsigned ArrayAlignment = 0; if (const VariableArrayType *VAT = getContext().getAsVariableArrayType(E->getType())) { llvm::Value *VLASize = GetVLASize(VAT); @@ -1460,14 +1459,10 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) { // "gep x, i" here. Emit one "gep A, 0, i". assert(Array->getType()->isArrayType() && "Array to pointer decay must have array source type!"); - LValue ArrayLV = EmitLValue(Array); - llvm::Value *ArrayPtr = ArrayLV.getAddress(); + llvm::Value *ArrayPtr = EmitLValue(Array).getAddress(); llvm::Value *Zero = llvm::ConstantInt::get(Int32Ty, 0); llvm::Value *Args[] = { Zero, Idx }; - // Propagate the alignment from the array itself to the result. - ArrayAlignment = ArrayLV.getAlignment(); - if (getContext().getLangOptions().isSignedOverflowDefined()) Address = Builder.CreateGEP(ArrayPtr, Args, Args+2, "arrayidx"); else @@ -1485,7 +1480,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) { assert(!T.isNull() && "CodeGenFunction::EmitArraySubscriptExpr(): Illegal base type"); - LValue LV = MakeAddrLValue(Address, T, ArrayAlignment); + LValue LV = MakeAddrLValue(Address, T); LV.getQuals().setAddressSpace(E->getBase()->getType().getAddressSpace()); if (getContext().getLangOptions().ObjC1 && |