- 'analyze' and 'as' now explicitly verify input because AsmParser doesn't.
authorChris Lattner <sabre@nondot.org>
Fri, 30 Aug 2002 22:54:41 +0000 (22:54 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 30 Aug 2002 22:54:41 +0000 (22:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3552 91177308-0d34-0410-b5e6-96231b3b80d8

tools/as/as.cpp
tools/llvm-as/as.cpp
tools/llvm-as/llvm-as.cpp

index 7593cef4b0f125b21ce197a0866bfef7490c4e76..c9bd3b4e08c05a6d7bc5ebb71b66a1fdb40d5216 100644 (file)
@@ -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();
 
index 7593cef4b0f125b21ce197a0866bfef7490c4e76..c9bd3b4e08c05a6d7bc5ebb71b66a1fdb40d5216 100644 (file)
@@ -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();
 
index 7593cef4b0f125b21ce197a0866bfef7490c4e76..c9bd3b4e08c05a6d7bc5ebb71b66a1fdb40d5216 100644 (file)
@@ -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();