Allow an opaque struct type to be specified as the struct

to perform struct-layout into.

Swift SVN r1823
This commit is contained in:
John McCall
2012-05-12 07:19:43 +00:00
parent d98c55f665
commit 48cd78cfef
4 changed files with 36 additions and 10 deletions

View File

@@ -76,12 +76,20 @@ IRGenModule::IRGenModule(ASTContext &Context,
llvm::Type *funcElts[] = { Int8PtrTy, RefCountedPtrTy };
FunctionPairTy = llvm::StructType::get(LLVMContext, funcElts,
/*packed*/ false);
OpaqueStructTy = nullptr;
}
IRGenModule::~IRGenModule() {
delete &Types;
}
llvm::StructType *IRGenModule::getOpaqueStructTy() {
if (OpaqueStructTy) return OpaqueStructTy;
OpaqueStructTy = llvm::StructType::create(LLVMContext);
return OpaqueStructTy;
}
llvm::Constant *IRGenModule::getAllocFn() {
if (AllocFn) return AllocFn;