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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user