[llvm-commits] CVS: llvm/tools/lli/JIT/Emitter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Jan 29 12:03:00 PST 2003
Changes in directory llvm/tools/lli/JIT:
Emitter.cpp updated: 1.2 -> 1.3
---
Log message:
Fix warnings on sparc
---
Diffs of the changes:
Index: llvm/tools/lli/JIT/Emitter.cpp
diff -u llvm/tools/lli/JIT/Emitter.cpp:1.2 llvm/tools/lli/JIT/Emitter.cpp:1.3
--- llvm/tools/lli/JIT/Emitter.cpp:1.2 Sun Jan 12 19:00:12 2003
+++ llvm/tools/lli/JIT/Emitter.cpp Wed Jan 29 12:02:02 2003
@@ -69,14 +69,15 @@
for (unsigned i = 0, e = BBRefs.size(); i != e; ++i) {
unsigned Location = BBLocations[BBRefs[i].first];
unsigned *Ref = BBRefs[i].second;
- *Ref = Location-(unsigned)Ref-4;
+ *Ref = Location-(unsigned)(intptr_t)Ref-4;
}
BBRefs.clear();
BBLocations.clear();
NumBytes += CurByte-CurBlock;
- DEBUG(std::cerr << "Finished CodeGen of [0x" << std::hex << (unsigned)CurBlock
+ DEBUG(std::cerr << "Finished CodeGen of [0x" << std::hex
+ << (unsigned)(intptr_t)CurBlock
<< std::dec << "] Function: " << F.getFunction()->getName()
<< ": " << CurByte-CurBlock << " bytes of text\n");
}
@@ -95,7 +96,7 @@
void Emitter::startBasicBlock(MachineBasicBlock &BB) {
- BBLocations[BB.getBasicBlock()] = (unsigned)CurByte;
+ BBLocations[BB.getBasicBlock()] = (unsigned)(intptr_t)CurByte;
}
@@ -121,7 +122,7 @@
//
void Emitter::emitAddress(void *Addr, bool isPCRelative) {
if (isPCRelative) {
- *(unsigned*)CurByte = (unsigned)Addr - (unsigned)CurByte-4;
+ *(intptr_t*)CurByte = (intptr_t)Addr - (intptr_t)CurByte-4;
} else {
*(void**)CurByte = Addr;
}
More information about the llvm-commits
mailing list