summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-06-06 23:21:58 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-06-06 23:21:58 +0000
commitff045dc0409d10ba8868e25e9f11156c55ca0967 (patch)
tree4b1ce327502ea4c67cddad03fcb0df1417d153b5
parent67164852a7cc0923b857c84c515ad67969e81a67 (diff)
downloadbcm5719-llvm-ff045dc0409d10ba8868e25e9f11156c55ca0967.tar.gz
bcm5719-llvm-ff045dc0409d10ba8868e25e9f11156c55ca0967.zip
reverse r158117.
llvm-svn: 158119
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp3
-rw-r--r--clang/test/CodeGen/vla.c20
2 files changed, 0 insertions, 23 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index fa7b1368314..e0265545be3 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -1970,9 +1970,6 @@ static Value *emitPointerArithmetic(CodeGenFunction &CGF,
QualType elementType = pointerType->getPointeeType();
if (const VariableArrayType *vla
= CGF.getContext().getAsVariableArrayType(elementType)) {
- // arithmatic on VLA pointer - make sure to emit the VLA size.
- CGF.EmitVariablyModifiedType(elementType);
-
// The element count here is the total number of non-VLA elements.
llvm::Value *numElements = CGF.getVLASize(vla).first;
diff --git a/clang/test/CodeGen/vla.c b/clang/test/CodeGen/vla.c
index d34f26b779e..9e62da52e02 100644
--- a/clang/test/CodeGen/vla.c
+++ b/clang/test/CodeGen/vla.c
@@ -142,23 +142,3 @@ int test4(unsigned n, char (*p)[n][n+1][6]) {
// CHECK-NEXT: ret i32 [[T7]]
return p2 - p;
}
-
-// rdar://11485774
-void test5(void)
-{
- // CHECK: define void @test5(
- int a[5], i = 0;
- // CHECK: [[A:%.*]] = alloca [5 x i32], align 4
- // CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
- // CHECK-NEXT: [[CL:%.*]] = alloca i32*, align 4
- // CHECK-NEXT: store i32 0, i32* [[I]], align 4
-
- (typeof(++i, (int (*)[i])a)){&a} += 0;
- // CHECK-NEXT: [[Z:%.*]] = bitcast [5 x i32]* [[A]] to i32*
- // CHECK-NEXT: store i32* [[Z]], i32** [[CL]]
- // CHECK-NEXT: [[O:%.*]] = load i32** [[CL]]
- // CHECK-NEXT: [[T:%.*]] = load i32* [[I]], align 4
- // CHECK-NEXT: [[VLAIX:%.*]] = mul nsw i32 0, [[T]]
- // CHECK-NEXT: [[ADDPTR:%.*]] = getelementptr inbounds i32* [[O]], i32 [[VLAIX]]
- // CHECK-NEXT: store i32* [[ADDPTR]], i32** [[CL]]
-}
OpenPOWER on IntegriCloud