[llvm-branch-commits] [cfe-branch] r134793 - in /cfe/branches/type-system-rewrite: lib/CodeGen/CodeGenTypes.cpp test/CodeGenObjC/arc.m test/CodeGenObjC/property.m test/CodeGenObjC/return-objc-object.mm
Chris Lattner
sabre at nondot.org
Fri Jul 8 22:30:06 PDT 2011
Author: lattner
Date: Sat Jul 9 00:30:06 2011
New Revision: 134793
URL: http://llvm.org/viewvc/llvm-project?rev=134793&view=rev
Log:
adjust some tests to accept ir that clang is generating now. Adjust
clang to lower objc interface types to named structs with empty names like
before so that I don't have to update tons of tests.
Modified:
cfe/branches/type-system-rewrite/lib/CodeGen/CodeGenTypes.cpp
cfe/branches/type-system-rewrite/test/CodeGenObjC/arc.m
cfe/branches/type-system-rewrite/test/CodeGenObjC/property.m
cfe/branches/type-system-rewrite/test/CodeGenObjC/return-objc-object.mm
Modified: cfe/branches/type-system-rewrite/lib/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/type-system-rewrite/lib/CodeGen/CodeGenTypes.cpp?rev=134793&r1=134792&r2=134793&view=diff
==============================================================================
--- cfe/branches/type-system-rewrite/lib/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/branches/type-system-rewrite/lib/CodeGen/CodeGenTypes.cpp Sat Jul 9 00:30:06 2011
@@ -334,7 +334,7 @@
// these.
llvm::Type *&T = InterfaceTypes[cast<ObjCInterfaceType>(Ty)];
if (!T)
- T = llvm::StructType::get(getLLVMContext());
+ T = llvm::StructType::createNamed(getLLVMContext(), "");
ResultType = T;
break;
}
@@ -459,11 +459,13 @@
void CodeGenTypes::addBaseSubobjectTypeName(const CXXRecordDecl *RD,
const CGRecordLayout &layout) {
+#if 0
llvm::StringRef suffix;
if (layout.getBaseSubobjectLLVMType() != layout.getLLVMType())
suffix = ".base";
addRecordTypeName(RD, layout.getBaseSubobjectLLVMType(), suffix);
+#endif
}
bool CodeGenTypes::isZeroInitializable(QualType T) {
Modified: cfe/branches/type-system-rewrite/test/CodeGenObjC/arc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/type-system-rewrite/test/CodeGenObjC/arc.m?rev=134793&r1=134792&r2=134793&view=diff
==============================================================================
--- cfe/branches/type-system-rewrite/test/CodeGenObjC/arc.m (original)
+++ cfe/branches/type-system-rewrite/test/CodeGenObjC/arc.m Sat Jul 9 00:30:06 2011
@@ -622,7 +622,7 @@
int (^test25(int x))(void) {
// CHECK: define i32 ()* @test25(
// CHECK: [[X:%.*]] = alloca i32,
- // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:%.*]],
+ // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK-NEXT: store i32 {{%.*}}, i32* [[X]]
// CHECK: [[T0:%.*]] = bitcast [[BLOCK_T]]* [[BLOCK]] to i32 ()*
// CHECK-NEXT: [[T1:%.*]] = bitcast i32 ()* [[T0]] to i8*
@@ -890,7 +890,7 @@
void test31(id x) {
// CHECK: define void @test31(
// CHECK: [[X:%.*]] = alloca i8*,
-// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:%.*]],
+// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK-NEXT: [[PARM:%.*]] = call i8* @objc_retain(i8* {{%.*}})
// CHECK-NEXT: store i8* [[PARM]], i8** [[X]]
// CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5
@@ -1165,7 +1165,7 @@
// CHECK: define void @test38()
// CHECK: [[VAR:%.*]] = alloca [[BYREF_T:%.*]],
- // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:%.*]],
+ // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* [[VAR]], i32 0, i32 2
// 0x02000000 - has copy/dispose helpers
// CHECK-NEXT: store i32 33554432, i32* [[T0]]
@@ -1200,7 +1200,7 @@
// CHECK-NEXT: call void @objc_release(i8* [[T1]])
// CHECK: define internal void @__test38_block_invoke_
- // CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]]* {{%.*}}, i32 0, i32 6
+ // CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]]* {{.*}}, i32 0, i32 6
// CHECK-NEXT: [[T0:%.*]] = load i8** [[SLOT]], align 8
// CHECK-NEXT: store i8* null, i8** [[SLOT]],
// CHECK-NEXT: call void @objc_release(i8* [[T0]])
@@ -1221,7 +1221,7 @@
// CHECK: define void @test39()
// CHECK: [[VAR:%.*]] = alloca i8*
- // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:%.*]],
+ // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK-NEXT: [[T0:%.*]] = call i8* @test39_source()
// CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]])
// CHECK-NEXT: store i8* [[T1]], i8** [[VAR]],
@@ -1244,7 +1244,7 @@
// CHECK: define void @test40()
// CHECK: [[VAR:%.*]] = alloca [[BYREF_T:%.*]],
- // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:%.*]],
+ // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK: [[T0:%.*]] = getelementptr inbounds [[BYREF_T]]* [[VAR]], i32 0, i32 2
// 0x02000000 - has copy/dispose helpers
// CHECK-NEXT: store i32 33554432, i32* [[T0]]
@@ -1298,7 +1298,7 @@
// CHECK: define void @test41()
// CHECK: [[VAR:%.*]] = alloca i8*,
- // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:%.*]],
+ // CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK: [[T0:%.*]] = call i8* @test41_source()
// CHECK-NEXT: [[T1:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T0]])
// CHECK-NEXT: call i8* @objc_initWeak(i8** [[VAR]], i8* [[T1]])
@@ -1335,7 +1335,7 @@
// CHECK: define internal void @"\01-[Test42 test]"
// CHECK: [[SELF:%.*]] = alloca [[TEST42:%.*]]*,
// CHECK-NEXT: alloca i8*
-// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:%.*]],
+// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
// CHECK-NEXT: store
// CHECK-NEXT: store
// CHECK: [[T0:%.*]] = getelementptr inbounds [[BLOCK_T]]* [[BLOCK]], i32 0, i32 5
Modified: cfe/branches/type-system-rewrite/test/CodeGenObjC/property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/type-system-rewrite/test/CodeGenObjC/property.m?rev=134793&r1=134792&r2=134793&view=diff
==============================================================================
--- cfe/branches/type-system-rewrite/test/CodeGenObjC/property.m (original)
+++ cfe/branches/type-system-rewrite/test/CodeGenObjC/property.m Sat Jul 9 00:30:06 2011
@@ -57,23 +57,23 @@
// CHECK: define void @test2
A *test2_helper(void);
void test2() {
- // CHECK: [[BASE:%.*]] = call [[A:%.*]]* @test2_helper()
+ // CHECK: [[BASE:%.*]] = call {}* @test2_helper()
// CHECK-NEXT: [[SEL:%.*]] = load i8**
- // CHECK-NEXT: [[BASETMP:%.*]] = bitcast [[A]]* [[BASE]] to i8*
+ // CHECK-NEXT: [[BASETMP:%.*]] = bitcast {}* [[BASE]] to i8*
// CHECK-NEXT: [[LD:%.*]] = call i32 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i32 (i8*, i8*)*)(i8* [[BASETMP]], i8* [[SEL]])
// CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[LD]], 1
// CHECK-NEXT: [[SEL:%.*]] = load i8**
- // CHECK-NEXT: [[BASETMP:%.*]] = bitcast [[A]]* [[BASE]] to i8*
+ // CHECK-NEXT: [[BASETMP:%.*]] = bitcast {}* [[BASE]] to i8*
// CHECK-NEXT: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i32)*)(i8* [[BASETMP]], i8* [[SEL]], i32 [[ADD]])
test2_helper().dyn++;
- // CHECK: [[BASE:%.*]] = call [[A]]* @test2_helper()
+ // CHECK: [[BASE:%.*]] = call {}* @test2_helper()
// CHECK-NEXT: [[SEL:%.*]] = load i8**
- // CHECK-NEXT: [[BASETMP:%.*]] = bitcast [[A]]* [[BASE]] to i8*
+ // CHECK-NEXT: [[BASETMP:%.*]] = bitcast {}* [[BASE]] to i8*
// CHECK-NEXT: [[LD:%.*]] = call i32 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i32 (i8*, i8*)*)(i8* [[BASETMP]], i8* [[SEL]])
// CHECK-NEXT: [[ADD:%.*]] = mul nsw i32 [[LD]], 10
// CHECK-NEXT: [[SEL:%.*]] = load i8**
- // CHECK-NEXT: [[BASETMP:%.*]] = bitcast [[A]]* [[BASE]] to i8*
+ // CHECK-NEXT: [[BASETMP:%.*]] = bitcast {}* [[BASE]] to i8*
// CHECK-NEXT: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i32)*)(i8* [[BASETMP]], i8* [[SEL]], i32 [[ADD]])
test2_helper().dyn *= 10;
}
Modified: cfe/branches/type-system-rewrite/test/CodeGenObjC/return-objc-object.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/type-system-rewrite/test/CodeGenObjC/return-objc-object.mm?rev=134793&r1=134792&r2=134793&view=diff
==============================================================================
--- cfe/branches/type-system-rewrite/test/CodeGenObjC/return-objc-object.mm (original)
+++ cfe/branches/type-system-rewrite/test/CodeGenObjC/return-objc-object.mm Sat Jul 9 00:30:06 2011
@@ -15,5 +15,5 @@
f();
f1();
}
-// CHECK: call %0* @_Z1fv()
-// CHECK: call %0* @_Z2f1v()
+// CHECK: call {}* @_Z1fv()
+// CHECK: call {}* @_Z2f1v()
More information about the llvm-branch-commits
mailing list