Reapply:
r107173, "fix PR7519: after thrashing around and remembering how all this stuff" r107216, "fix PR7523, which was caused by the ABI code calling ConvertType instead" This includes a fix to make ConvertTypeForMem handle the "recursive" case, and call it as such when lowering function types which have an indirect result. llvm-svn: 107310
This commit is contained in:
@@ -872,6 +872,7 @@ CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef MangledName,
|
||||
std::vector<const llvm::Type*>(), false);
|
||||
IsIncompleteFunction = true;
|
||||
}
|
||||
|
||||
llvm::Function *F = llvm::Function::Create(FTy,
|
||||
llvm::Function::ExternalLinkage,
|
||||
MangledName, &getModule());
|
||||
@@ -932,6 +933,7 @@ llvm::Constant *CodeGenModule::GetAddrOfFunction(GlobalDecl GD,
|
||||
// If there was no specific requested type, just convert it now.
|
||||
if (!Ty)
|
||||
Ty = getTypes().ConvertType(cast<ValueDecl>(GD.getDecl())->getType());
|
||||
|
||||
llvm::StringRef MangledName = getMangledName(GD);
|
||||
return GetOrCreateLLVMFunction(MangledName, Ty, GD);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user