summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2019-03-05 23:10:28 +0000
committerFlorian Hahn <flo@fhahn.com>2019-03-05 23:10:28 +0000
commit74fea3665ffbae57611df32ed4d2b5f308cb9484 (patch)
tree89a203e16b4b138fb1ca77e0977e79665cc20292 /llvm/tools
parent1d8d6373ec2ee4ded586627bd43171744e7847aa (diff)
downloadbcm5719-llvm-74fea3665ffbae57611df32ed4d2b5f308cb9484.tar.gz
bcm5719-llvm-74fea3665ffbae57611df32ed4d2b5f308cb9484.zip
[opt] Report if the provided architecture is invalid.
Partly addresses PR15026. There are a few tests that passed in invalid architectures, which are fixed in: rL355349 and D58931 Reviewers: echristo, efriedma, rengolin, atrick Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D58933 llvm-svn: 355455
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/opt/opt.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 69485c72410..2d80b479735 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -639,6 +639,11 @@ int main(int argc, char **argv) {
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);
OpenPOWER on IntegriCloud