[PATCH] D38548: Hexagon] Move getHexagonTargetFeatures to Hexagon.cpp (NFC)
Sumanth Gundapaneni via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 4 09:47:18 PDT 2017
sgundapa created this revision.
https://reviews.llvm.org/D38548
Files:
lib/Driver/ToolChains/Clang.cpp
lib/Driver/ToolChains/Hexagon.cpp
lib/Driver/ToolChains/Hexagon.h
Index: lib/Driver/ToolChains/Hexagon.h
===================================================================
--- lib/Driver/ToolChains/Hexagon.h
+++ lib/Driver/ToolChains/Hexagon.h
@@ -50,6 +50,10 @@
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
+
+void getHexagonTargetFeatures(const llvm::opt::ArgList &Args,
+ std::vector<StringRef> &Features);
+
} // end namespace hexagon.
} // end namespace tools
Index: lib/Driver/ToolChains/Hexagon.cpp
===================================================================
--- lib/Driver/ToolChains/Hexagon.cpp
+++ lib/Driver/ToolChains/Hexagon.cpp
@@ -27,6 +27,22 @@
using namespace clang;
using namespace llvm::opt;
+// Hexagon target features.
+void hexagon::getHexagonTargetFeatures(const ArgList &Args,
+ std::vector<StringRef> &Features) {
+ handleTargetFeaturesGroup(Args, Features,
+ options::OPT_m_hexagon_Features_Group);
+
+ bool UseLongCalls = false;
+ if (Arg *A = Args.getLastArg(options::OPT_mlong_calls,
+ options::OPT_mno_long_calls)) {
+ if (A->getOption().matches(options::OPT_mlong_calls))
+ UseLongCalls = true;
+ }
+
+ Features.push_back(UseLongCalls ? "+long-calls" : "-long-calls");
+}
+
// Hexagon tools start.
void hexagon::Assembler::RenderExtraToolArgs(const JobAction &JA,
ArgStringList &CmdArgs) const {
Index: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp
+++ lib/Driver/ToolChains/Clang.cpp
@@ -273,21 +273,6 @@
OutStrings.push_back(Args.MakeArgString(Out));
}
-static void getHexagonTargetFeatures(const ArgList &Args,
- std::vector<StringRef> &Features) {
- handleTargetFeaturesGroup(Args, Features,
- options::OPT_m_hexagon_Features_Group);
-
- bool UseLongCalls = false;
- if (Arg *A = Args.getLastArg(options::OPT_mlong_calls,
- options::OPT_mno_long_calls)) {
- if (A->getOption().matches(options::OPT_mlong_calls))
- UseLongCalls = true;
- }
-
- Features.push_back(UseLongCalls ? "+long-calls" : "-long-calls");
-}
-
static void getWebAssemblyTargetFeatures(const ArgList &Args,
std::vector<StringRef> &Features) {
handleTargetFeaturesGroup(Args, Features, options::OPT_m_wasm_Features_Group);
@@ -349,7 +334,7 @@
x86::getX86TargetFeatures(D, Triple, Args, Features);
break;
case llvm::Triple::hexagon:
- getHexagonTargetFeatures(Args, Features);
+ hexagon::getHexagonTargetFeatures(Args, Features);
break;
case llvm::Triple::wasm32:
case llvm::Triple::wasm64:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38548.117686.patch
Type: text/x-patch
Size: 2885 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171004/0c237993/attachment.bin>
More information about the llvm-commits
mailing list