Initial, untested support for uniquing generic class metadata,

which is necessary to embed the value witnesses there.

Swift SVN r2671
This commit is contained in:
John McCall
2012-08-17 06:47:33 +00:00
parent e74432a7b9
commit 20bfc9c1ec
7 changed files with 487 additions and 26 deletions

View File

@@ -195,6 +195,19 @@ llvm::Constant *IRGenModule::getDeallocObjectFn() {
return DeallocObjectFn;
}
llvm::Constant *IRGenModule::getGetGenericMetadataFn() {
if (GetGenericMetadataFn) return GetGenericMetadataFn;
// heap_metadata_t *swift_getGenericMetadata(heap_metadata_t *pattern,
// const void *arguments);
llvm::Type *argTypes[] = { HeapMetadataPtrTy, Int8PtrTy };
llvm::FunctionType *fnType =
llvm::FunctionType::get(HeapMetadataPtrTy, argTypes, false);
GetGenericMetadataFn =
createRuntimeFunction(*this, "swift_getGenericMetadata", fnType);
return GetGenericMetadataFn;
}
void IRGenModule::unimplemented(SourceLoc loc, StringRef message) {
Context.Diags.diagnose(loc, diag::irgen_unimplemented, message);
}