update for api change.

llvm-svn: 133365
This commit is contained in:
Chris Lattner 2011-06-18 22:49:11 +00:00
parent f3f545ea8a
commit 845511fe1c
9 changed files with 66 additions and 116 deletions

View File

@ -677,10 +677,8 @@ const llvm::Type *CodeGenModule::getBlockDescriptorType() {
// const char *signature; // the block signature
// const char *layout; // reserved
// };
BlockDescriptorType = llvm::StructType::get(UnsignedLongTy->getContext(),
UnsignedLongTy,
UnsignedLongTy,
NULL);
BlockDescriptorType =
llvm::StructType::get(UnsignedLongTy, UnsignedLongTy, NULL);
getModule().addTypeName("struct.__block_descriptor",
BlockDescriptorType);
@ -703,8 +701,7 @@ const llvm::Type *CodeGenModule::getGenericBlockLiteralType() {
// void (*__invoke)(void *);
// struct __block_descriptor *__descriptor;
// };
GenericBlockLiteralType = llvm::StructType::get(getLLVMContext(),
VoidPtrTy,
GenericBlockLiteralType = llvm::StructType::get(VoidPtrTy,
IntTy,
IntTy,
VoidPtrTy,

View File

@ -1204,8 +1204,7 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID,
if (BuiltinID == ARM::BI__builtin_arm_strexd) {
Function *F = CGM.getIntrinsic(Intrinsic::arm_strexd);
llvm::Type *STy = llvm::StructType::get(getLLVMContext(), Int32Ty, Int32Ty,
NULL);
llvm::Type *STy = llvm::StructType::get(Int32Ty, Int32Ty, NULL);
Value *One = llvm::ConstantInt::get(Int32Ty, 1);
Value *Tmp = Builder.CreateAlloca(Int64Ty, One, "tmp");

View File

@ -49,8 +49,7 @@ DominatingValue<RValue>::saved_type::save(CodeGenFunction &CGF, RValue rv) {
if (rv.isComplex()) {
CodeGenFunction::ComplexPairTy V = rv.getComplexVal();
const llvm::Type *ComplexTy =
llvm::StructType::get(CGF.getLLVMContext(),
V.first->getType(), V.second->getType(),
llvm::StructType::get(V.first->getType(), V.second->getType(),
(void*) 0);
llvm::Value *addr = CGF.CreateTempAlloca(ComplexTy, "saved-complex");
CGF.StoreComplexToAddr(V, addr, /*volatile*/ false);

View File

@ -604,7 +604,7 @@ class CGObjCGNUstep : public CGObjCGNU {
}
public:
CGObjCGNUstep(CodeGenModule &Mod) : CGObjCGNU(Mod, 9, 3) {
llvm::StructType *SlotStructTy = llvm::StructType::get(VMContext, PtrTy,
llvm::StructType *SlotStructTy = llvm::StructType::get(PtrTy,
PtrTy, PtrTy, IntTy, IMPTy, NULL);
SlotTy = llvm::PointerType::getUnqual(SlotStructTy);
// Slot_t objc_msg_lookup_sender(id *receiver, SEL selector, id sender);
@ -705,7 +705,7 @@ CGObjCGNU::CGObjCGNU(CodeGenModule &cgm, unsigned runtimeABIVersion,
}
PtrToIdTy = llvm::PointerType::getUnqual(IdTy);
ObjCSuperTy = llvm::StructType::get(VMContext, IdTy, IdTy, NULL);
ObjCSuperTy = llvm::StructType::get(IdTy, IdTy, NULL);
PtrToObjCSuperTy = llvm::PointerType::getUnqual(ObjCSuperTy);
const llvm::Type *VoidTy = llvm::Type::getVoidTy(VMContext);
@ -908,7 +908,7 @@ llvm::Constant *CGObjCGNU::GetEHType(QualType T) {
fields.push_back(Vtable);
fields.push_back(typeName);
llvm::Constant *TI =
MakeGlobal(llvm::StructType::get(VMContext, PtrToInt8Ty, PtrToInt8Ty,
MakeGlobal(llvm::StructType::get(PtrToInt8Ty, PtrToInt8Ty,
NULL), fields, "__objc_eh_typeinfo_" + className,
llvm::GlobalValue::LinkOnceODRLinkage);
return llvm::ConstantExpr::getBitCast(TI, PtrToInt8Ty);
@ -929,7 +929,7 @@ llvm::Constant *CGObjCGNU::GenerateConstantString(const StringLiteral *SL) {
Ivars.push_back(MakeConstantString(Str));
Ivars.push_back(llvm::ConstantInt::get(IntTy, Str.size()));
llvm::Constant *ObjCStr = MakeGlobal(
llvm::StructType::get(VMContext, PtrToInt8Ty, PtrToInt8Ty, IntTy, NULL),
llvm::StructType::get(PtrToInt8Ty, PtrToInt8Ty, IntTy, NULL),
Ivars, ".objc_str");
ObjCStr = llvm::ConstantExpr::getBitCast(ObjCStr, PtrToInt8Ty);
ObjCStrings[Str] = ObjCStr;
@ -1012,13 +1012,13 @@ CGObjCGNU::GenerateMessageSendSuper(CodeGenFunction &CGF,
// Cast the pointer to a simplified version of the class structure
ReceiverClass = Builder.CreateBitCast(ReceiverClass,
llvm::PointerType::getUnqual(
llvm::StructType::get(VMContext, IdTy, IdTy, NULL)));
llvm::StructType::get(IdTy, IdTy, NULL)));
// Get the superclass pointer
ReceiverClass = Builder.CreateStructGEP(ReceiverClass, 1);
// Load the superclass pointer
ReceiverClass = Builder.CreateLoad(ReceiverClass);
// Construct the structure used to look up the IMP
llvm::StructType *ObjCSuperTy = llvm::StructType::get(VMContext,
llvm::StructType *ObjCSuperTy = llvm::StructType::get(
Receiver->getType(), IdTy, NULL);
llvm::Value *ObjCSuper = Builder.CreateAlloca(ObjCSuperTy);
@ -1187,7 +1187,7 @@ llvm::Constant *CGObjCGNU::GenerateMethodList(const llvm::StringRef &ClassName,
if (MethodSels.empty())
return NULLPtr;
// Get the method structure type.
llvm::StructType *ObjCMethodTy = llvm::StructType::get(VMContext,
llvm::StructType *ObjCMethodTy = llvm::StructType::get(
PtrToInt8Ty, // Really a selector, but the runtime creates it us.
PtrToInt8Ty, // Method types
IMPTy, //Method pointer
@ -1220,7 +1220,7 @@ llvm::Constant *CGObjCGNU::GenerateMethodList(const llvm::StringRef &ClassName,
llvm::SmallVector<const llvm::Type*, 16> ObjCMethodListFields;
llvm::PATypeHolder OpaqueNextTy = llvm::OpaqueType::get(VMContext);
llvm::Type *NextPtrTy = llvm::PointerType::getUnqual(OpaqueNextTy);
llvm::StructType *ObjCMethodListTy = llvm::StructType::get(VMContext,
llvm::StructType *ObjCMethodListTy = llvm::StructType::get(
NextPtrTy,
IntTy,
ObjCMethodArrayTy,
@ -1249,7 +1249,7 @@ llvm::Constant *CGObjCGNU::GenerateIvarList(
if (IvarNames.size() == 0)
return NULLPtr;
// Get the method structure type.
llvm::StructType *ObjCIvarTy = llvm::StructType::get(VMContext,
llvm::StructType *ObjCIvarTy = llvm::StructType::get(
PtrToInt8Ty,
PtrToInt8Ty,
IntTy,
@ -1273,7 +1273,7 @@ llvm::Constant *CGObjCGNU::GenerateIvarList(
Elements.push_back(llvm::ConstantInt::get(IntTy, (int)IvarNames.size()));
Elements.push_back(llvm::ConstantArray::get(ObjCIvarArrayTy, Ivars));
// Structure containing array and array count
llvm::StructType *ObjCIvarListTy = llvm::StructType::get(VMContext, IntTy,
llvm::StructType *ObjCIvarListTy = llvm::StructType::get(IntTy,
ObjCIvarArrayTy,
NULL);
@ -1302,7 +1302,7 @@ llvm::Constant *CGObjCGNU::GenerateClassStructure(
// Fields marked New ABI are part of the GNUstep runtime. We emit them
// anyway; the classes will still work with the GNU runtime, they will just
// be ignored.
llvm::StructType *ClassTy = llvm::StructType::get(VMContext,
llvm::StructType *ClassTy = llvm::StructType::get(
PtrToInt8Ty, // class_pointer
PtrToInt8Ty, // super_class
PtrToInt8Ty, // name
@ -1359,7 +1359,7 @@ llvm::Constant *CGObjCGNU::GenerateProtocolMethodList(
const llvm::SmallVectorImpl<llvm::Constant *> &MethodNames,
const llvm::SmallVectorImpl<llvm::Constant *> &MethodTypes) {
// Get the method structure type.
llvm::StructType *ObjCMethodDescTy = llvm::StructType::get(VMContext,
llvm::StructType *ObjCMethodDescTy = llvm::StructType::get(
PtrToInt8Ty, // Really a selector, but the runtime does the casting for us.
PtrToInt8Ty,
NULL);
@ -1375,7 +1375,7 @@ llvm::Constant *CGObjCGNU::GenerateProtocolMethodList(
MethodNames.size());
llvm::Constant *Array = llvm::ConstantArray::get(ObjCMethodArrayTy,
Methods);
llvm::StructType *ObjCMethodDescListTy = llvm::StructType::get(VMContext,
llvm::StructType *ObjCMethodDescListTy = llvm::StructType::get(
IntTy, ObjCMethodArrayTy, NULL);
Methods.clear();
Methods.push_back(llvm::ConstantInt::get(IntTy, MethodNames.size()));
@ -1388,7 +1388,7 @@ llvm::Constant *CGObjCGNU::GenerateProtocolList(
const llvm::SmallVectorImpl<std::string> &Protocols) {
llvm::ArrayType *ProtocolArrayTy = llvm::ArrayType::get(PtrToInt8Ty,
Protocols.size());
llvm::StructType *ProtocolListTy = llvm::StructType::get(VMContext,
llvm::StructType *ProtocolListTy = llvm::StructType::get(
PtrTy, //Should be a recurisve pointer, but it's always NULL here.
SizeTy,
ProtocolArrayTy,
@ -1435,7 +1435,7 @@ llvm::Constant *CGObjCGNU::GenerateEmptyProtocol(
GenerateProtocolMethodList(EmptyConstantVector, EmptyConstantVector);
// Protocols are objects containing lists of the methods implemented and
// protocols adopted.
llvm::StructType *ProtocolTy = llvm::StructType::get(VMContext, IdTy,
llvm::StructType *ProtocolTy = llvm::StructType::get(IdTy,
PtrToInt8Ty,
ProtocolList->getType(),
MethodList->getType(),
@ -1521,7 +1521,7 @@ void CGObjCGNU::GenerateProtocol(const ObjCProtocolDecl *PD) {
// The isSynthesized value is always set to 0 in a protocol. It exists to
// simplify the runtime library by allowing it to use the same data
// structures for protocol metadata everywhere.
llvm::StructType *PropertyMetadataTy = llvm::StructType::get(VMContext,
llvm::StructType *PropertyMetadataTy = llvm::StructType::get(
PtrToInt8Ty, Int8Ty, Int8Ty, PtrToInt8Ty, PtrToInt8Ty, PtrToInt8Ty,
PtrToInt8Ty, NULL);
std::vector<llvm::Constant*> Properties;
@ -1594,7 +1594,7 @@ void CGObjCGNU::GenerateProtocol(const ObjCProtocolDecl *PD) {
// Protocols are objects containing lists of the methods implemented and
// protocols adopted.
llvm::StructType *ProtocolTy = llvm::StructType::get(VMContext, IdTy,
llvm::StructType *ProtocolTy = llvm::StructType::get(IdTy,
PtrToInt8Ty,
ProtocolList->getType(),
InstanceMethodList->getType(),
@ -1641,7 +1641,7 @@ void CGObjCGNU::GenerateProtocolHolderCategory(void) {
// Protocol list
llvm::ArrayType *ProtocolArrayTy = llvm::ArrayType::get(PtrTy,
ExistingProtocols.size());
llvm::StructType *ProtocolListTy = llvm::StructType::get(VMContext,
llvm::StructType *ProtocolListTy = llvm::StructType::get(
PtrTy, //Should be a recurisve pointer, but it's always NULL here.
SizeTy,
ProtocolArrayTy,
@ -1664,7 +1664,7 @@ void CGObjCGNU::GenerateProtocolHolderCategory(void) {
Elements.push_back(llvm::ConstantExpr::getBitCast(MakeGlobal(ProtocolListTy,
ProtocolElements, ".objc_protocol_list"), PtrTy));
Categories.push_back(llvm::ConstantExpr::getBitCast(
MakeGlobal(llvm::StructType::get(VMContext, PtrToInt8Ty, PtrToInt8Ty,
MakeGlobal(llvm::StructType::get(PtrToInt8Ty, PtrToInt8Ty,
PtrTy, PtrTy, PtrTy, NULL), Elements), PtrTy));
}
@ -1718,7 +1718,7 @@ void CGObjCGNU::GenerateCategory(const ObjCCategoryImplDecl *OCD) {
Elements.push_back(llvm::ConstantExpr::getBitCast(
GenerateProtocolList(Protocols), PtrTy));
Categories.push_back(llvm::ConstantExpr::getBitCast(
MakeGlobal(llvm::StructType::get(VMContext, PtrToInt8Ty, PtrToInt8Ty,
MakeGlobal(llvm::StructType::get(PtrToInt8Ty, PtrToInt8Ty,
PtrTy, PtrTy, PtrTy, NULL), Elements), PtrTy));
}
@ -1729,7 +1729,7 @@ llvm::Constant *CGObjCGNU::GeneratePropertyList(const ObjCImplementationDecl *OI
//
// Property metadata: name, attributes, isSynthesized, setter name, setter
// types, getter name, getter types.
llvm::StructType *PropertyMetadataTy = llvm::StructType::get(VMContext,
llvm::StructType *PropertyMetadataTy = llvm::StructType::get(
PtrToInt8Ty, Int8Ty, Int8Ty, PtrToInt8Ty, PtrToInt8Ty, PtrToInt8Ty,
PtrToInt8Ty, NULL);
std::vector<llvm::Constant*> Properties;
@ -2007,8 +2007,7 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
SelectorTy->getElementType());
const llvm::Type *SelStructPtrTy = SelectorTy;
if (SelStructTy == 0) {
SelStructTy = llvm::StructType::get(VMContext, PtrToInt8Ty,
PtrToInt8Ty, NULL);
SelStructTy = llvm::StructType::get(PtrToInt8Ty, PtrToInt8Ty, NULL);
SelStructPtrTy = llvm::PointerType::getUnqual(SelStructTy);
}
@ -2034,7 +2033,7 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
Elements.push_back(llvm::ConstantArray::get(StaticsArrayTy,
ConstantStrings));
llvm::StructType *StaticsListTy =
llvm::StructType::get(VMContext, PtrToInt8Ty, StaticsArrayTy, NULL);
llvm::StructType::get(PtrToInt8Ty, StaticsArrayTy, NULL);
llvm::Type *StaticsListPtrTy =
llvm::PointerType::getUnqual(StaticsListTy);
Statics = MakeGlobal(StaticsListTy, Elements, ".objc_statics");
@ -2049,8 +2048,7 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
// Array of classes, categories, and constant objects
llvm::ArrayType *ClassListTy = llvm::ArrayType::get(PtrToInt8Ty,
Classes.size() + Categories.size() + 2);
llvm::StructType *SymTabTy = llvm::StructType::get(VMContext,
LongTy, SelStructPtrTy,
llvm::StructType *SymTabTy = llvm::StructType::get(LongTy, SelStructPtrTy,
llvm::Type::getInt16Ty(VMContext),
llvm::Type::getInt16Ty(VMContext),
ClassListTy, NULL);
@ -2132,7 +2130,7 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
// The symbol table is contained in a module which has some version-checking
// constants
llvm::StructType * ModuleTy = llvm::StructType::get(VMContext, LongTy, LongTy,
llvm::StructType * ModuleTy = llvm::StructType::get(LongTy, LongTy,
PtrToInt8Ty, llvm::PointerType::getUnqual(SymTabTy),
(CGM.getLangOptions().getGCMode() == LangOptions::NonGC) ? NULL : IntTy,
NULL);

View File

@ -4148,7 +4148,7 @@ ObjCCommonTypesHelper::ObjCCommonTypesHelper(CodeGen::CodeGenModule &cgm)
// char *name;
// char *attributes;
// }
PropertyTy = llvm::StructType::get(VMContext, Int8PtrTy, Int8PtrTy, NULL);
PropertyTy = llvm::StructType::get(Int8PtrTy, Int8PtrTy, NULL);
CGM.getModule().addTypeName("struct._prop_t",
PropertyTy);
@ -4157,8 +4157,7 @@ ObjCCommonTypesHelper::ObjCCommonTypesHelper(CodeGen::CodeGenModule &cgm)
// uint32_t count_of_properties;
// struct _prop_t prop_list[count_of_properties];
// }
PropertyListTy = llvm::StructType::get(VMContext, IntTy,
IntTy,
PropertyListTy = llvm::StructType::get(IntTy, IntTy,
llvm::ArrayType::get(PropertyTy, 0),
NULL);
CGM.getModule().addTypeName("struct._prop_list_t",
@ -4171,10 +4170,7 @@ ObjCCommonTypesHelper::ObjCCommonTypesHelper(CodeGen::CodeGenModule &cgm)
// char *method_type;
// char *_imp;
// }
MethodTy = llvm::StructType::get(VMContext, SelectorPtrTy,
Int8PtrTy,
Int8PtrTy,
NULL);
MethodTy = llvm::StructType::get(SelectorPtrTy, Int8PtrTy, Int8PtrTy, NULL);
CGM.getModule().addTypeName("struct._objc_method", MethodTy);
// struct _objc_cache *
@ -4190,9 +4186,7 @@ ObjCTypesHelper::ObjCTypesHelper(CodeGen::CodeGenModule &cgm)
// char *types;
// }
MethodDescriptionTy =
llvm::StructType::get(VMContext, SelectorPtrTy,
Int8PtrTy,
NULL);
llvm::StructType::get(SelectorPtrTy, Int8PtrTy, NULL);
CGM.getModule().addTypeName("struct._objc_method_description",
MethodDescriptionTy);
@ -4201,8 +4195,7 @@ ObjCTypesHelper::ObjCTypesHelper(CodeGen::CodeGenModule &cgm)
// struct _objc_method_description[1];
// }
MethodDescriptionListTy =
llvm::StructType::get(VMContext, IntTy,
llvm::ArrayType::get(MethodDescriptionTy, 0),
llvm::StructType::get(IntTy, llvm::ArrayType::get(MethodDescriptionTy, 0),
NULL);
CGM.getModule().addTypeName("struct._objc_method_description_list",
MethodDescriptionListTy);
@ -4220,7 +4213,7 @@ ObjCTypesHelper::ObjCTypesHelper(CodeGen::CodeGenModule &cgm)
// struct _objc_property_list *instance_properties;
// }
ProtocolExtensionTy =
llvm::StructType::get(VMContext, IntTy,
llvm::StructType::get(IntTy,
MethodDescriptionListPtrTy,
MethodDescriptionListPtrTy,
PropertyListPtrTy,
@ -4237,8 +4230,7 @@ ObjCTypesHelper::ObjCTypesHelper(CodeGen::CodeGenModule &cgm)
llvm::PATypeHolder ProtocolListTyHolder = llvm::OpaqueType::get(VMContext);
const llvm::Type *T =
llvm::StructType::get(VMContext,
llvm::PointerType::getUnqual(ProtocolListTyHolder),
llvm::StructType::get(llvm::PointerType::getUnqual(ProtocolListTyHolder),
LongTy,
llvm::ArrayType::get(ProtocolTyHolder, 0),
NULL);
@ -4251,8 +4243,7 @@ ObjCTypesHelper::ObjCTypesHelper(CodeGen::CodeGenModule &cgm)
// struct _objc_method_description_list *instance_methods;
// struct _objc_method_description_list *class_methods;
// }
T = llvm::StructType::get(VMContext, ProtocolExtensionPtrTy,
Int8PtrTy,
T = llvm::StructType::get(ProtocolExtensionPtrTy, Int8PtrTy,
llvm::PointerType::getUnqual(ProtocolListTyHolder),
MethodDescriptionListPtrTy,
MethodDescriptionListPtrTy,
@ -4276,10 +4267,7 @@ ObjCTypesHelper::ObjCTypesHelper(CodeGen::CodeGenModule &cgm)
// char *ivar_type;
// int ivar_offset;
// }
IvarTy = llvm::StructType::get(VMContext, Int8PtrTy,
Int8PtrTy,
IntTy,
NULL);
IvarTy = llvm::StructType::get(Int8PtrTy, Int8PtrTy, IntTy, NULL);
CGM.getModule().addTypeName("struct._objc_ivar", IvarTy);
// struct _objc_ivar_list *
@ -4294,10 +4282,7 @@ ObjCTypesHelper::ObjCTypesHelper(CodeGen::CodeGenModule &cgm)
// struct _objc_class_extension *
ClassExtensionTy =
llvm::StructType::get(VMContext, IntTy,
Int8PtrTy,
PropertyListPtrTy,
NULL);
llvm::StructType::get(IntTy, Int8PtrTy, PropertyListPtrTy, NULL);
CGM.getModule().addTypeName("struct._objc_class_extension", ClassExtensionTy);
ClassExtensionPtrTy = llvm::PointerType::getUnqual(ClassExtensionTy);
@ -4317,8 +4302,7 @@ ObjCTypesHelper::ObjCTypesHelper(CodeGen::CodeGenModule &cgm)
// char *ivar_layout;
// struct _objc_class_ext *ext;
// };
T = llvm::StructType::get(VMContext,
llvm::PointerType::getUnqual(ClassTyHolder),
T = llvm::StructType::get(llvm::PointerType::getUnqual(ClassTyHolder),
llvm::PointerType::getUnqual(ClassTyHolder),
Int8PtrTy,
LongTy,
@ -4345,14 +4329,9 @@ ObjCTypesHelper::ObjCTypesHelper(CodeGen::CodeGenModule &cgm)
// uint32_t size; // sizeof(struct _objc_category)
// struct _objc_property_list *instance_properties;// category's @property
// }
CategoryTy = llvm::StructType::get(VMContext, Int8PtrTy,
Int8PtrTy,
MethodListPtrTy,
MethodListPtrTy,
ProtocolListPtrTy,
IntTy,
PropertyListPtrTy,
NULL);
CategoryTy = llvm::StructType::get(Int8PtrTy, Int8PtrTy, MethodListPtrTy,
MethodListPtrTy, ProtocolListPtrTy,
IntTy, PropertyListPtrTy, NULL);
CGM.getModule().addTypeName("struct._objc_category", CategoryTy);
// Global metadata structures
@ -4364,12 +4343,8 @@ ObjCTypesHelper::ObjCTypesHelper(CodeGen::CodeGenModule &cgm)
// short cat_def_cnt;
// char *defs[cls_def_cnt + cat_def_cnt];
// }
SymtabTy = llvm::StructType::get(VMContext, LongTy,
SelectorPtrTy,
ShortTy,
ShortTy,
llvm::ArrayType::get(Int8PtrTy, 0),
NULL);
SymtabTy = llvm::StructType::get(LongTy, SelectorPtrTy, ShortTy, ShortTy,
llvm::ArrayType::get(Int8PtrTy, 0), NULL);
CGM.getModule().addTypeName("struct._objc_symtab", SymtabTy);
SymtabPtrTy = llvm::PointerType::getUnqual(SymtabTy);
@ -4380,11 +4355,7 @@ ObjCTypesHelper::ObjCTypesHelper(CodeGen::CodeGenModule &cgm)
// struct _objc_symtab* symtab;
// }
ModuleTy =
llvm::StructType::get(VMContext, LongTy,
LongTy,
Int8PtrTy,
SymtabPtrTy,
NULL);
llvm::StructType::get(LongTy, LongTy, Int8PtrTy, SymtabPtrTy, NULL);
CGM.getModule().addTypeName("struct._objc_module", ModuleTy);
@ -4397,7 +4368,7 @@ ObjCTypesHelper::ObjCTypesHelper(CodeGen::CodeGenModule &cgm)
llvm::Type::getInt8PtrTy(VMContext), 4);
ExceptionDataTy =
llvm::StructType::get(VMContext,
llvm::StructType::get(
llvm::ArrayType::get(llvm::Type::getInt32Ty(VMContext),
SetJmpBufferSize),
StackPtrTy, NULL);
@ -4413,8 +4384,7 @@ ObjCNonFragileABITypesHelper::ObjCNonFragileABITypesHelper(CodeGen::CodeGenModul
// uint32_t method_count;
// struct _objc_method method_list[method_count];
// }
MethodListnfABITy = llvm::StructType::get(VMContext, IntTy,
IntTy,
MethodListnfABITy = llvm::StructType::get(IntTy, IntTy,
llvm::ArrayType::get(MethodTy, 0),
NULL);
CGM.getModule().addTypeName("struct.__method_list_t",
@ -4438,10 +4408,8 @@ ObjCNonFragileABITypesHelper::ObjCNonFragileABITypesHelper(CodeGen::CodeGenModul
// Holder for struct _protocol_list_t *
llvm::PATypeHolder ProtocolListTyHolder = llvm::OpaqueType::get(VMContext);
ProtocolnfABITy = llvm::StructType::get(VMContext, ObjectPtrTy,
Int8PtrTy,
llvm::PointerType::getUnqual(
ProtocolListTyHolder),
ProtocolnfABITy = llvm::StructType::get(ObjectPtrTy, Int8PtrTy,
ProtocolListTyHolder->getPointerTo(),
MethodListnfABIPtrTy,
MethodListnfABIPtrTy,
MethodListnfABIPtrTy,
@ -4460,7 +4428,7 @@ ObjCNonFragileABITypesHelper::ObjCNonFragileABITypesHelper(CodeGen::CodeGenModul
// long protocol_count; // Note, this is 32/64 bit
// struct _protocol_t *[protocol_count];
// }
ProtocolListnfABITy = llvm::StructType::get(VMContext, LongTy,
ProtocolListnfABITy = llvm::StructType::get(LongTy,
llvm::ArrayType::get(
ProtocolnfABIPtrTy, 0),
NULL);
@ -4479,8 +4447,7 @@ ObjCNonFragileABITypesHelper::ObjCNonFragileABITypesHelper(CodeGen::CodeGenModul
// uint32_t alignment;
// uint32_t size;
// }
IvarnfABITy = llvm::StructType::get(VMContext,
llvm::PointerType::getUnqual(LongTy),
IvarnfABITy = llvm::StructType::get(llvm::PointerType::getUnqual(LongTy),
Int8PtrTy,
Int8PtrTy,
IntTy,
@ -4493,8 +4460,7 @@ ObjCNonFragileABITypesHelper::ObjCNonFragileABITypesHelper(CodeGen::CodeGenModul
// uint32 count;
// struct _iver_t list[count];
// }
IvarListnfABITy = llvm::StructType::get(VMContext, IntTy,
IntTy,
IvarListnfABITy = llvm::StructType::get(IntTy, IntTy,
llvm::ArrayType::get(
IvarnfABITy, 0),
NULL);
@ -4517,7 +4483,7 @@ ObjCNonFragileABITypesHelper::ObjCNonFragileABITypesHelper(CodeGen::CodeGenModul
// }
// FIXME. Add 'reserved' field in 64bit abi mode!
ClassRonfABITy = llvm::StructType::get(VMContext, IntTy,
ClassRonfABITy = llvm::StructType::get(IntTy,
IntTy,
IntTy,
Int8PtrTy,
@ -4546,8 +4512,7 @@ ObjCNonFragileABITypesHelper::ObjCNonFragileABITypesHelper(CodeGen::CodeGenModul
llvm::PATypeHolder ClassTyHolder = llvm::OpaqueType::get(VMContext);
ClassnfABITy =
llvm::StructType::get(VMContext,
llvm::PointerType::getUnqual(ClassTyHolder),
llvm::StructType::get(llvm::PointerType::getUnqual(ClassTyHolder),
llvm::PointerType::getUnqual(ClassTyHolder),
CachePtrTy,
llvm::PointerType::getUnqual(ImpnfABITy),
@ -4569,7 +4534,7 @@ ObjCNonFragileABITypesHelper::ObjCNonFragileABITypesHelper(CodeGen::CodeGenModul
// const struct _protocol_list_t * const protocols;
// const struct _prop_list_t * const properties;
// }
CategorynfABITy = llvm::StructType::get(VMContext, Int8PtrTy,
CategorynfABITy = llvm::StructType::get(Int8PtrTy,
ClassnfABIPtrTy,
MethodListnfABIPtrTy,
MethodListnfABIPtrTy,
@ -4611,9 +4576,7 @@ ObjCNonFragileABITypesHelper::ObjCNonFragileABITypesHelper(CodeGen::CodeGenModul
// SUPER_IMP messenger;
// SEL name;
// };
SuperMessageRefTy = llvm::StructType::get(VMContext, ImpnfABITy,
SelectorPtrTy,
NULL);
SuperMessageRefTy = llvm::StructType::get(ImpnfABITy, SelectorPtrTy, NULL);
CGM.getModule().addTypeName("struct._super_message_ref_t", SuperMessageRefTy);
// SuperMessageRefPtrTy - LLVM for struct _super_message_ref_t*
@ -4625,8 +4588,7 @@ ObjCNonFragileABITypesHelper::ObjCNonFragileABITypesHelper(CodeGen::CodeGenModul
// const char* name; // c++ typeinfo string
// Class cls;
// };
EHTypeTy = llvm::StructType::get(VMContext,
llvm::PointerType::getUnqual(Int8PtrTy),
EHTypeTy = llvm::StructType::get(llvm::PointerType::getUnqual(Int8PtrTy),
Int8PtrTy,
ClassnfABIPtrTy,
NULL);

View File

@ -354,7 +354,7 @@ void CodeGenModule::EmitCtorList(const CtorList &Fns, const char *GlobalName) {
// Get the type of a ctor entry, { i32, void ()* }.
llvm::StructType* CtorStructTy =
llvm::StructType::get(VMContext, llvm::Type::getInt32Ty(VMContext),
llvm::StructType::get(llvm::Type::getInt32Ty(VMContext),
llvm::PointerType::getUnqual(CtorFTy), NULL);
// Construct the constructor and destructor arrays.

View File

@ -294,7 +294,7 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) {
case Type::Complex: {
const llvm::Type *EltTy =
ConvertTypeRecursive(cast<ComplexType>(Ty).getElementType());
return llvm::StructType::get(TheModule.getContext(), EltTy, EltTy, NULL);
return llvm::StructType::get(EltTy, EltTy, NULL);
}
case Type::LValueReference:
case Type::RValueReference: {

View File

@ -180,9 +180,7 @@ const llvm::Type *
ItaniumCXXABI::ConvertMemberPointerType(const MemberPointerType *MPT) {
if (MPT->isMemberDataPointer())
return getPtrDiffTy();
else
return llvm::StructType::get(CGM.getLLVMContext(),
getPtrDiffTy(), getPtrDiffTy(), NULL);
return llvm::StructType::get(getPtrDiffTy(), getPtrDiffTy(), NULL);
}
/// In the Itanium and ARM ABIs, method pointers have the form:

View File

@ -1594,8 +1594,7 @@ GetX86_64ByValArgumentPair(const llvm::Type *Lo, const llvm::Type *Hi,
}
}
const llvm::StructType *Result =
llvm::StructType::get(Lo->getContext(), Lo, Hi, NULL);
const llvm::StructType *Result = llvm::StructType::get(Lo, Hi, NULL);
// Verify that the second element is at an 8-byte offset.
@ -1671,8 +1670,7 @@ classifyReturnType(QualType RetTy) const {
// %st1.
case ComplexX87:
assert(Hi == ComplexX87 && "Unexpected ComplexX87 classification.");
ResType = llvm::StructType::get(getVMContext(),
llvm::Type::getX86_FP80Ty(getVMContext()),
ResType = llvm::StructType::get(llvm::Type::getX86_FP80Ty(getVMContext()),
llvm::Type::getX86_FP80Ty(getVMContext()),
NULL);
break;
@ -2062,7 +2060,7 @@ llvm::Value *X86_64ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
const llvm::Type *DoubleTy = llvm::Type::getDoubleTy(VMContext);
const llvm::Type *DblPtrTy =
llvm::PointerType::getUnqual(DoubleTy);
const llvm::StructType *ST = llvm::StructType::get(VMContext, DoubleTy,
const llvm::StructType *ST = llvm::StructType::get(DoubleTy,
DoubleTy, NULL);
llvm::Value *V, *Tmp = CGF.CreateTempAlloca(ST);
V = CGF.Builder.CreateLoad(CGF.Builder.CreateBitCast(RegAddrLo,
@ -2374,8 +2372,7 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty) const {
}
const llvm::Type *STy =
llvm::StructType::get(getVMContext(),
llvm::ArrayType::get(ElemTy, SizeRegs), NULL, NULL);
llvm::StructType::get(llvm::ArrayType::get(ElemTy, SizeRegs), NULL);
return ABIArgInfo::getDirect(STy);
}