diff options
| author | Florian Hahn <flo@fhahn.com> | 2019-03-05 23:10:28 +0000 |
|---|---|---|
| committer | Florian Hahn <flo@fhahn.com> | 2019-03-05 23:10:28 +0000 |
| commit | 74fea3665ffbae57611df32ed4d2b5f308cb9484 (patch) | |
| tree | 89a203e16b4b138fb1ca77e0977e79665cc20292 /llvm/tools | |
| parent | 1d8d6373ec2ee4ded586627bd43171744e7847aa (diff) | |
| download | bcm5719-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.cpp | 5 |
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); |

