IRGen: Fix type of initing ctor, destroying dtor

IRGen was generating the exact same signature for the initializing/allocating constructors and destroying/deallocating destructors. Make it do the right thing by typing the initializing constructor as Swift T -> (...) -> T and the destroying destructor as LLVM void(%swift.refcounted*). (This will later change to '%swift.refcounted*(%swift.refcounted*)' pending some irgen/runtime cleanup.)

Swift SVN r3837
This commit is contained in:
Joe Groff
2013-01-22 23:36:35 +00:00
parent 9e971afadd
commit 5be34d6337
4 changed files with 43 additions and 10 deletions

View File

@@ -102,8 +102,9 @@ IRGenModule::IRGenModule(ASTContext &Context,
TypeMetadataPatternPtrTy =
TypeMetadataPatternStructTy->getPointerTo(defaultAS);
DtorTy = llvm::FunctionType::get(SizeTy, RefCountedPtrTy, false);
llvm::Type *dtorPtrTy = DtorTy->getPointerTo();
DeallocatingDtorTy = llvm::FunctionType::get(SizeTy, RefCountedPtrTy, false);
DestroyingDtorTy = llvm::FunctionType::get(VoidTy, RefCountedPtrTy, false);
llvm::Type *dtorPtrTy = DeallocatingDtorTy->getPointerTo();
// A full heap metadata is basically just an additional small prefix
// on a full metadata, used for metadata corresponding to heap