[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 15:41:24 PST 2019
fhahn created this revision.
fhahn added reviewers: echristo, efriedma, rengolin, atrick.
Herald added a project: LLVM.
Partly addresses PR15026.
Repository:
rG LLVM Github Monorepo
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] << ": invalid architecture '"
+ << ModuleTriple.getArchName() << "' provided.\n";
+ return 1;
}
std::unique_ptr<TargetMachine> TM(Machine);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58933.189224.patch
Type: text/x-patch
Size: 605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190304/175efc15/attachment.bin>
More information about the llvm-commits
mailing list