]> granicus.if.org Git - clang/commitdiff
reverse r158117.
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 6 Jun 2012 23:21:58 +0000 (23:21 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 6 Jun 2012 23:21:58 +0000 (23:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158119 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprScalar.cpp
test/CodeGen/vla.c

index fa7b1368314d32539bfa94d6ec5a90b8c4fb52e1..e0265545be377eef9ca1a62b8337cba4199e69e4 100644 (file)
@@ -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;
 
index d34f26b779ee19e9160072f7a424ba50ab2007a4..9e62da52e0266f1daa77e9bcaee946991f34ebbc 100644 (file)
@@ -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]]
-}