[llvm-commits] [llvm-gcc-4.2] r78257 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386.cpp llvm-abi.h llvm-backend.cpp llvm-convert.cpp llvm-types.cpp
Owen Anderson
resistor at mac.com
Wed Aug 5 16:16:10 PDT 2009
Author: resistor
Date: Wed Aug 5 18:15:52 2009
New Revision: 78257
URL: http://llvm.org/viewvc/llvm-project?rev=78257&view=rev
Log:
Update for LLVM API change.
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
llvm-gcc-4.2/trunk/gcc/llvm-abi.h
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
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/config/i386/llvm-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=78257&r1=78256&r2=78257&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Wed Aug 5 18:15:52 2009
@@ -1313,12 +1313,12 @@
if (llvm_x86_should_not_return_complex_in_memory(type)) {
ElementTypes.push_back(Type::X86_FP80Ty);
ElementTypes.push_back(Type::X86_FP80Ty);
- return StructType::get(ElementTypes, STy->isPacked());
+ return StructType::get(Context, ElementTypes, STy->isPacked());
}
std::vector<const Type*> GCCElts;
llvm_x86_64_get_multiple_return_reg_classes(type, Ty, GCCElts);
- return StructType::get(GCCElts, false);
+ return StructType::get(Context, GCCElts, false);
}
// llvm_x86_extract_mrv_array_element - Helper function that help extract
Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-abi.h?rev=78257&r1=78256&r2=78257&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Wed Aug 5 18:15:52 2009
@@ -623,7 +623,7 @@
Size -= 1;
}
assert(Size == 0 && "Didn't cover value?");
- const StructType *STy = StructType::get(Elts, false);
+ const StructType *STy = StructType::get(getGlobalContext(), Elts, false);
unsigned i = 0;
if (ArraySize) {
@@ -661,7 +661,7 @@
if (OrigElts[i]==Type::VoidTy)
Elts[i] = wordType;
- const StructType *STy = StructType::get(Elts, false);
+ const StructType *STy = StructType::get(getGlobalContext(), Elts, false);
unsigned Size = getTargetData().getTypeAllocSize(STy);
const StructType *InSTy = dyn_cast<StructType>(Ty);
@@ -1062,7 +1062,7 @@
Size -= 1;
}
assert(Size == 0 && "Didn't cover value?");
- const StructType *STy = StructType::get(Elts, false);
+ const StructType *STy = StructType::get(getGlobalContext(), Elts, false);
unsigned i = 0;
if (ArraySize) {
@@ -1102,7 +1102,7 @@
if (OrigElts[i]==Type::VoidTy)
Elts[i] = wordType;
- const StructType *STy = StructType::get(Elts, false);
+ const StructType *STy = StructType::get(getGlobalContext(), Elts, false);
unsigned Size = getTargetData().getTypeAllocSize(STy);
const StructType *InSTy = dyn_cast<StructType>(Ty);
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=78257&r1=78256&r2=78257&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Wed Aug 5 18:15:52 2009
@@ -292,7 +292,7 @@
}
// Create string table.
- Constant *LLVMValuesTable = ConstantStruct::get(ValuesForPCH, false);
+ Constant *LLVMValuesTable = ConstantStruct::get(Context, ValuesForPCH, false);
// Create variable to hold this string table.
new GlobalVariable(*TheModule, LLVMValuesTable->getType(), true,
@@ -818,7 +818,7 @@
// __attribute__(constructor) can be on a function with any type. Make sure
// the pointer is void()*.
StructInit[1] = TheFolder->CreateBitCast(Tors[i].first, FPTy);
- InitList.push_back(ConstantStruct::get(StructInit, false));
+ InitList.push_back(ConstantStruct::get(Context, StructInit, false));
}
Constant *Array = ConstantArray::get(
ArrayType::get(InitList[0]->getType(), InitList.size()), InitList);
@@ -1181,7 +1181,7 @@
};
AttributeAnnotateGlobals.push_back(
- ConstantStruct::get(Element, 4, false));
+ ConstantStruct::get(Context, Element, 4, false));
}
// Get next annotate attribute.
@@ -1621,7 +1621,8 @@
// If we have "extern void foo", make the global have type {} instead of
// type void.
- if (Ty == Type::VoidTy) Ty = StructType::get(NULL, NULL);
+ if (Ty == Type::VoidTy)
+ Ty = StructType::get(Context);
if (Name[0] == 0) { // Global has no name.
GV = new GlobalVariable(*TheModule, Ty, false,
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=78257&r1=78256&r2=78257&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Wed Aug 5 18:15:52 2009
@@ -4559,7 +4559,7 @@
default:
std::vector<const Type*> TmpVec(CallResultTypes.begin(),
CallResultTypes.end());
- CallResultType = StructType::get(TmpVec);
+ CallResultType = StructType::get(Context, TmpVec);
break;
}
@@ -6778,7 +6778,7 @@
const Type *Ty = ConvertType(TREE_TYPE(exp));
// If we have "extern void foo", make the global have type {} instead of
// type void.
- if (Ty == Type::VoidTy) Ty = StructType::get(NULL, NULL);
+ if (Ty == Type::VoidTy) Ty = StructType::get(Context);
const PointerType *PTy = PointerType::getUnqual(Ty);
unsigned Alignment = Ty->isSized() ? TD.getABITypeAlignment(Ty) : 1;
if (DECL_ALIGN(exp)) {
@@ -7129,7 +7129,7 @@
std::vector<Constant*> Elts;
Elts.push_back(Convert(TREE_REALPART(exp)));
Elts.push_back(Convert(TREE_IMAGPART(exp)));
- return ConstantStruct::get(Elts, false);
+ return ConstantStruct::get(Context, Elts, false);
}
Constant *TreeConstantToLLVM::ConvertNOP_EXPR(tree exp) {
@@ -7315,7 +7315,7 @@
if (AllEltsSameType)
return ConstantArray::get(
ArrayType::get(ElTy, ResultElts.size()), ResultElts);
- return ConstantStruct::get(ResultElts, false);
+ return ConstantStruct::get(Context, ResultElts, false);
}
@@ -7735,8 +7735,8 @@
LayoutInfo.HandleTailPadding(getInt64(StructTypeSizeTree, true));
// Okay, we're done, return the computed elements.
- return
- ConstantStruct::get(LayoutInfo.ResultElts, LayoutInfo.StructIsPacked);
+ return ConstantStruct::get(Context, LayoutInfo.ResultElts,
+ LayoutInfo.StructIsPacked);
}
Constant *TreeConstantToLLVM::ConvertUnionCONSTRUCTOR(tree exp) {
@@ -7768,7 +7768,7 @@
Elts.push_back(Constant::getNullValue(FillTy));
}
}
- return ConstantStruct::get(Elts, false);
+ return ConstantStruct::get(Context, Elts, false);
}
//===----------------------------------------------------------------------===//
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=78257&r1=78256&r2=78257&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Wed Aug 5 18:15:52 2009
@@ -192,7 +192,7 @@
}
// Create string table.
- Constant *LTypesNameTable = ConstantStruct::get(LTypesNames, false);
+ Constant *LTypesNameTable = ConstantStruct::get(Context, LTypesNames, false);
// Create variable to hold this string table.
GlobalVariable *GV = new GlobalVariable(*TheModule,
@@ -752,8 +752,8 @@
#else
// 128-bit long doubles map onto { double, double }.
return SET_TYPE_LLVM(type,
- StructType::get(Type::DoubleTy, Type::DoubleTy,
- NULL));
+ StructType::get(Context, Type::DoubleTy,
+ Type::DoubleTy, NULL));
#endif
}
@@ -761,7 +761,7 @@
if (const Type *Ty = GET_TYPE_LLVM(type)) return Ty;
const Type *Ty = ConvertType(TREE_TYPE(type));
assert(!Ty->isAbstract() && "should use TypeDB.setType()");
- return SET_TYPE_LLVM(type, StructType::get(Ty, Ty, NULL));
+ return SET_TYPE_LLVM(type, StructType::get(Context, Ty, Ty, NULL));
}
case VECTOR_TYPE: {
if (const Type *Ty = GET_TYPE_LLVM(type)) return Ty;
@@ -1358,7 +1358,7 @@
const Type *getLLVMType() const {
// Use Packed type if Packed is set or all struct fields are bitfields.
// Empty struct is not packed unless packed is set.
- return StructType::get(Elements,
+ return StructType::get(Context, Elements,
Packed || (!Elements.empty() && AllBitFields));
}
@@ -2448,7 +2448,7 @@
}
bool isPacked = 8 * EltAlign > TYPE_ALIGN(type);
- const Type *ResultTy = StructType::get(UnionElts, isPacked);
+ const Type *ResultTy = StructType::get(Context, UnionElts, isPacked);
const OpaqueType *OldTy = cast_or_null<OpaqueType>(GET_TYPE_LLVM(type));
TypeDB.setType(type, ResultTy);
More information about the llvm-commits
mailing list