[llvm-commits] [llvm] r64907 - /llvm/branches/Apple/Dib/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
Bill Wendling
isanbard at gmail.com
Wed Feb 18 00:32:18 PST 2009
Author: void
Date: Wed Feb 18 02:32:17 2009
New Revision: 64907
URL: http://llvm.org/viewvc/llvm-project?rev=64907&view=rev
Log:
Merge r64600 into Dib:
On 64bit we may have a personality function which requires 64 bits to
be encoded.
Modified:
llvm/branches/Apple/Dib/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
Modified: llvm/branches/Apple/Dib/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp?rev=64907&r1=64906&r2=64907&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp Wed Feb 18 02:32:17 2009
@@ -519,14 +519,20 @@
MCE->emitByte(RI->getDwarfRegNum(RI->getRARegister(), true));
if (Personality) {
- MCE->emitULEB128Bytes(7);
+ // Augmentation Size: 3 small ULEBs of one byte each, and the personality
+ // function which size is PointerSize.
+ MCE->emitULEB128Bytes(3 + PointerSize);
- // Direct encoding, because we use the function pointer. Not relative,
- // because the current PC value may be bigger than the personality
- // function pointer.
- MCE->emitByte(dwarf::DW_EH_PE_sdata4);
-
- MCE->emitInt32(((intptr_t)Jit.getPointerToGlobal(Personality)));
+ // We set the encoding of the personality as direct encoding because we use
+ // the function pointer. The encoding is not relative because the current
+ // PC value may be bigger than the personality function pointer.
+ if (PointerSize == 4) {
+ MCE->emitByte(dwarf::DW_EH_PE_sdata4);
+ MCE->emitInt32(((intptr_t)Jit.getPointerToGlobal(Personality)));
+ } else {
+ MCE->emitByte(dwarf::DW_EH_PE_sdata8);
+ MCE->emitInt64(((intptr_t)Jit.getPointerToGlobal(Personality)));
+ }
MCE->emitULEB128Bytes(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
MCE->emitULEB128Bytes(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
More information about the llvm-commits
mailing list