[llvm-commits] CVS: llvm/lib/Target/Sparc/SparcV9CodeEmitter.h SparcV9CodeEmitter.cpp
Misha Brukman
brukman at cs.uiuc.edu
Tue May 27 17:42:01 PDT 2003
Changes in directory llvm/lib/Target/Sparc:
SparcV9CodeEmitter.h updated: 1.1 -> 1.2
SparcV9CodeEmitter.cpp updated: 1.2 -> 1.3
---
Log message:
Keep track of the current BasicBlock being processed so that a referencing
MachineInstr can later be patched up correctly.
---
Diffs of the changes:
Index: llvm/lib/Target/Sparc/SparcV9CodeEmitter.h
diff -u llvm/lib/Target/Sparc/SparcV9CodeEmitter.h:1.1 llvm/lib/Target/Sparc/SparcV9CodeEmitter.h:1.2
--- llvm/lib/Target/Sparc/SparcV9CodeEmitter.h:1.1 Tue May 27 16:45:05 2003
+++ llvm/lib/Target/Sparc/SparcV9CodeEmitter.h Tue May 27 17:41:44 2003
@@ -3,12 +3,14 @@
#ifndef SPARCV9CODEEMITTER_H
#define SPARCV9CODEEMITTER_H
+#include "llvm/BasicBlock.h"
#include "llvm/CodeGen/MachineCodeEmitter.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
class SparcV9CodeEmitter : public MachineFunctionPass {
MachineCodeEmitter &MCE;
+ BasicBlock *BB;
public:
SparcV9CodeEmitter(MachineCodeEmitter &M) : MCE(M) {}
Index: llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp
diff -u llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp:1.2 llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp:1.3
--- llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp:1.2 Tue May 27 16:45:05 2003
+++ llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp Tue May 27 17:41:44 2003
@@ -30,8 +30,7 @@
} else if (MO.isImmediate()) {
return MO.getImmedValue();
} else if (MO.isPCRelativeDisp()) {
- // FIXME!!!
- //return MO.getPCRelativeDisp();
+ MCE->saveBBreference(currBB, MO);
return 0;
} else {
assert(0 && "Unknown type of MachineOperand");
@@ -55,6 +54,7 @@
}
void SparcV9CodeEmitter::emitBasicBlock(MachineBasicBlock &MBB) {
+ currBB = MBB.getBasicBlock();
MCE.startBasicBlock(MBB);
for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I)
emitInstruction(**I);
More information about the llvm-commits
mailing list