diff options
author | Joel Galenson <jgalenson@google.com> | 2018-07-16 15:26:44 +0000 |
---|---|---|
committer | Joel Galenson <jgalenson@google.com> | 2018-07-16 15:26:44 +0000 |
commit | 4099b249fb63eb4c40f9e01ea8839b3b313caec8 (patch) | |
tree | c2346e6bf1a73cf89483f242d249782c71a5fa79 /llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp | |
parent | 1d369a5d019448be79311906745eea4953fd2ed9 (diff) | |
download | bcm5719-llvm-4099b249fb63eb4c40f9e01ea8839b3b313caec8.tar.gz bcm5719-llvm-4099b249fb63eb4c40f9e01ea8839b3b313caec8.zip |
[cfi-verify] Abort on unsupported targets
As suggested in the review for r337007, this makes cfi-verify abort on unsupported targets instead of producing incorrect results. It also updates the design document to reflect this.
Differential Revision: https://reviews.llvm.org/D49304
llvm-svn: 337181
Diffstat (limited to 'llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp')
-rw-r--r-- | llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp index 15bf20f091d..29819d8d28e 100644 --- a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp +++ b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp @@ -85,6 +85,16 @@ Expected<FileAnalysis> FileAnalysis::Create(StringRef Filename) { if (!Analysis.Object) return make_error<UnsupportedDisassembly>("Failed to cast object"); + switch (Analysis.Object->getArch()) { + case Triple::x86: + case Triple::x86_64: + case Triple::aarch64: + case Triple::aarch64_be: + break; + default: + return make_error<UnsupportedDisassembly>("Unsupported architecture."); + } + Analysis.ObjectTriple = Analysis.Object->makeTriple(); Analysis.Features = Analysis.Object->getFeatures(); |