Supply the header corresponding to a library builtin as a separate argument to the LIBBUILTIN macro
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64676 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Builtins.cpp b/lib/AST/Builtins.cpp
index 4a8a338..e4a79e4 100644
--- a/lib/AST/Builtins.cpp
+++ b/lib/AST/Builtins.cpp
@@ -19,8 +19,9 @@
using namespace clang;
static const Builtin::Info BuiltinInfo[] = {
- { "not a builtin function", 0, 0, false },
-#define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, false },
+ { "not a builtin function", 0, 0, 0, false },
+#define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, 0, false },
+#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) { #ID, TYPE, ATTRS, HEADER, false },
#include "clang/AST/Builtins.def"
};
@@ -57,21 +58,6 @@
Table.get(TSRecords[i].Name).setBuiltinID(i+Builtin::FirstTSBuiltin);
}
-std::string Builtin::Context::getHeaderName(unsigned ID) const {
- const char *Name = strchr(GetRecord(ID).Attributes, 'f');
- if (!Name)
- return 0;
- ++Name;
-
- if (*Name != ':')
- return 0;
-
- ++Name;
- const char *NameEnd = strchr(Name, ':');
- assert(NameEnd && "Missing ':' after header name");
- return std::string(Name, NameEnd);
-}
-
bool
Builtin::Context::isPrintfLike(unsigned ID, unsigned &FormatIdx,
bool &HasVAListArg) {