[llvm-commits] CVS: llvm/lib/Target/CBackend/CTargetMachine.h Writer.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Jun 24 19:48:50 PDT 2005



Changes in directory llvm/lib/Target/CBackend:

CTargetMachine.h updated: 1.6 -> 1.7
Writer.cpp updated: 1.240 -> 1.241
---
Log message:

Refactor the addPassesToEmitAssembly interface into a addPassesToEmitFile
interface.


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

 CTargetMachine.h |    3 ++-
 Writer.cpp       |    7 ++++---
 2 files changed, 6 insertions(+), 4 deletions(-)


Index: llvm/lib/Target/CBackend/CTargetMachine.h
diff -u llvm/lib/Target/CBackend/CTargetMachine.h:1.6 llvm/lib/Target/CBackend/CTargetMachine.h:1.7
--- llvm/lib/Target/CBackend/CTargetMachine.h:1.6	Wed Apr 20 11:05:03 2005
+++ llvm/lib/Target/CBackend/CTargetMachine.h	Fri Jun 24 21:48:36 2005
@@ -24,7 +24,8 @@
     TargetMachine("CBackend", IL, M) {}
 
   // This is the only thing that actually does anything here.
-  virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
+  virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
+                                   CodeGenFileType FileType);
 
   // This class always works, but shouldn't be the default in most cases.
   static unsigned getModuleMatchQuality(const Module &M) { return 1; }


Index: llvm/lib/Target/CBackend/Writer.cpp
diff -u llvm/lib/Target/CBackend/Writer.cpp:1.240 llvm/lib/Target/CBackend/Writer.cpp:1.241
--- llvm/lib/Target/CBackend/Writer.cpp:1.240	Wed Jun 22 16:04:42 2005
+++ llvm/lib/Target/CBackend/Writer.cpp	Fri Jun 24 21:48:36 2005
@@ -1725,7 +1725,10 @@
 //                       External Interface declaration
 //===----------------------------------------------------------------------===//
 
-bool CTargetMachine::addPassesToEmitAssembly(PassManager &PM, std::ostream &o) {
+bool CTargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &o,
+                                         CodeGenFileType FileType) {
+  if (FileType != TargetMachine::AssemblyFile) return true;
+
   PM.add(createLowerGCPass());
   PM.add(createLowerAllocationsPass(true));
   PM.add(createLowerInvokePass());
@@ -1733,5 +1736,3 @@
   PM.add(new CWriter(o, getIntrinsicLowering()));
   return false;
 }
-
-// vim: sw=2






More information about the llvm-commits mailing list