Fix for PR5709: use the computed type of the declaration instead of the

type of the builtin when generating the function declaration for a builtin
library call.

llvm-svn: 90936
This commit is contained in:
Eli Friedman
2009-12-09 03:05:59 +00:00
parent efa4732747
commit 4f678f3de1
2 changed files with 9 additions and 6 deletions

View File

@@ -1253,13 +1253,8 @@ llvm::Value *CodeGenModule::getBuiltinLibFunction(const FunctionDecl *FD,
if (Context.BuiltinInfo.isLibFunction(BuiltinID))
Name += 10;
// Get the type for the builtin.
ASTContext::GetBuiltinTypeError Error;
QualType Type = Context.GetBuiltinType(BuiltinID, Error);
assert(Error == ASTContext::GE_None && "Can't get builtin type");
const llvm::FunctionType *Ty =
cast<llvm::FunctionType>(getTypes().ConvertType(Type));
cast<llvm::FunctionType>(getTypes().ConvertType(FD->getType()));
// Unique the name through the identifier table.
Name = getContext().Idents.get(Name).getNameStart();