Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78957 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index 0a75057..fc11cc8 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/lib/CodeGen/CGObjCGNU.cpp
@@ -529,7 +529,7 @@
// Structure containing list pointer, array and array count
llvm::SmallVector<const llvm::Type*, 16> ObjCMethodListFields;
- llvm::PATypeHolder OpaqueNextTy = llvm::OpaqueType::get();
+ llvm::PATypeHolder OpaqueNextTy = llvm::OpaqueType::get(VMContext);
llvm::Type *NextPtrTy = llvm::PointerType::getUnqual(OpaqueNextTy);
llvm::StructType *ObjCMethodListTy = llvm::StructType::get(VMContext,
NextPtrTy,
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index f41b3b6..3665037 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -3600,7 +3600,7 @@
CGM.getModule().addTypeName("struct._objc_method", MethodTy);
// struct _objc_cache *
- CacheTy = llvm::OpaqueType::get();
+ CacheTy = llvm::OpaqueType::get(VMContext);
CGM.getModule().addTypeName("struct._objc_cache", CacheTy);
CachePtrTy = llvm::PointerType::getUnqual(CacheTy);
}
@@ -3656,8 +3656,8 @@
// Handle recursive construction of Protocol and ProtocolList types
- llvm::PATypeHolder ProtocolTyHolder = llvm::OpaqueType::get();
- llvm::PATypeHolder ProtocolListTyHolder = llvm::OpaqueType::get();
+ llvm::PATypeHolder ProtocolTyHolder = llvm::OpaqueType::get(VMContext);
+ llvm::PATypeHolder ProtocolListTyHolder = llvm::OpaqueType::get(VMContext);
const llvm::Type *T =
llvm::StructType::get(VMContext,
@@ -3706,12 +3706,12 @@
CGM.getModule().addTypeName("struct._objc_ivar", IvarTy);
// struct _objc_ivar_list *
- IvarListTy = llvm::OpaqueType::get();
+ IvarListTy = llvm::OpaqueType::get(VMContext);
CGM.getModule().addTypeName("struct._objc_ivar_list", IvarListTy);
IvarListPtrTy = llvm::PointerType::getUnqual(IvarListTy);
// struct _objc_method_list *
- MethodListTy = llvm::OpaqueType::get();
+ MethodListTy = llvm::OpaqueType::get(VMContext);
CGM.getModule().addTypeName("struct._objc_method_list", MethodListTy);
MethodListPtrTy = llvm::PointerType::getUnqual(MethodListTy);
@@ -3724,7 +3724,7 @@
CGM.getModule().addTypeName("struct._objc_class_extension", ClassExtensionTy);
ClassExtensionPtrTy = llvm::PointerType::getUnqual(ClassExtensionTy);
- llvm::PATypeHolder ClassTyHolder = llvm::OpaqueType::get();
+ llvm::PATypeHolder ClassTyHolder = llvm::OpaqueType::get(VMContext);
// struct _objc_class {
// Class isa;
@@ -3859,7 +3859,7 @@
// }
// Holder for struct _protocol_list_t *
- llvm::PATypeHolder ProtocolListTyHolder = llvm::OpaqueType::get();
+ llvm::PATypeHolder ProtocolListTyHolder = llvm::OpaqueType::get(VMContext);
ProtocolnfABITy = llvm::StructType::get(VMContext, ObjectPtrTy,
Int8PtrTy,
@@ -3969,7 +3969,7 @@
// struct class_ro_t *ro;
// }
- llvm::PATypeHolder ClassTyHolder = llvm::OpaqueType::get();
+ llvm::PATypeHolder ClassTyHolder = llvm::OpaqueType::get(VMContext);
ClassnfABITy =
llvm::StructType::get(VMContext,
llvm::PointerType::getUnqual(ClassTyHolder),
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp
index 5e2ba5a..52499d9 100644
--- a/lib/CodeGen/CodeGenTypes.cpp
+++ b/lib/CodeGen/CodeGenTypes.cpp
@@ -247,14 +247,14 @@
case Type::RValueReference: {
const ReferenceType &RTy = cast<ReferenceType>(Ty);
QualType ETy = RTy.getPointeeType();
- llvm::OpaqueType *PointeeType = llvm::OpaqueType::get();
+ llvm::OpaqueType *PointeeType = llvm::OpaqueType::get(getLLVMContext());
PointersToResolve.push_back(std::make_pair(ETy, PointeeType));
return llvm::PointerType::get(PointeeType, ETy.getAddressSpace());
}
case Type::Pointer: {
const PointerType &PTy = cast<PointerType>(Ty);
QualType ETy = PTy.getPointeeType();
- llvm::OpaqueType *PointeeType = llvm::OpaqueType::get();
+ llvm::OpaqueType *PointeeType = llvm::OpaqueType::get(getLLVMContext());
PointersToResolve.push_back(std::make_pair(ETy, PointeeType));
return llvm::PointerType::get(PointeeType, ETy.getAddressSpace());
}
@@ -293,7 +293,7 @@
// we have an opaque type corresponding to the tag type.
ConvertTagDeclType(TT->getDecl());
// Create an opaque type for this function type, save it, and return it.
- llvm::Type *ResultType = llvm::OpaqueType::get();
+ llvm::Type *ResultType = llvm::OpaqueType::get(getLLVMContext());
FunctionTypes.insert(std::make_pair(&Ty, ResultType));
return ResultType;
}
@@ -316,7 +316,7 @@
// these.
const llvm::Type *&T = InterfaceTypes[cast<ObjCInterfaceType>(&Ty)];
if (!T)
- T = llvm::OpaqueType::get();
+ T = llvm::OpaqueType::get(getLLVMContext());
return T;
}
@@ -352,7 +352,7 @@
case Type::BlockPointer: {
const QualType FTy = cast<BlockPointerType>(Ty).getPointeeType();
- llvm::OpaqueType *PointeeType = llvm::OpaqueType::get();
+ llvm::OpaqueType *PointeeType = llvm::OpaqueType::get(getLLVMContext());
PointersToResolve.push_back(std::make_pair(FTy, PointeeType));
return llvm::PointerType::get(PointeeType, FTy.getAddressSpace());
}
@@ -377,7 +377,7 @@
}
// FIXME: implement.
- return llvm::OpaqueType::get();
+ return llvm::OpaqueType::get(getLLVMContext());
}
/// ConvertTagDeclType - Lay out a tagged decl type like struct or union or
@@ -410,7 +410,7 @@
// If this is still a forward definition, just define an opaque type to use
// for this tagged decl.
if (!TD->isDefinition()) {
- llvm::Type *ResultType = llvm::OpaqueType::get();
+ llvm::Type *ResultType = llvm::OpaqueType::get(getLLVMContext());
TagDeclTypes.insert(std::make_pair(Key, ResultType));
return ResultType;
}
@@ -428,7 +428,7 @@
// Create new OpaqueType now for later use in case this is a recursive
// type. This will later be refined to the actual type.
- llvm::PATypeHolder ResultHolder = llvm::OpaqueType::get();
+ llvm::PATypeHolder ResultHolder = llvm::OpaqueType::get(getLLVMContext());
TagDeclTypes.insert(std::make_pair(Key, ResultHolder));
const llvm::Type *ResultType;