Fix usage of changed function prototype
[oota-llvm.git] / tools / gccas / gccas.cpp
index 1d5f9d1ff8108a7752906ae71192e5149dfe1cda..dd8b8e0698498db4613ad007bd2a0ee311d0227f 100644 (file)
@@ -22,7 +22,7 @@
 #include "llvm/Target/TargetData.h"
 #include "llvm/Transforms/IPO.h"
 #include "llvm/Transforms/Scalar.h"
-#include "Support/CommandLine.h"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/System/Signals.h"
 #include <memory>
 #include <fstream>
@@ -49,6 +49,9 @@ namespace {
 
   cl::opt<bool>
   DisableDSE("disable-dse", cl::desc("Do not run dead store elimination"));
+  cl::opt<bool> 
+  NoCompress("disable-compression", cl::init(false),
+             cl::desc("Don't ompress the generated bytecode"));
 }
 
 
@@ -71,8 +74,8 @@ void AddConfiguredTransformationPasses(PassManager &PM) {
   addPass(PM, createRaiseAllocationsPass());     // call %malloc -> malloc inst
   addPass(PM, createCFGSimplificationPass());    // Clean up disgusting code
   addPass(PM, createPromoteMemoryToRegister());  // Kill useless allocas
-  addPass(PM, createGlobalConstifierPass());     // Mark read-only globals const
-  addPass(PM, createGlobalDCEPass());            // Remove unused globals
+  addPass(PM, createGlobalOptimizerPass());      // Optimize out global vars
+  addPass(PM, createGlobalDCEPass());            // Remove unused fns and globs
   addPass(PM, createIPConstantPropagationPass());// IP Constant Propagation
   addPass(PM, createDeadArgEliminationPass());   // Dead argument elimination
   addPass(PM, createInstructionCombiningPass()); // Clean up after IPCP & DAE
@@ -117,7 +120,7 @@ void AddConfiguredTransformationPasses(PassManager &PM) {
 
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv, " llvm .s -> .o assembler for GCC\n");
-  PrintStackTraceOnErrorSignal();
+  sys::PrintStackTraceOnErrorSignal();
 
   std::auto_ptr<Module> M;
   try {
@@ -156,7 +159,7 @@ int main(int argc, char **argv) {
 
     // Make sure that the Out file gets unlinked from the disk if we get a
     // signal
-    RemoveFileOnSignal(OutputFilename);
+    sys::RemoveFileOnSignal(sys::Path(OutputFilename));
   }
 
   
@@ -182,7 +185,7 @@ int main(int argc, char **argv) {
   Passes.add(createVerifierPass());
 
   // Write bytecode to file...
-  Passes.add(new WriteBytecodePass(Out));
+  Passes.add(new WriteBytecodePass(Out,false,!NoCompress));
 
   // Run our queue of passes all at once now, efficiently.
   Passes.run(*M.get());