[llvm-commits] [llvm] r54987 - /llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Tue Aug 19 07:48:45 PDT 2008
Author: geoffray
Date: Tue Aug 19 09:48:14 2008
New Revision: 54987
URL: http://llvm.org/viewvc/llvm-project?rev=54987&view=rev
Log:
Update the JIT exception writer to better mimic the codegen exception writer.
Also skip indirect encoding for platforms that ask for one: we direclty
write an address, not a pointer to the address.
Modified:
llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp?rev=54987&r1=54986&r2=54987&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp Tue Aug 19 09:48:14 2008
@@ -66,7 +66,8 @@
unsigned PointerSize = TD->getPointerSize();
int stackGrowth = stackGrowthDirection == TargetFrameInfo::StackGrowsUp ?
PointerSize : -PointerSize;
- bool IsLocal = BaseLabelPtr;
+ bool IsLocal = false;
+ unsigned BaseLabelID = 0;
for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
const MachineMove &Move = Moves[i];
@@ -86,7 +87,7 @@
const MachineLocation &Src = Move.getSource();
// Advance row if new location.
- if (BaseLabelPtr && LabelID && (BaseLabelPtr != LabelPtr || !IsLocal)) {
+ if (BaseLabelPtr && LabelID && (BaseLabelID != LabelID || !IsLocal)) {
MCE->emitByte(dwarf::DW_CFA_advance_loc4);
if (PointerSize == 8) {
MCE->emitInt64(LabelPtr - BaseLabelPtr);
@@ -94,6 +95,7 @@
MCE->emitInt32(LabelPtr - BaseLabelPtr);
}
+ BaseLabelID = LabelID;
BaseLabelPtr = LabelPtr;
IsLocal = true;
}
@@ -541,12 +543,9 @@
if (Personality) {
MCE->emitULEB128Bytes(7);
- if (needsIndirectEncoding)
- MCE->emitByte(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4 |
- dwarf::DW_EH_PE_indirect);
- else
- MCE->emitByte(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
-
+ // Direct encoding, because we use the function pointer.
+ MCE->emitByte(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
+
if (PointerSize == 8)
MCE->emitInt64((intptr_t)Jit.getPointerToGlobal(Personality) -
MCE->getCurrentPCValue());
@@ -554,12 +553,12 @@
MCE->emitInt32((intptr_t)Jit.getPointerToGlobal(Personality) -
MCE->getCurrentPCValue());
- MCE->emitULEB128Bytes(dwarf::DW_EH_PE_pcrel);
- MCE->emitULEB128Bytes(dwarf::DW_EH_PE_pcrel);
+ MCE->emitULEB128Bytes(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
+ MCE->emitULEB128Bytes(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
} else {
MCE->emitULEB128Bytes(1);
- MCE->emitULEB128Bytes(dwarf::DW_EH_PE_pcrel);
+ MCE->emitULEB128Bytes(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
}
std::vector<MachineMove> Moves;
More information about the llvm-commits
mailing list