[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp AlphaJITInfo.cpp AlphaJITInfo.h
Evan Cheng
evan.cheng at apple.com
Thu Jul 27 11:20:31 PDT 2006
Changes in directory llvm/lib/Target/Alpha:
AlphaCodeEmitter.cpp updated: 1.16 -> 1.17
AlphaJITInfo.cpp updated: 1.10 -> 1.11
AlphaJITInfo.h updated: 1.2 -> 1.3
---
Log message:
Resolve BB references with relocation.
---
Diffs of the changes: (+3 -20)
AlphaCodeEmitter.cpp | 5 +++--
AlphaJITInfo.cpp | 16 ----------------
AlphaJITInfo.h | 2 --
3 files changed, 3 insertions(+), 20 deletions(-)
Index: llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp
diff -u llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:1.16 llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:1.17
--- llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:1.16 Tue Jul 25 15:40:54 2006
+++ llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp Thu Jul 27 13:20:17 2006
@@ -215,8 +215,9 @@
Reloc, MO.getConstantPoolIndex(),
Offset));
} else if (MO.isMachineBasicBlock()) {
- TM.getJITInfo()->addBBRef(MO.getMachineBasicBlock(),
- MCE.getCurrentPCValue());
+ MCE.addRelocation(MachineRelocation::getBB(MCE.getCurrentPCOffset(),
+ Alpha::reloc_bsr,
+ MO.getMachineBasicBlock()));
}else {
std::cerr << "ERROR: Unknown type of MachineOperand: " << MO << "\n";
abort();
Index: llvm/lib/Target/Alpha/AlphaJITInfo.cpp
diff -u llvm/lib/Target/Alpha/AlphaJITInfo.cpp:1.10 llvm/lib/Target/Alpha/AlphaJITInfo.cpp:1.11
--- llvm/lib/Target/Alpha/AlphaJITInfo.cpp:1.10 Tue Jul 25 15:40:54 2006
+++ llvm/lib/Target/Alpha/AlphaJITInfo.cpp Thu Jul 27 13:20:17 2006
@@ -304,19 +304,3 @@
}
}
}
-
-void AlphaJITInfo::resolveBBRefs(MachineCodeEmitter &MCE) {
- // Resolve all forward branches now...
- for (unsigned i = 0, e = BBRefs.size(); i != e; ++i) {
- unsigned* Location =
- (unsigned*)MCE.getMachineBasicBlockAddress(BBRefs[i].first);
- unsigned* Ref = (unsigned*)BBRefs[i].second;
- intptr_t BranchTargetDisp =
- (((unsigned char*)Location - (unsigned char*)Ref) >> 2) - 1;
- DEBUG(std::cerr << "Fixup @ " << (void*)Ref << " to " << (void*)Location
- << " Disp " << BranchTargetDisp
- << " using " << (BranchTargetDisp & ((1 << 22)-1)) << "\n");
- *Ref |= (BranchTargetDisp & ((1 << 21)-1));
- }
- BBRefs.clear();
-}
Index: llvm/lib/Target/Alpha/AlphaJITInfo.h
diff -u llvm/lib/Target/Alpha/AlphaJITInfo.h:1.2 llvm/lib/Target/Alpha/AlphaJITInfo.h:1.3
--- llvm/lib/Target/Alpha/AlphaJITInfo.h:1.2 Tue Jul 25 15:40:54 2006
+++ llvm/lib/Target/Alpha/AlphaJITInfo.h Thu Jul 27 13:20:17 2006
@@ -46,8 +46,6 @@
/// code.
///
virtual void replaceMachineCodeForFunction(void *Old, void *New);
-
- virtual void resolveBBRefs(MachineCodeEmitter &MCE);
private:
static const unsigned GOToffset = 4096;
More information about the llvm-commits
mailing list