summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2016-08-30 14:17:10 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2016-08-30 14:17:10 +0000
commit7cd30bd7e6534ce60438ad6755a8e98b15eb9c8d (patch)
treeb615e9dcfc1ec367ea83c1337c624fbfcf2de865 /clang/lib/Basic
parentd8858cafa94410b8d0b4f600466815f86dd6d931 (diff)
downloadbcm5719-llvm-7cd30bd7e6534ce60438ad6755a8e98b15eb9c8d.tar.gz
bcm5719-llvm-7cd30bd7e6534ce60438ad6755a8e98b15eb9c8d.zip
[Hexagon] Use handleTargetFeaturesGroup to process target-specific features
llvm-svn: 280093
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/Targets.cpp35
1 files changed, 26 insertions, 9 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 9ae22ffeed6..8da7d02bb04 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -6180,6 +6180,9 @@ public:
bool handleTargetFeatures(std::vector<std::string> &Features,
DiagnosticsEngine &Diags) override;
+ void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
+ bool Enabled) const override;
+
BuiltinVaListKind getBuiltinVaListKind() const override {
return TargetInfo::CharPtrBuiltinVaList;
}
@@ -6248,6 +6251,17 @@ void HexagonTargetInfo::getTargetDefines(const LangOptions &Opts,
}
}
+bool HexagonTargetInfo::initFeatureMap(llvm::StringMap<bool> &Features,
+ DiagnosticsEngine &Diags, StringRef CPU,
+ const std::vector<std::string> &FeaturesVec) const {
+ // Default for v60: -hvx, -hvx-double.
+ Features["hvx"] = false;
+ Features["hvx-double"] = false;
+ Features["long-calls"] = false;
+
+ return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec);
+}
+
bool HexagonTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
DiagnosticsEngine &Diags) {
for (auto &F : Features) {
@@ -6262,19 +6276,22 @@ bool HexagonTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
if (F == "+long-calls")
UseLongCalls = true;
+ else if (F == "-long-calls")
+ UseLongCalls = false;
}
return true;
}
-bool HexagonTargetInfo::initFeatureMap(llvm::StringMap<bool> &Features,
- DiagnosticsEngine &Diags, StringRef CPU,
- const std::vector<std::string> &FeaturesVec) const {
- // Default for v60: -hvx, -hvx-double.
- Features["hvx"] = false;
- Features["hvx-double"] = false;
- Features["long-calls"] = false;
-
- return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec);
+void HexagonTargetInfo::setFeatureEnabled(llvm::StringMap<bool> &Features,
+ StringRef Name, bool Enabled) const {
+ if (Enabled) {
+ if (Name == "hvx-double")
+ Features["hvx"] = true;
+ } else {
+ if (Name == "hvx")
+ Features["hvx-double"] = false;
+ }
+ Features[Name] = Enabled;
}
const char *const HexagonTargetInfo::GCCRegNames[] = {
OpenPOWER on IntegriCloud