summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2015-08-06 22:11:54 +0000
committerEric Christopher <echristo@gmail.com>2015-08-06 22:11:54 +0000
commitb6dfd9490bf0a346248d921b110688b5a951cb5b (patch)
treeee7ccc71677b3eb688cabe3f5fefa3ad5d73a452
parent82f8fcda9ffd38fd64201a40be916ba9907515f5 (diff)
downloadbcm5719-llvm-b6dfd9490bf0a346248d921b110688b5a951cb5b.tar.gz
bcm5719-llvm-b6dfd9490bf0a346248d921b110688b5a951cb5b.zip
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. llvm-svn: 244286
-rw-r--r--clang/include/clang/Basic/Builtins.h5
-rw-r--r--clang/lib/Basic/Targets.cpp6
2 files changed, 9 insertions, 2 deletions
diff --git a/clang/include/clang/Basic/Builtins.h b/clang/include/clang/Basic/Builtins.h
index c5cf10ccf0f..554143d6be7 100644
--- a/clang/include/clang/Basic/Builtins.h
+++ b/clang/include/clang/Basic/Builtins.h
@@ -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;
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index d85e28b753e..993f48ded38 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -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"
};
OpenPOWER on IntegriCloud