]> granicus.if.org Git - llvm/commitdiff
Keep track of the current BasicBlock being processed so that a referencing
authorMisha Brukman <brukman+llvm@gmail.com>
Tue, 27 May 2003 22:41:44 +0000 (22:41 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Tue, 27 May 2003 22:41:44 +0000 (22:41 +0000)
MachineInstr can later be patched up correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6378 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/SparcV9CodeEmitter.cpp
lib/Target/SparcV9/SparcV9CodeEmitter.h

index 1985da221a45ebed4636d4557eb15a2e697bd14f..47043d80b153dbd2f13620a675209ef688e2b0b0 100644 (file)
@@ -30,8 +30,7 @@ int64_t SparcV9CodeEmitter::getMachineOpValue(MachineOperand &MO) {
   } 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 @@ bool SparcV9CodeEmitter::runOnMachineFunction(MachineFunction &MF) {
 }
 
 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);
index ea1c8790eeacdf69bde372353206f7deb83ed48b..e6f6cde4359968c07129dea133307c83720b953a 100644 (file)
@@ -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) {}