r256977 - [Hexagon] Treat -march and -mcpu as equivalent

Krzysztof Parzyszek via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 6 13:12:03 PST 2016


Author: kparzysz
Date: Wed Jan  6 15:12:03 2016
New Revision: 256977

URL: http://llvm.org/viewvc/llvm-project?rev=256977&view=rev
Log:
[Hexagon] Treat -march and -mcpu as equivalent

Modified:
    cfe/trunk/lib/Driver/ToolChains.cpp

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=256977&r1=256976&r2=256977&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Wed Jan  6 15:12:03 2016
@@ -2716,13 +2716,8 @@ const StringRef HexagonToolChain::GetDef
 
 const StringRef HexagonToolChain::GetTargetCPUVersion(const ArgList &Args) {
   Arg *CpuArg = nullptr;
-
-  for (auto &A : Args) {
-    if (A->getOption().matches(options::OPT_mcpu_EQ)) {
-      CpuArg = A;
-      A->claim();
-    }
-  }
+  if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ, options::OPT_march_EQ))
+    CpuArg = A;
 
   StringRef CPU = CpuArg ? CpuArg->getValue() : GetDefaultCPU();
   if (CPU.startswith("hexagon"))




More information about the cfe-commits mailing list