Implement grabbing an external value witness table. I

described this mangling in a previous commit, and the runtime
is already using it for some standard tables.

Swift SVN r2870
This commit is contained in:
John McCall
2012-09-19 06:33:36 +00:00
parent 73540dcd6d
commit 34da6d1650
5 changed files with 58 additions and 13 deletions

View File

@@ -75,7 +75,11 @@ IRGenModule::IRGenModule(ASTContext &Context,
DtorTy = llvm::FunctionType::get(SizeTy, RefCountedPtrTy, false);
llvm::Type *dtorPtrTy = DtorTy->getPointerTo();
llvm::Type *heapMetadataElts[] = { dtorPtrTy, dtorPtrTy };
// Note that heap metadata share a common prefix with type metadata.
llvm::Type *heapMetadataElts[] = {
Int8Ty, WitnessTablePtrTy, dtorPtrTy, dtorPtrTy
};
HeapMetadataStructTy =
llvm::StructType::create(getLLVMContext(), heapMetadataElts,
"swift.heapmetadata");