r244286 - Continue the work from r243908 by adding a Features field to Builtin::Info

Eric Christopher via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 6 15:11:54 PDT 2015


Author: echristo
Date: Thu Aug  6 17:11:54 2015
New Revision: 244286

URL: http://llvm.org/viewvc/llvm-project?rev=244286&view=rev
Log:
Continue the work from r243908 by adding a Features field to Builtin::Info
so that we can populate it on a per-target basis with required features.

Future commits will start using this information for warnings.

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

Modified: cfe/trunk/include/clang/Basic/Builtins.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.h?rev=244286&r1=244285&r2=244286&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Builtins.h (original)
+++ cfe/trunk/include/clang/Basic/Builtins.h Thu Aug  6 17:11:54 2015
@@ -51,6 +51,7 @@ enum ID {
 struct Info {
   const char *Name, *Type, *Attributes, *HeaderName;
   LanguageID Langs;
+  const char *Features;
 };
 
 /// \brief Holds information about both target-independent and
@@ -166,6 +167,10 @@ public:
     return strchr(getRecord(ID).Attributes, 'e') != nullptr;
   }
 
+  const char *getRequiredFeatures(unsigned ID) const {
+    return getRecord(ID).Features;
+  }
+
 private:
   const Info &getRecord(unsigned ID) const;
 

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=244286&r1=244285&r2=244286&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Thu Aug  6 17:11:54 2015
@@ -2001,8 +2001,10 @@ void AMDGPUTargetInfo::getGCCRegNames(co
 // Namespace for x86 abstract base class
 const Builtin::Info BuiltinInfo[] = {
 #define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES },
-#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) { #ID, TYPE, ATTRS, HEADER,\
-                                              ALL_LANGUAGES },
+#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER)                                    \
+  { #ID, TYPE, ATTRS, HEADER, ALL_LANGUAGES },
+#define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE)                               \
+  { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES, FEATURE },
 #include "clang/Basic/BuiltinsX86.def"
 };
 




More information about the cfe-commits mailing list