summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-12-09 03:05:59 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-12-09 03:05:59 +0000
commit4f678f3de1f4cf0574000d2ada3813b62a08c6dd (patch)
treee5556c509145d029432ce092f6ac53fd36f50f3b /clang/lib/CodeGen/CodeGenModule.cpp
parentefa4732747146160a5b40041055060f46c9d7595 (diff)
downloadbcm5719-llvm-4f678f3de1f4cf0574000d2ada3813b62a08c6dd.tar.gz
bcm5719-llvm-4f678f3de1f4cf0574000d2ada3813b62a08c6dd.zip
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index a063e21307c..e98939cc8f4 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/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<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();
OpenPOWER on IntegriCloud