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
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 03de730..ba77e44 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -852,7 +852,10 @@
     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));