diff options
author | Lang Hames <lhames@gmail.com> | 2022-01-05 17:00:06 +1100 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2022-01-06 13:48:12 +1100 |
commit | 133f86e95492b2a00b944e070878424cfa73f87c (patch) | |
tree | 0a4c362d62f68957247c1a7f4d2a78aa039168c9 /llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp | |
parent | 9e2cfb061a8821236944b3c8f40641846ab6bc94 (diff) | |
download | llvm-133f86e95492b2a00b944e070878424cfa73f87c.zip llvm-133f86e95492b2a00b944e070878424cfa73f87c.tar.gz llvm-133f86e95492b2a00b944e070878424cfa73f87c.tar.bz2 |
[JITLink] Update JITLink to use ExecutorAddr rather than JITTargetAddress.
ExecutorAddr is the preferred representation for executor process addresses now.
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp index f427271..7a71d2f 100644 --- a/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp +++ b/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp @@ -410,7 +410,7 @@ Error addFunctionPointerRelocationsToCurrentSymbol(jitlink::Symbol &Sym, while (I < Content.size()) { MCInst Instr; uint64_t InstrSize = 0; - uint64_t InstrStart = SymAddress + I; + uint64_t InstrStart = SymAddress.getValue() + I; auto DecodeStatus = Disassembler.getInstruction( Instr, InstrSize, Content.drop_front(I), InstrStart, CommentStream); if (DecodeStatus != MCDisassembler::Success) { @@ -426,7 +426,7 @@ Error addFunctionPointerRelocationsToCurrentSymbol(jitlink::Symbol &Sym, // Check for a PC-relative address equal to the symbol itself. auto PCRelAddr = MIA.evaluateMemoryOperandAddress(Instr, &STI, InstrStart, InstrSize); - if (!PCRelAddr.hasValue() || PCRelAddr.getValue() != SymAddress) + if (!PCRelAddr || *PCRelAddr != SymAddress.getValue()) continue; auto RelocOffInInstr = @@ -438,8 +438,8 @@ Error addFunctionPointerRelocationsToCurrentSymbol(jitlink::Symbol &Sym, continue; } - auto RelocOffInBlock = - InstrStart + *RelocOffInInstr - SymAddress + Sym.getOffset(); + auto RelocOffInBlock = orc::ExecutorAddr(InstrStart) + *RelocOffInInstr - + SymAddress + Sym.getOffset(); if (ExistingRelocations.contains(RelocOffInBlock)) continue; |