]> granicus.if.org Git - clang/commitdiff
Continue the work from r243908 by adding a Features field to Builtin::Info
authorEric Christopher <echristo@gmail.com>
Thu, 6 Aug 2015 22:11:54 +0000 (22:11 +0000)
committerEric Christopher <echristo@gmail.com>
Thu, 6 Aug 2015 22:11:54 +0000 (22:11 +0000)
so that we can populate it on a per-target basis with required features.

Future commits will start using this information for warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244286 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/Builtins.h
lib/Basic/Targets.cpp

index c5cf10ccf0f3cb93a8b9304902aa6967d04c63ad..554143d6be7d7d0f728e759d34ec935a1920967f 100644 (file)
@@ -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;
 
index d85e28b753ea44eec6d26e0887d90e50281abbb0..993f48ded3831711031e422b6381f2af5c16c556 100644 (file)
@@ -2001,8 +2001,10 @@ void AMDGPUTargetInfo::getGCCRegNames(const char * const *&Names,
 // 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"
 };