aboutsummaryrefslogtreecommitdiffstats
path: root/tools/as
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-08-30 22:54:41 +0000
committerChris Lattner <sabre@nondot.org>2002-08-30 22:54:41 +0000
commit1acbea1678087e5d789acfc6fce094efa818d182 (patch)
treed72c0df59e04d0208a294b7345a5e8d034871a5f /tools/as
parentcd7fbf2d0ffda381bf8024cd485a67b8054f6a54 (diff)
downloadexternal_llvm-1acbea1678087e5d789acfc6fce094efa818d182.zip
external_llvm-1acbea1678087e5d789acfc6fce094efa818d182.tar.gz
external_llvm-1acbea1678087e5d789acfc6fce094efa818d182.tar.bz2
- 'analyze' and 'as' now explicitly verify input because AsmParser doesn't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3552 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/as')
-rw-r--r--tools/as/as.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/as/as.cpp b/tools/as/as.cpp
index 7593cef..c9bd3b4 100644
--- a/tools/as/as.cpp
+++ b/tools/as/as.cpp
@@ -12,6 +12,7 @@
#include "llvm/Module.h"
#include "llvm/Assembly/Parser.h"
#include "llvm/Bytecode/Writer.h"
+#include "llvm/Analysis/Verifier.h"
#include "Support/CommandLine.h"
#include "Support/Signals.h"
#include <fstream>
@@ -43,6 +44,12 @@ int main(int argc, char **argv) {
cerr << argv[0] << ": assembly didn't read correctly.\n";
return 1;
}
+
+ if (verifyModule(*M.get())) {
+ cerr << argv[0] << ": assembly parsed, but does not verify as correct!\n";
+ return 1;
+ }
+
if (DumpAsm) cerr << "Here's the assembly:\n" << M.get();