[llvm-commits] [hlvm] r38385 - /hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp

Reid Spencer reid at x10sys.com
Sat Jul 7 17:02:53 PDT 2007


Author: reid
Date: Sat Jul  7 19:02:53 2007
New Revision: 38385

URL: http://llvm.org/viewvc/llvm-project?rev=38385&view=rev
Log:
Update to handle changes in the code generation interface.

Modified:
    hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp

Modified: hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp?rev=38385&r1=38384&r2=38385&view=diff

==============================================================================
--- hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp (original)
+++ hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp Sat Jul  7 19:02:53 2007
@@ -28,6 +28,7 @@
 //===----------------------------------------------------------------------===//
 
 #include <hlvm/Base/Memory.h>
+#include <hlvm/Base/Assert.h>
 #include <hlvm/Reader/XMLReader.h>
 #include <hlvm/Writer/XMLWriter.h>
 #include <hlvm/Pass/Pass.h>
@@ -50,9 +51,6 @@
 static cl::opt<bool> NoValidate("no-validate", cl::init(false),
   cl::desc("Don't validate input before generating code"));
 
-static cl::opt<bool> NoVerify("no-verify", cl::init(false),
-  cl::desc("Don't verify generated LLVM module"));
-
 enum GenerationOptions {
   GenLLVMBytecode,
   GenLLVMAssembly,
@@ -125,18 +123,24 @@
       if (!validate(node))
         exit(3);
     }
+    std::string ErrMsg;
     switch (WhatToGenerate) {
       case GenLLVMBytecode:
-        if (!generateBytecode(node,*Out, !NoVerify))
+        if (!generateBytecode(node,*Out, ErrMsg)) {
+          std::cerr << argv[0] << ": Code generation error:\n" << ErrMsg;
           exit(4);
+        }
         break;
       case GenLLVMAssembly: 
-        if (!generateAssembly(node,*Out, !NoVerify))
+        if (!generateAssembly(node,*Out, ErrMsg)) {
+          std::cerr << argv[0] << ": Code generation error:\n" << ErrMsg;
           exit(4);
+        }
         break;
       case GenHLVMXML:
       {
         XMLWriter* wrtr = XMLWriter::create(OutputFilename.c_str());
+        hlvmAssert(wrtr && "Can't create XMLWriter?");
         wrtr->write(node);
         delete wrtr;
         break;





More information about the llvm-commits mailing list