From 386ca78d0b03b1fb519e60d1a14cd12a220364a6 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 9 Dec 2009 03:05:59 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90936 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index a063e21307..e98939cc8f 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -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(getTypes().ConvertType(Type)); + cast(getTypes().ConvertType(FD->getType())); // Unique the name through the identifier table. Name = getContext().Idents.get(Name).getNameStart(); -- cgit v1.2.3-18-g5258