diff options
author | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
commit | 39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df (patch) | |
tree | a9243275843fbeaa590afc07ee888e006b8d54ea /include/clang/Basic/Builtins.h | |
parent | 69b4eca4a4255ba43baa5c1d9bbdec3ec17f479e (diff) | |
download | FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.zip FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.tar.gz |
Vendor import of clang trunk r126079:
http://llvm.org/svn/llvm-project/cfe/trunk@126079
Diffstat (limited to 'include/clang/Basic/Builtins.h')
-rw-r--r-- | include/clang/Basic/Builtins.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/include/clang/Basic/Builtins.h b/include/clang/Basic/Builtins.h index 94d5e69..4df4c8f 100644 --- a/include/clang/Basic/Builtins.h +++ b/include/clang/Basic/Builtins.h @@ -30,7 +30,15 @@ namespace clang { class IdentifierTable; class ASTContext; class QualType; - + class LangOptions; + + enum LanguageID { + C_LANG = 0x1, // builtin for c only. + CXX_LANG = 0x2, // builtin for cplusplus only. + OBJC_LANG = 0x4, // builtin for objective-c and objective-c++ + ALL_LANGUAGES = (C_LANG|CXX_LANG|OBJC_LANG) //builtin is for all languages. + }; + namespace Builtin { enum ID { NotBuiltin = 0, // This is not a builtin function. @@ -41,6 +49,7 @@ enum ID { struct Info { const char *Name, *Type, *Attributes, *HeaderName; + LanguageID builtin_lang; bool Suppressed; bool operator==(const Info &RHS) const { @@ -62,7 +71,7 @@ public: /// InitializeBuiltins - Mark the identifiers for all the builtins with their /// appropriate builtin ID # and mark any non-portable builtin identifiers as /// such. - void InitializeBuiltins(IdentifierTable &Table, bool NoBuiltins = false); + void InitializeBuiltins(IdentifierTable &Table, const LangOptions& LangOpts); /// \brief Popular the vector with the names of all of the builtins. void GetBuiltinNames(llvm::SmallVectorImpl<const char *> &Names, @@ -108,6 +117,10 @@ public: return strchr(GetRecord(ID).Attributes, 'f') != 0; } + /// \brief Completely forget that the given ID was ever considered a builtin, + /// e.g., because the user provided a conflicting signature. + void ForgetBuiltin(unsigned ID, IdentifierTable &Table); + /// \brief If this is a library function that comes from a specific /// header, retrieve that header name. const char *getHeaderName(unsigned ID) const { @@ -124,12 +137,6 @@ public: /// argument and whether this function as a va_list argument. bool isScanfLike(unsigned ID, unsigned &FormatIdx, bool &HasVAListArg); - /// hasVAListUse - Return true of the specified builtin uses __builtin_va_list - /// as an operand or return type. - bool hasVAListUse(unsigned ID) const { - return strpbrk(GetRecord(ID).Type, "Aa") != 0; - } - /// isConstWithoutErrno - Return true if this function has no side /// effects and doesn't read memory, except for possibly errno. Such /// functions can be const when the MathErrno lang option is |