aboutsummaryrefslogtreecommitdiff
path: root/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
commit386ca78d0b03b1fb519e60d1a14cd12a220364a6 (patch)
tree5aacb53c795e8f576a1499bae1900247f44bf691 /lib/CodeGen/CodeGenModule.cpp
parentb6cc91be4da4f55c7e3dca87ecfdb532b33c83ca (diff)
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
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp7
1 files changed, 1 insertions, 6 deletions
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<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();