r314926 - [Hexagon] Move getHexagonTargetFeatures to Hexagon.cpp (NFC)

Sumanth Gundapaneni via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 4 12:09:30 PDT 2017


Author: sgundapa
Date: Wed Oct  4 12:09:29 2017
New Revision: 314926

URL: http://llvm.org/viewvc/llvm-project?rev=314926&view=rev
Log:
[Hexagon] Move getHexagonTargetFeatures to Hexagon.cpp (NFC)

Differential Revision: https://reviews.llvm.org/D38548

Modified:
    cfe/trunk/lib/Driver/ToolChains/Clang.cpp
    cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp
    cfe/trunk/lib/Driver/ToolChains/Hexagon.h

Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=314926&r1=314925&r2=314926&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Wed Oct  4 12:09:29 2017
@@ -273,21 +273,6 @@ static void ParseMRecip(const Driver &D,
   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 @@ static void getTargetFeatures(const Tool
     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:

Modified: cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp?rev=314926&r1=314925&r2=314926&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp Wed Oct  4 12:09:29 2017
@@ -27,6 +27,22 @@ using namespace clang::driver::toolchain
 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 {

Modified: cfe/trunk/lib/Driver/ToolChains/Hexagon.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Hexagon.h?rev=314926&r1=314925&r2=314926&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Hexagon.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/Hexagon.h Wed Oct  4 12:09:29 2017
@@ -50,6 +50,10 @@ public:
                     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
 




More information about the cfe-commits mailing list