[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue May 2 11:27:41 PDT 2006



Changes in directory llvm/lib/Target/Alpha:

AlphaCodeEmitter.cpp updated: 1.9 -> 1.10
---
Log message:

Refactor the machine code emitter interface to pull the pointers for the current
code emission location into the base class, instead of being in the derived classes.

This change means that low-level methods like emitByte/emitWord now are no longer
virtual (yaay for speed), and we now have a framework to support growable code 
segments.  This implements feature request #1 of PR469: http://llvm.cs.uiuc.edu/PR469 .


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

 AlphaCodeEmitter.cpp |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)


Index: llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp
diff -u llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:1.9 llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:1.10
--- llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:1.9	Sun Jan 22 17:37:17 2006
+++ llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp	Tue May  2 13:27:26 2006
@@ -80,11 +80,15 @@
 bool AlphaCodeEmitter::runOnMachineFunction(MachineFunction &MF) {
   II = ((AlphaTargetMachine&)MF.getTarget()).getInstrInfo();
 
-  MCE.startFunction(MF);
-  MCE.emitConstantPool(MF.getConstantPool());
-  for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I)
-    emitBasicBlock(*I);
-  MCE.finishFunction(MF);
+  do {
+    BBRefs.clear();
+    BasicBlockAddrs.clear();
+    
+    MCE.startFunction(MF);
+    MCE.emitConstantPool(MF.getConstantPool());
+    for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I)
+      emitBasicBlock(*I);
+  } while (MCE.finishFunction(MF));
 
   // Resolve all forward branches now...
   for (unsigned i = 0, e = BBRefs.size(); i != e; ++i) {






More information about the llvm-commits mailing list