[cfe-commits] r77185 - in /cfe/trunk: lib/CodeGen/CGExprConstant.cpp test/CodeGen/PR3613-static-decl.c test/CodeGen/const-init.c test/CodeGen/designated-initializers.c
Anders Carlsson
andersca at mac.com
Sun Jul 26 22:54:15 PDT 2009
Author: andersca
Date: Mon Jul 27 00:54:15 2009
New Revision: 77185
URL: http://llvm.org/viewvc/llvm-project?rev=77185&view=rev
Log:
Enable the new constant struct builder by default. The old code is still in place but will be removed shortly. The new struct builder works on big endian systems.
Modified:
cfe/trunk/lib/CodeGen/CGExprConstant.cpp
cfe/trunk/test/CodeGen/PR3613-static-decl.c
cfe/trunk/test/CodeGen/const-init.c
cfe/trunk/test/CodeGen/designated-initializers.c
Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstant.cpp?rev=77185&r1=77184&r2=77185&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Mon Jul 27 00:54:15 2009
@@ -506,9 +506,10 @@
}
llvm::Constant *EmitStructInitialization(InitListExpr *ILE) {
- // FIXME: Use the returned struct when the builder works well enough.
- ConstStructBuilder::BuildStruct(CGM, CGF, ILE);
-
+ return ConstStructBuilder::BuildStruct(CGM, CGF, ILE);
+
+ // FIXME: Remove the old struct builder once we're sure that the new one
+ // works well enough!
const llvm::StructType *SType =
cast<llvm::StructType>(ConvertType(ILE->getType()));
RecordDecl *RD = ILE->getType()->getAsRecordType()->getDecl();
Modified: cfe/trunk/test/CodeGen/PR3613-static-decl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/PR3613-static-decl.c?rev=77185&r1=77184&r2=77185&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/PR3613-static-decl.c (original)
+++ cfe/trunk/test/CodeGen/PR3613-static-decl.c Mon Jul 27 00:54:15 2009
@@ -1,5 +1,5 @@
// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm -o %t %s &&
-// RUN: grep '@g0 = internal global .struct.s0 <{ i32 3 }>' %t | count 1
+// RUN: grep '@g0 = internal global %. { i32 3 }' %t | count 1
struct s0 {
int a;
Modified: cfe/trunk/test/CodeGen/const-init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/const-init.c?rev=77185&r1=77184&r2=77185&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/const-init.c (original)
+++ cfe/trunk/test/CodeGen/const-init.c Mon Jul 27 00:54:15 2009
@@ -59,7 +59,7 @@
static char g12_tmp;
long g12 = (long) &g12_tmp;
-// RUN: grep '@g13 = global \[1 x .struct.g13_s0\] \[.struct.g13_s0 <{ i32 ptrtoint (i8\* @g12_tmp to i32) }>\]' %t &&
+// RUN: grep '@g13 = global %. <{ %. { i32 ptrtoint (i8\* @g12_tmp to i32) } }>' %t &&
struct g13_s0 {
long a;
};
@@ -85,7 +85,7 @@
static int *p[] = { &g19 };
}
-// RUN: grep '@g20.l0 = internal global .struct.g20_s1 <{ .struct.g20_s0\* null, .struct.g20_s0\*\* getelementptr (.struct.g20_s1\* @g20.l0, i32 0, i32 0) }>' %t &&
+// RUN: grep '@g20.l0 = internal global %. { .struct.g20_s0\* null, .struct.g20_s0\*\* getelementptr (.struct.g20_s1\* bitcast (%.\* @g20.l0 to .struct.g20_s1\*), i32 0, i32 0) }' %t &&
struct g20_s0;
struct g20_s1 {
Modified: cfe/trunk/test/CodeGen/designated-initializers.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/designated-initializers.c?rev=77185&r1=77184&r2=77185&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/designated-initializers.c (original)
+++ cfe/trunk/test/CodeGen/designated-initializers.c Mon Jul 27 00:54:15 2009
@@ -1,5 +1,6 @@
-// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o - | grep "<{ i8\* null, i32 1024 }>" &&
-// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o - | grep "i32 0, i32 22"
+// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t &&
+// RUN: grep "{ i8\* null, i32 1024 }" %t &&
+// RUN: grep "i32 0, i32 22" %t
struct foo {
void *a;
More information about the cfe-commits
mailing list