diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-11-30 17:35:24 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-11-30 17:35:24 +0000 |
commit | 67aba816901503d9cf7ba699525fa62cc7f8e5e4 (patch) | |
tree | cdf41986024677632d6c4ca9e373b01d1d481b29 /include/clang/Basic/Builtins.h | |
parent | 7e4857931bfe27bb355275bc7ec1eaa44612dfff (diff) |
Such function decls,as objc's objc_msgSend, builtins in
a specific language. We are adding such language info. by
extensing Builtins.def and via a language flag added
to LIBBUILTIN/BUILTIN and check for that when deciding
a name is builtin or not. Implements //rdar://8689273.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120429 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Builtins.h')
-rw-r--r-- | include/clang/Basic/Builtins.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/clang/Basic/Builtins.h b/include/clang/Basic/Builtins.h index fa437ffd67..eb26042052 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, |