[PATCH] D58933: [opt] Report if the provided architecture is invalid.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 17:44:18 PST 2019


fhahn updated this revision to Diff 189249.
fhahn added a comment.

Thanks Eli! I've updated the message to say unrecognized, which sounds better to me too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58933/new/

https://reviews.llvm.org/D58933

Files:
  llvm/tools/opt/opt.cpp


Index: llvm/tools/opt/opt.cpp
===================================================================
--- llvm/tools/opt/opt.cpp
+++ llvm/tools/opt/opt.cpp
@@ -639,6 +639,11 @@
     CPUStr = getCPUStr();
     FeaturesStr = getFeaturesStr();
     Machine = GetTargetMachine(ModuleTriple, CPUStr, FeaturesStr, Options);
+  } else if (ModuleTriple.getArchName() != "unknown" &&
+             ModuleTriple.getArchName() != "") {
+    errs() << argv[0] << ": unrecognized architecture '"
+           << ModuleTriple.getArchName() << "' provided.\n";
+    return 1;
   }
 
   std::unique_ptr<TargetMachine> TM(Machine);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58933.189249.patch
Type: text/x-patch
Size: 610 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190305/d07ecfe8/attachment.bin>


More information about the llvm-commits mailing list