summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-14 01:52:53 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-14 01:52:53 +0000
commit538c3d845986a43014574d6a21a030281c266fdb (patch)
treee304449e0a82e5dedd173f7d0bec8e9c618a6625 /clang/lib/CodeGen/CodeGenModule.cpp
parente68c0fcfb239eef2c8468bb8c32e97fe9f58e7be (diff)
downloadbcm5719-llvm-538c3d845986a43014574d6a21a030281c266fdb.tar.gz
bcm5719-llvm-538c3d845986a43014574d6a21a030281c266fdb.zip
Make it possible for builtins to expression FILE* arguments, so that
we can define builtins such as fprintf, vfprintf, and __builtin___fprintf_chk. Give a nice error message when we need to implicitly declare a function like fprintf. llvm-svn: 64526
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 03de730f655..ba77e44288c 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -852,7 +852,10 @@ llvm::Function *CodeGenModule::getBuiltinLibFunction(unsigned BuiltinID) {
Name += 10;
// Get the type for the builtin.
- QualType Type = Context.BuiltinInfo.GetBuiltinType(BuiltinID, Context);
+ Builtin::Context::GetBuiltinTypeError Error;
+ QualType Type = Context.BuiltinInfo.GetBuiltinType(BuiltinID, Context, Error);
+ assert(Error == Builtin::Context::GE_None && "Can't get builtin type");
+
const llvm::FunctionType *Ty =
cast<llvm::FunctionType>(getTypes().ConvertType(Type));
OpenPOWER on IntegriCloud