[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2007-06-28 Thread Devang Patel


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.142 - 1.143
---
Log message:

Fix PR 1526: http://llvm.org/PR1526 .


---
Diffs of the changes:  (+34 -0)

 opt.cpp |   34 ++
 1 files changed, 34 insertions(+)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.142 llvm/tools/opt/opt.cpp:1.143
--- llvm/tools/opt/opt.cpp:1.142Sun May  6 18:45:49 2007
+++ llvm/tools/opt/opt.cpp  Thu Jun 28 18:09:24 2007
@@ -14,10 +14,12 @@
 
 #include llvm/Module.h
 #include llvm/PassManager.h
+#include llvm/CallGraphSCCPass.h
 #include llvm/Bitcode/ReaderWriter.h
 #include llvm/Assembly/PrintModulePass.h
 #include llvm/Analysis/Verifier.h
 #include llvm/Analysis/LoopPass.h
+#include llvm/Analysis/CallGraph.h
 #include llvm/Target/TargetData.h
 #include llvm/Target/TargetMachine.h
 #include llvm/Support/PassNameParser.h
@@ -94,6 +96,36 @@
 // -- Define Printers for module and function passes 
 namespace {
 
+struct CallGraphSCCPassPrinter : public CallGraphSCCPass {
+  static char ID;
+  const PassInfo *PassToPrint;
+  CallGraphSCCPassPrinter(const PassInfo *PI) : 
+CallGraphSCCPass((intptr_t)ID), PassToPrint(PI) {}
+
+  virtual bool runOnSCC(const std::vectorCallGraphNode *SCC) {
+if (!Quiet) {
+  cout  Printing analysis '  PassToPrint-getPassName()  ':\n;
+
+  for (unsigned i = 0, e = SCC.size(); i != e; ++i) {
+Function *F = SCC[i]-getFunction();
+if (F) 
+  getAnalysisIDPass(PassToPrint).print(cout, F-getParent());
+  }
+}
+// Get and print pass...
+return false;
+  }
+  
+  virtual const char *getPassName() const { return 'Pass' Printer; }
+
+  virtual void getAnalysisUsage(AnalysisUsage AU) const {
+AU.addRequiredID(PassToPrint);
+AU.setPreservesAll();
+  }
+};
+
+char CallGraphSCCPassPrinter::ID = 0;
+
 struct ModulePassPrinter : public ModulePass {
   static char ID;
   const PassInfo *PassToPrint;
@@ -342,6 +374,8 @@
 Passes.add(new BasicBlockPassPrinter(PassInf));
   else if (dynamic_castFunctionPass*(P))
 Passes.add(new FunctionPassPrinter(PassInf));
+  else if (dynamic_castCallGraphSCCPass*(P))
+Passes.add(new CallGraphSCCPassPrinter(PassInf));
   else
 Passes.add(new ModulePassPrinter(PassInf));
 }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2007-05-06 Thread Chris Lattner


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.140 - 1.141
---
Log message:

make sure the ofstream for opt's output file is destroyed, so that the bits
actually land on disk.


---
Diffs of the changes:  (+3 -0)

 opt.cpp |3 +++
 1 files changed, 3 insertions(+)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.140 llvm/tools/opt/opt.cpp:1.141
--- llvm/tools/opt/opt.cpp:1.140Sun May  6 04:32:02 2007
+++ llvm/tools/opt/opt.cpp  Sun May  6 14:17:23 2007
@@ -365,6 +365,9 @@
 // Now that we have all of the passes ready, run them.
 Passes.run(*M.get());
 
+// Delete the ofstream.
+if (Out != std::cout) 
+  delete Out;
 return 0;
 
   } catch (const std::string msg) {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2007-05-06 Thread Chris Lattner


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.141 - 1.142
---
Log message:

use the new MemoryBuffer interfaces to simplify error reporting in clients.


---
Diffs of the changes:  (+4 -7)

 opt.cpp |   11 ---
 1 files changed, 4 insertions(+), 7 deletions(-)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.141 llvm/tools/opt/opt.cpp:1.142
--- llvm/tools/opt/opt.cpp:1.141Sun May  6 14:17:23 2007
+++ llvm/tools/opt/opt.cpp  Sun May  6 18:45:49 2007
@@ -260,15 +260,12 @@
 
 // Load the input module...
 std::auto_ptrModule M;
-MemoryBuffer *Buffer
-  = MemoryBuffer::getFileOrSTDIN(InputFilename[0], InputFilename.size());
-
-if (Buffer == 0)
-  ErrorMessage = Error reading file ' + InputFilename + ';
-else
+if (MemoryBuffer *Buffer
+  = MemoryBuffer::getFileOrSTDIN(InputFilename, ErrorMessage)) {
   M.reset(ParseBitcodeFile(Buffer, ErrorMessage));
+  delete Buffer;
+}
 
-delete Buffer;
 if (M.get() == 0) {
   cerr  argv[0]  : ;
   if (ErrorMessage.size())



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2007-04-20 Thread Chris Lattner


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.133 - 1.134
---
Log message:

remove cruft


---
Diffs of the changes:  (+0 -3)

 opt.cpp |3 ---
 1 files changed, 3 deletions(-)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.133 llvm/tools/opt/opt.cpp:1.134
--- llvm/tools/opt/opt.cpp:1.133Tue Apr 10 10:43:36 2007
+++ llvm/tools/opt/opt.cpp  Thu Apr 19 23:45:58 2007
@@ -27,7 +27,6 @@
 #include llvm/Support/PluginLoader.h
 #include llvm/Support/Streams.h
 #include llvm/Support/SystemUtils.h
-#include llvm/Support/Timer.h
 #include llvm/LinkAllPasses.h
 #include llvm/LinkAllVMCore.h
 #include iostream
@@ -95,8 +94,6 @@
 static cl::optbool
 AnalyzeOnly(analyze, cl::desc(Only perform analysis, no optimization));
 
-static Timer BytecodeLoadTimer(Bytecode Loader);
-
 // -- Define Printers for module and function passes 
 namespace {
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2007-04-10 Thread Devang Patel


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.132 - 1.133
---
Log message:

Enable loop rotate pass.


---
Diffs of the changes:  (+1 -0)

 opt.cpp |1 +
 1 files changed, 1 insertion(+)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.132 llvm/tools/opt/opt.cpp:1.133
--- llvm/tools/opt/opt.cpp:1.132Tue Mar  6 18:26:10 2007
+++ llvm/tools/opt/opt.cpp  Tue Apr 10 10:43:36 2007
@@ -212,6 +212,7 @@
   addPass(PM, createTailCallEliminationPass());  // Eliminate tail calls
   addPass(PM, createCFGSimplificationPass());// Merge  remove BBs
   addPass(PM, createReassociatePass());  // Reassociate expressions
+  addPass(PM, createLoopRotatePass());
   addPass(PM, createLICMPass()); // Hoist loop invariants
   addPass(PM, createLoopUnswitchPass()); // Unswitch loops.
   addPass(PM, createInstructionCombiningPass()); // Clean up after LICM/reassoc



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2007-03-06 Thread Devang Patel


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.131 - 1.132
---
Log message:

Now LoopUnswitch is a LoopPass.


---
Diffs of the changes:  (+1 -0)

 opt.cpp |1 +
 1 files changed, 1 insertion(+)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.131 llvm/tools/opt/opt.cpp:1.132
--- llvm/tools/opt/opt.cpp:1.131Wed Feb  7 15:41:02 2007
+++ llvm/tools/opt/opt.cpp  Tue Mar  6 18:26:10 2007
@@ -18,6 +18,7 @@
 #include llvm/Bytecode/WriteBytecodePass.h
 #include llvm/Assembly/PrintModulePass.h
 #include llvm/Analysis/Verifier.h
+#include llvm/Analysis/LoopPass.h
 #include llvm/Target/TargetData.h
 #include llvm/Target/TargetMachine.h
 #include llvm/Support/PassNameParser.h



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2007-02-05 Thread Reid Spencer


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.129 - 1.130
---
Log message:

For PR411: http://llvm.org/PR411 :
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.


---
Diffs of the changes:  (+0 -1)

 opt.cpp |1 -
 1 files changed, 1 deletion(-)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.129 llvm/tools/opt/opt.cpp:1.130
--- llvm/tools/opt/opt.cpp:1.129Sat Feb  3 17:15:56 2007
+++ llvm/tools/opt/opt.cpp  Mon Feb  5 14:47:22 2007
@@ -178,7 +178,6 @@
   PM.add(createVerifierPass());  // Verify that input is 
correct
 
   addPass(PM, createLowerSetJmpPass());  // Lower llvm.setjmp/.longjmp
-  addPass(PM, createFunctionResolvingPass());// Resolve (...) functions
 
   // If the -strip-debug command line option was specified, do it.
   if (StripDebug)



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2007-02-02 Thread Reid Spencer


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.127 - 1.128
---
Log message:

For PR1152: http://llvm.org/PR1152 :
Step 1: Copy gccas functionality to opt. This endows opt with a new
-std-compile-opts option to get the set of optimization passes that
gccas used. It also adds -disable-inlining and -disable-opt which
both apply only if -std-compile-opts is given. The -strip-debug option
was also removed. It just makes sure that -strip gets done early and
is mostly there for compatibility with gccas. Finally, a new 
-verify-each option will cause the verify pass to be run after each pass.


---
Diffs of the changes:  (+100 -2)

 opt.cpp |  102 ++--
 1 files changed, 100 insertions(+), 2 deletions(-)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.127 llvm/tools/opt/opt.cpp:1.128
--- llvm/tools/opt/opt.cpp:1.127Tue Jan 30 22:45:28 2007
+++ llvm/tools/opt/opt.cpp  Fri Feb  2 08:46:29 2007
@@ -68,6 +68,24 @@
 NoVerify(disable-verify, cl::desc(Do not verify result module), 
cl::Hidden);
 
 static cl::optbool
+VerifyEach(verify-each, cl::desc(Verify after each transform));
+
+static cl::optbool
+StripDebug(strip-debug,
+   cl::desc(Strip debugger symbol info from translation unit));
+
+static cl::optbool
+DisableInline(disable-inlining, cl::desc(Do not run the inliner pass));
+
+static cl::optbool 
+DisableOptimizations(disable-opt, 
+ cl::desc(Do not run any optimization passes));
+
+static cl::optbool
+StandardCompileOpts(std-compile-opts, 
+   cl::desc(Include the standard compile time 
optimizations));
+
+static cl::optbool
 Quiet(q, cl::desc(Obsolete option), cl::Hidden);
 
 static cl::alias
@@ -148,6 +166,76 @@
   }
 };
 
+inline void addPass(PassManager PM, Pass *P) {
+  // Add the pass to the pass manager...
+  PM.add(P);
+
+  // If we are verifying all of the intermediate steps, add the verifier...
+  if (VerifyEach) PM.add(createVerifierPass());
+}
+
+void AddStandardCompilePasses(PassManager PM) {
+  PM.add(createVerifierPass());  // Verify that input is 
correct
+
+  addPass(PM, createLowerSetJmpPass());  // Lower llvm.setjmp/.longjmp
+  addPass(PM, createFunctionResolvingPass());// Resolve (...) functions
+
+  // If the -strip-debug command line option was specified, do it.
+  if (StripDebug)
+addPass(PM, createStripSymbolsPass(true));
+
+  if (DisableOptimizations) return;
+
+  addPass(PM, createRaiseAllocationsPass()); // call %malloc - malloc inst
+  addPass(PM, createCFGSimplificationPass());// Clean up disgusting code
+  addPass(PM, createPromoteMemoryToRegisterPass());// Kill useless allocas
+  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
+  addPass(PM, createCFGSimplificationPass());// Clean up after IPCP  DAE
+
+  addPass(PM, createPruneEHPass());  // Remove dead EH info
+
+  if (!DisableInline)
+addPass(PM, createFunctionInliningPass());   // Inline small functions
+  addPass(PM, createArgumentPromotionPass());// Scalarize uninlined fn args
+
+  addPass(PM, createRaisePointerReferencesPass());// Recover type information
+  addPass(PM, createTailDuplicationPass());  // Simplify cfg by copying 
code
+  addPass(PM, createInstructionCombiningPass()); // Cleanup for scalarrepl.
+  addPass(PM, createCFGSimplificationPass());// Merge  remove BBs
+  addPass(PM, createScalarReplAggregatesPass()); // Break up aggregate allocas
+  addPass(PM, createInstructionCombiningPass()); // Combine silly seq's
+  addPass(PM, createCondPropagationPass());  // Propagate conditionals
+
+  addPass(PM, createTailCallEliminationPass());  // Eliminate tail calls
+  addPass(PM, createCFGSimplificationPass());// Merge  remove BBs
+  addPass(PM, createReassociatePass());  // Reassociate expressions
+  addPass(PM, createLICMPass()); // Hoist loop invariants
+  addPass(PM, createLoopUnswitchPass()); // Unswitch loops.
+  addPass(PM, createInstructionCombiningPass()); // Clean up after LICM/reassoc
+  addPass(PM, createIndVarSimplifyPass());   // Canonicalize indvars
+  addPass(PM, createLoopUnrollPass());   // Unroll small loops
+  addPass(PM, createInstructionCombiningPass()); // Clean up after the unroller
+  addPass(PM, createLoadValueNumberingPass());   // GVN for load instructions
+  addPass(PM, createGCSEPass()); // Remove common subexprs
+  addPass(PM, createSCCPPass()); // Constant prop with SCCP
+
+  // Run instcombine after redundancy elimination to exploit opportunities
+  // 

[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2007-01-30 Thread Chris Lattner


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.126 - 1.127
---
Log message:

shutdown at end of run


---
Diffs of the changes:  (+1 -0)

 opt.cpp |1 +
 1 files changed, 1 insertion(+)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.126 llvm/tools/opt/opt.cpp:1.127
--- llvm/tools/opt/opt.cpp:1.126Sun Jan 21 00:28:44 2007
+++ llvm/tools/opt/opt.cpp  Tue Jan 30 22:45:28 2007
@@ -263,5 +263,6 @@
   } catch (...) {
 cerr  argv[0]  : Unexpected unknown exception occurred.\n;
   }
+  llvm_shutdown();
   return 1;
 }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2007-01-20 Thread Chris Lattner


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.125 - 1.126
---
Log message:

default to emiting an uncompressed .bc file


---
Diffs of the changes:  (+1 -1)

 opt.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.125 llvm/tools/opt/opt.cpp:1.126
--- llvm/tools/opt/opt.cpp:1.125Wed Dec  6 19:30:32 2006
+++ llvm/tools/opt/opt.cpp  Sun Jan 21 00:28:44 2007
@@ -41,7 +41,7 @@
 static cl::listconst PassInfo*, bool, PassNameParser
 PassList(cl::desc(Optimizations available:));
 
-static cl::optbool NoCompress(disable-compression, cl::init(false),
+static cl::optbool NoCompress(disable-compression, cl::init(true),
cl::desc(Don't compress the generated bytecode));
 
 // Other command line options...



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2006-12-05 Thread Chris Lattner


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.123 - 1.124
---
Log message:

make all llvm tools call llvm_shutdown when they exit, static'ify some stuff.

With this change, I can now move -stats to print when llvm_shutdown is called.


---
Diffs of the changes:  (+2 -0)

 opt.cpp |2 ++
 1 files changed, 2 insertions(+)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.123 llvm/tools/opt/opt.cpp:1.124
--- llvm/tools/opt/opt.cpp:1.123Fri Dec  1 15:59:37 2006
+++ llvm/tools/opt/opt.cpp  Tue Dec  5 19:18:01 2006
@@ -22,6 +22,7 @@
 #include llvm/Target/TargetMachine.h
 #include llvm/Support/PassNameParser.h
 #include llvm/System/Signals.h
+#include llvm/Support/ManagedStatic.h
 #include llvm/Support/PluginLoader.h
 #include llvm/Support/Streams.h
 #include llvm/Support/SystemUtils.h
@@ -156,6 +157,7 @@
 // main for opt
 //
 int main(int argc, char **argv) {
+  llvm_shutdown_obj X;  // Call llvm_shutdown() on exit.
   try {
 cl::ParseCommandLineOptions(argc, argv,
llvm .bc - .bc modular optimizer and analysis printer \n);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2006-11-30 Thread Nick Lewycky


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.121 - 1.122
---
Log message:

Fix opt -o option. Don't pass a pointer to an auto variable which is going
away before it's needed, and don't try to delete that pointer!


---
Diffs of the changes:  (+3 -4)

 opt.cpp |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.121 llvm/tools/opt/opt.cpp:1.122
--- llvm/tools/opt/opt.cpp:1.121Tue Nov 28 18:19:40 2006
+++ llvm/tools/opt/opt.cpp  Thu Nov 30 18:43:14 2006
@@ -252,10 +252,9 @@
   Passes.add(createVerifierPass());
 
 // Write bytecode out to disk or cout as the last step...
-if (!NoOutput  !AnalyzeOnly) {
-  llvm_ostream L(*Out);
-  Passes.add(new WriteBytecodePass(L, Out != std::cout, !NoCompress));
-}
+llvm_ostream L(*Out);
+if (!NoOutput  !AnalyzeOnly)
+  Passes.add(new WriteBytecodePass(L, false, !NoCompress));
 
 // Now that we have all of the passes ready, run them.
 Passes.run(*M.get());



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2006-11-28 Thread Bill Wendling


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.119 - 1.120
---
Log message:

Convert to using llvm streams instead of iostreams.


---
Diffs of the changes:  (+16 -15)

 opt.cpp |   31 ---
 1 files changed, 16 insertions(+), 15 deletions(-)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.119 llvm/tools/opt/opt.cpp:1.120
--- llvm/tools/opt/opt.cpp:1.119Thu Nov  2 14:25:50 2006
+++ llvm/tools/opt/opt.cpp  Tue Nov 28 17:33:06 2006
@@ -23,6 +23,7 @@
 #include llvm/Support/PassNameParser.h
 #include llvm/System/Signals.h
 #include llvm/Support/PluginLoader.h
+#include llvm/Support/Streams.h
 #include llvm/Support/SystemUtils.h
 #include llvm/Support/Timer.h
 #include llvm/LinkAllPasses.h
@@ -84,9 +85,9 @@
 
   virtual bool runOnModule(Module M) {
 if (!Quiet) {
-  std::cout  Printing analysis '  PassToPrint-getPassName() 
+  llvm_cout  Printing analysis '  PassToPrint-getPassName() 
  ':\n;
-  getAnalysisIDPass(PassToPrint).print(std::cout, M);
+  getAnalysisIDPass(PassToPrint).print(llvm_cout, M);
 }
 
 // Get and print pass...
@@ -107,11 +108,11 @@
 
   virtual bool runOnFunction(Function F) {
 if (!Quiet) {
-  std::cout  Printing analysis '  PassToPrint-getPassName()
+  llvm_cout  Printing analysis '  PassToPrint-getPassName()
 ' for function '  F.getName()  ':\n;
 }
 // Get and print pass...
-getAnalysisIDPass(PassToPrint).print(std::cout, F.getParent());
+getAnalysisIDPass(PassToPrint).print(llvm_cout, F.getParent());
 return false;
   }
 
@@ -129,13 +130,13 @@
 
   virtual bool runOnBasicBlock(BasicBlock BB) {
 if (!Quiet) {
-  std::cout  Printing Analysis info for BasicBlock '  BB.getName()
+  llvm_cout  Printing Analysis info for BasicBlock '  BB.getName()
 ': Pass   PassToPrint-getPassName()  :\n;
 }
 
 // Get and print pass...
 getAnalysisIDPass(PassToPrint).print(
-  std::cout, BB.getParent()-getParent());
+  llvm_cout, BB.getParent()-getParent());
 return false;
   }
 
@@ -168,11 +169,11 @@
 // Load the input module...
 std::auto_ptrModule M(ParseBytecodeFile(InputFilename, ErrorMessage));
 if (M.get() == 0) {
-  std::cerr  argv[0]  : ;
+  llvm_cerr  argv[0]  : ;
   if (ErrorMessage.size())
-std::cerr  ErrorMessage  \n;
+llvm_cerr  ErrorMessage  \n;
   else
-std::cerr  bytecode didn't read correctly.\n;
+llvm_cerr  bytecode didn't read correctly.\n;
   return 1;
 }
 
@@ -182,7 +183,7 @@
 if (OutputFilename != -) {
   if (!Force  std::ifstream(OutputFilename.c_str())) {
 // If force is not specified, make sure not to overwrite a file!
-std::cerr  argv[0]  : error opening '  OutputFilename
+llvm_cerr  argv[0]  : error opening '  OutputFilename
': file exists!\n
Use -f command line argument to force output\n;
 return 1;
@@ -192,7 +193,7 @@
   Out = new std::ofstream(OutputFilename.c_str(), io_mode);
 
   if (!Out-good()) {
-std::cerr  argv[0]  : error opening   OutputFilename  !\n;
+llvm_cerr  argv[0]  : error opening   OutputFilename  !\n;
 return 1;
   }
 
@@ -226,7 +227,7 @@
 assert(target.get()  Could not allocate target machine!);
 P = PassInf-getTargetCtor()(*target.get());
   } else
-std::cerr  argv[0]  : cannot create pass: 
+llvm_cerr  argv[0]  : cannot create pass: 
PassInf-getPassName()  \n;
   if (P) {
 Passes.add(P);
@@ -242,7 +243,7 @@
   }
   
   if (PrintEachXForm)
-Passes.add(new PrintModulePass(std::cerr));
+Passes.add(new PrintModulePass(llvm_cerr));
 }
 
 // Check that the module is well formed on completion of optimization
@@ -259,9 +260,9 @@
 return 0;
 
   } catch (const std::string msg) {
-std::cerr  argv[0]  :   msg  \n;
+llvm_cerr  argv[0]  :   msg  \n;
   } catch (...) {
-std::cerr  argv[0]  : Unexpected unknown exception occurred.\n;
+llvm_cerr  argv[0]  : Unexpected unknown exception occurred.\n;
   }
   return 1;
 }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2006-11-28 Thread Bill Wendling


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.120 - 1.121
---
Log message:

Replacing std::iostreams with llvm iostreams. Some of these changes involve
adding a temporary wrapper around the ostream to make it friendly to
functions expecting an LLVM stream. This should be fixed in the future.


---
Diffs of the changes:  (+5 -2)

 opt.cpp |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.120 llvm/tools/opt/opt.cpp:1.121
--- llvm/tools/opt/opt.cpp:1.120Tue Nov 28 17:33:06 2006
+++ llvm/tools/opt/opt.cpp  Tue Nov 28 18:19:40 2006
@@ -28,6 +28,7 @@
 #include llvm/Support/Timer.h
 #include llvm/LinkAllPasses.h
 #include llvm/LinkAllVMCore.h
+#include iostream
 #include fstream
 #include memory
 #include algorithm
@@ -251,8 +252,10 @@
   Passes.add(createVerifierPass());
 
 // Write bytecode out to disk or cout as the last step...
-if (!NoOutput  !AnalyzeOnly)
-  Passes.add(new WriteBytecodePass(Out, Out != std::cout, !NoCompress));
+if (!NoOutput  !AnalyzeOnly) {
+  llvm_ostream L(*Out);
+  Passes.add(new WriteBytecodePass(L, Out != std::cout, !NoCompress));
+}
 
 // Now that we have all of the passes ready, run them.
 Passes.run(*M.get());



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2006-11-02 Thread Reid Spencer


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.118 - 1.119
---
Log message:

For PR786: http://llvm.org/PR786 :
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining 
issues when they see them. All changes pass DejaGnu tests and Olden.


---
Diffs of the changes:  (+2 -3)

 opt.cpp |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.118 llvm/tools/opt/opt.cpp:1.119
--- llvm/tools/opt/opt.cpp:1.118Mon Aug 28 12:31:55 2006
+++ llvm/tools/opt/opt.cpp  Thu Nov  2 14:25:50 2006
@@ -163,7 +163,6 @@
 // FIXME: The choice of target should be controllable on the command line.
 std::auto_ptrTargetMachine target;
 
-TargetMachine* TM = NULL;
 std::string ErrorMessage;
 
 // Load the input module...
@@ -233,9 +232,9 @@
 Passes.add(P);
 
 if (AnalyzeOnly) {
-  if (BasicBlockPass *BBP = dynamic_castBasicBlockPass*(P))
+  if (dynamic_castBasicBlockPass*(P))
 Passes.add(new BasicBlockPassPrinter(PassInf));
-  else if (FunctionPass *FP = dynamic_castFunctionPass*(P))
+  else if (dynamic_castFunctionPass*(P))
 Passes.add(new FunctionPassPrinter(PassInf));
   else
 Passes.add(new ModulePassPrinter(PassInf));



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2006-08-20 Thread Reid Spencer


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.112 - 1.113
---
Log message:

For PR797: http://llvm.org/PR797 :
Make sys::Program::ExecuteAndWait not throw exceptions and update any 
affected code. It now return - to signal that the program couldn't be
executed. Only one case (in bugpoint) actually examines the result code.


---
Diffs of the changes:  (+1 -2)

 opt.cpp |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.112 llvm/tools/opt/opt.cpp:1.113
--- llvm/tools/opt/opt.cpp:1.112Fri Aug 18 03:43:06 2006
+++ llvm/tools/opt/opt.cpp  Sun Aug 20 21:04:43 2006
@@ -26,8 +26,7 @@
 #include llvm/Support/PluginLoader.h
 #include llvm/Support/SystemUtils.h
 #include llvm/Support/Timer.h
-#include llvm/Analysis/LinkAllAnalyses.h
-#include llvm/Transforms/LinkAllPasses.h
+#include llvm/LinkAllPasses.h
 #include llvm/LinkAllVMCore.h
 #include fstream
 #include memory



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2006-08-20 Thread Nate Begeman


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.113 - 1.114
---
Log message:

Fix a build failure


---
Diffs of the changes:  (+1 -1)

 opt.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.113 llvm/tools/opt/opt.cpp:1.114
--- llvm/tools/opt/opt.cpp:1.113Sun Aug 20 21:04:43 2006
+++ llvm/tools/opt/opt.cpp  Sun Aug 20 23:57:01 2006
@@ -26,7 +26,7 @@
 #include llvm/Support/PluginLoader.h
 #include llvm/Support/SystemUtils.h
 #include llvm/Support/Timer.h
-#include llvm/LinkAllPasses.h
+#include llvm/Transforms/LinkAllPasses.h
 #include llvm/LinkAllVMCore.h
 #include fstream
 #include memory



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2006-06-16 Thread Chris Lattner


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.109 - 1.110
---
Log message:

Don't pass target name into TargetData anymore, it is never used or needed.



---
Diffs of the changes:  (+1 -1)

 opt.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.109 llvm/tools/opt/opt.cpp:1.110
--- llvm/tools/opt/opt.cpp:1.109Wed Jun  7 18:03:13 2006
+++ llvm/tools/opt/opt.cpp  Fri Jun 16 13:23:49 2006
@@ -134,7 +134,7 @@
 PassManager Passes;
 
 // Add an appropriate TargetData instance for this module...
-Passes.add(new TargetData(opt, M.get()));
+Passes.add(new TargetData(M.get()));
 
 // Create a new optimization pass for each one specified on the command 
line
 for (unsigned i = 0; i  OptimizationList.size(); ++i) {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2006-06-07 Thread Reid Spencer


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.108 - 1.109
---
Log message:

For PR780: http://llvm.cs.uiuc.edu/PR780 :
1. Add #includes to LinkAllVMCore.h to get Mangler.o and InlineAsm.o
2. Make Mangler.h and InlineAsm.h use the macros to ensure linkage
3. Make each of the tools with --load options include LinkAllVMCore.h
This should be the last set of changes for this bug and 800.


---
Diffs of the changes:  (+1 -0)

 opt.cpp |1 +
 1 files changed, 1 insertion(+)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.108 llvm/tools/opt/opt.cpp:1.109
--- llvm/tools/opt/opt.cpp:1.108Fri May 12 01:33:49 2006
+++ llvm/tools/opt/opt.cpp  Wed Jun  7 18:03:13 2006
@@ -25,6 +25,7 @@
 #include llvm/Support/PluginLoader.h
 #include llvm/Support/SystemUtils.h
 #include llvm/Transforms/LinkAllPasses.h
+#include llvm/LinkAllVMCore.h
 #include fstream
 #include memory
 #include algorithm



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2006-05-12 Thread Owen Anderson


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.107 - 1.108
---
Log message:

Refactor a bunch of includes so that TargetMachine.h doesn't have to include
TargetData.h.  This should make recompiles a bit faster with my current
TargetData tinkering.


---
Diffs of the changes:  (+1 -0)

 opt.cpp |1 +
 1 files changed, 1 insertion(+)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.107 llvm/tools/opt/opt.cpp:1.108
--- llvm/tools/opt/opt.cpp:1.107Thu Apr 21 18:59:48 2005
+++ llvm/tools/opt/opt.cpp  Fri May 12 01:33:49 2006
@@ -18,6 +18,7 @@
 #include llvm/Bytecode/WriteBytecodePass.h
 #include llvm/Assembly/PrintModulePass.h
 #include llvm/Analysis/Verifier.h
+#include llvm/Target/TargetData.h
 #include llvm/Target/TargetMachine.h
 #include llvm/Support/PassNameParser.h
 #include llvm/System/Signals.h



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits