diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-02-14 01:52:53 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-02-14 01:52:53 +0000 |
commit | 370ab3f1373841d70582feac9e35c3c6b3489f63 (patch) | |
tree | 1371980207aa58ccfea3e8ee70c2fbeab5d49b39 /lib/CodeGen/CodeGenModule.cpp | |
parent | 41573ebf8fb971f40fa8a3e20648362c359b4916 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64526 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 03de730f65..ba77e44288 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/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)); |