[llvm-commits] [llvm-gcc-4.2] r137473 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-types.cpp
Chris Lattner
sabre at nondot.org
Fri Aug 12 10:45:04 PDT 2011
Author: lattner
Date: Fri Aug 12 12:45:04 2011
New Revision: 137473
URL: http://llvm.org/viewvc/llvm-project?rev=137473&view=rev
Log:
switch llvm-gcc to use the new-new api for creating struct types.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=137473&r1=137472&r2=137473&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Fri Aug 12 12:45:04 2011
@@ -8576,7 +8576,7 @@
// This is a hack for brokenness in the objc frontend.
StructType *LLVMTy = dyn_cast<StructType>(ConvertType(TREE_TYPE(exp)));
- if (LLVMTy && !LLVMTy->isAnonymous() &&
+ if (LLVMTy && !LLVMTy->isLiteral() &&
cast<StructType>(Result->getType())->isLayoutIdentical(LLVMTy))
Result = ConstantStruct::get(LLVMTy, LayoutInfo.ResultElts);
return Result;
Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=137473&r1=137472&r2=137473&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Fri Aug 12 12:45:04 2011
@@ -517,8 +517,7 @@
return Ty;
// Just mark it as a named type for now.
- Type *Ty = StructType::createNamed(Context,
- GetTypeName("enum.", orig_type));
+ Type *Ty = StructType::create(Context, GetTypeName("enum.", orig_type));
return SET_TYPE_LLVM(orig_type, Ty);
}
// FALL THROUGH.
@@ -1953,7 +1952,7 @@
} else {
// If we have no type for this, set it as an opaque named struct and
// continue.
- SET_TYPE_LLVM(type, StructType::createNamed(Context,
+ SET_TYPE_LLVM(type, StructType::create(Context,
GetTypeName(IsStruct ? "struct." : "union.", orig_type)));
}
More information about the llvm-commits
mailing list