summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-as/llvm-as.cpp
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
commit4a84ad57a9e3ad7ff99ba3369e933f9671cd2d0f (patch)
tree96b65d0f086d5021c169aacf8c8bce2e7e813eb0 /llvm/tools/llvm-as/llvm-as.cpp
parent2292e551ed71e5864167d68097a291f85a33ed2f (diff)
downloadbcm5719-llvm-4a84ad57a9e3ad7ff99ba3369e933f9671cd2d0f.tar.gz
bcm5719-llvm-4a84ad57a9e3ad7ff99ba3369e933f9671cd2d0f.zip
- 'analyze' and 'as' now explicitly verify input because AsmParser doesn't.
llvm-svn: 3552
Diffstat (limited to 'llvm/tools/llvm-as/llvm-as.cpp')
-rw-r--r--llvm/tools/llvm-as/llvm-as.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/tools/llvm-as/llvm-as.cpp b/llvm/tools/llvm-as/llvm-as.cpp
index 7593cef4b0f..c9bd3b4e08c 100644
--- a/llvm/tools/llvm-as/llvm-as.cpp
+++ b/llvm/tools/llvm-as/llvm-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();
OpenPOWER on IntegriCloud