r244126 - Rename builtin_lang -> Langs to match the rest of the code a bit better.

Eric Christopher echristo at gmail.com
Wed Aug 5 14:04:28 PDT 2015


Author: echristo
Date: Wed Aug  5 16:04:28 2015
New Revision: 244126

URL: http://llvm.org/viewvc/llvm-project?rev=244126&view=rev
Log:
Rename builtin_lang -> Langs to match the rest of the code a bit better.

Modified:
    cfe/trunk/include/clang/Basic/Builtins.h
    cfe/trunk/lib/Basic/Builtins.cpp

Modified: cfe/trunk/include/clang/Basic/Builtins.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.h?rev=244126&r1=244125&r2=244126&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Builtins.h (original)
+++ cfe/trunk/include/clang/Basic/Builtins.h Wed Aug  5 16:04:28 2015
@@ -51,7 +51,7 @@ enum ID {
 
 struct Info {
   const char *Name, *Type, *Attributes, *HeaderName;
-  LanguageID builtin_lang;
+  LanguageID Langs;
 };
 
 /// \brief Holds information about both target-independent and

Modified: cfe/trunk/lib/Basic/Builtins.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Builtins.cpp?rev=244126&r1=244125&r2=244126&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Builtins.cpp (original)
+++ cfe/trunk/lib/Basic/Builtins.cpp Wed Aug  5 16:04:28 2015
@@ -22,9 +22,12 @@ using namespace clang;
 static const Builtin::Info BuiltinInfo[] = {
   { "not a builtin function", nullptr, nullptr, nullptr, ALL_LANGUAGES},
 #define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES },
-#define LANGBUILTIN(ID, TYPE, ATTRS, BUILTIN_LANG) { #ID, TYPE, ATTRS, 0, BUILTIN_LANG },
-#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER, BUILTIN_LANG) { #ID, TYPE, ATTRS, HEADER,\
-                                                            BUILTIN_LANG },
+#define LANGBUILTIN(ID, TYPE, ATTRS, LANGS)                                    \
+  { #ID, TYPE, ATTRS, 0, LANGS }                                               \
+  ,
+#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER, LANGS)                             \
+  { #ID, TYPE, ATTRS, HEADER, LANGS }                                          \
+  ,
 #include "clang/Basic/Builtins.def"
 };
 
@@ -53,12 +56,10 @@ bool Builtin::Context::BuiltinIsSupporte
   bool MathBuiltinsUnsupported =
     LangOpts.NoMathBuiltin && BuiltinInfo.HeaderName &&      
     llvm::StringRef(BuiltinInfo.HeaderName).equals("math.h");
-  bool GnuModeUnsupported = !LangOpts.GNUMode &&
-                            (BuiltinInfo.builtin_lang & GNU_LANG);
-  bool MSModeUnsupported = !LangOpts.MicrosoftExt &&
-                           (BuiltinInfo.builtin_lang & MS_LANG);
-  bool ObjCUnsupported = !LangOpts.ObjC1 &&
-                         BuiltinInfo.builtin_lang == OBJC_LANG;
+  bool GnuModeUnsupported = !LangOpts.GNUMode && (BuiltinInfo.Langs & GNU_LANG);
+  bool MSModeUnsupported =
+      !LangOpts.MicrosoftExt && (BuiltinInfo.Langs & MS_LANG);
+  bool ObjCUnsupported = !LangOpts.ObjC1 && BuiltinInfo.Langs == OBJC_LANG;
   return !BuiltinsUnsupported && !MathBuiltinsUnsupported &&
          !GnuModeUnsupported && !MSModeUnsupported && !ObjCUnsupported;
 }




More information about the cfe-commits mailing list