[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
diff --git a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
index 15bf20f..29819d8 100644
--- a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
+++ b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
@@ -85,6 +85,16 @@
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();