summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
diff options
context:
space:
mode:
authorJoel Galenson <jgalenson@google.com>2018-07-16 15:26:44 +0000
committerJoel Galenson <jgalenson@google.com>2018-07-16 15:26:44 +0000
commit4099b249fb63eb4c40f9e01ea8839b3b313caec8 (patch)
treec2346e6bf1a73cf89483f242d249782c71a5fa79 /llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
parent1d369a5d019448be79311906745eea4953fd2ed9 (diff)
downloadbcm5719-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.cpp10
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();
OpenPOWER on IntegriCloud