Skip to content

Commit f977a9f

Browse files
committed
Assorted return value/argument type/include change for LLVM 21
1 parent adc34fa commit f977a9f

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

src/debuginfo.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,13 @@ static int lookup_pointer(
505505
else {
506506
int havelock = jl_lock_profile_wr();
507507
assert(havelock); (void)havelock;
508-
info = context->getLineInfoForAddress(makeAddress(Section, pointer + slide), infoSpec);
508+
auto lineinfo = context->getLineInfoForAddress(makeAddress(Section, pointer + slide), infoSpec);
509509
jl_unlock_profile_wr();
510+
#if JL_LLVM_VERSION < 210000
511+
info = std::move(lineinfo);
512+
#else
513+
info = std::move(lineinfo.value());
514+
#endif
510515
}
511516

512517
jl_frame_t *frame = &(*frames)[i];

src/disasm.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,11 @@ static void jl_dump_asm_internal(
924924
// LLVM will destroy the formatted stream, and we keep the raw stream.
925925
std::unique_ptr<formatted_raw_ostream> ustream(new formatted_raw_ostream(rstream));
926926
std::unique_ptr<MCStreamer> Streamer(
927-
#if JL_LLVM_VERSION >= 190000
927+
#if JL_LLVM_VERSION >= 210000
928+
TheTarget->createAsmStreamer(Ctx, std::move(ustream),
929+
930+
std::move(IP), std::move(CE), std::move(MAB))
931+
#elif JL_LLVM_VERSION >= 190000
928932
TheTarget->createAsmStreamer(Ctx, std::move(ustream),
929933

930934
IP.release(), std::move(CE), std::move(MAB))
@@ -1268,8 +1272,8 @@ jl_value_t *jl_dump_function_asm_impl(jl_llvmf_dump_t* dump, char emit_mc, const
12681272
OutputAsmDialect = 0;
12691273
if (!strcmp(asm_variant, "intel"))
12701274
OutputAsmDialect = 1;
1271-
MCInstPrinter *InstPrinter = TM->getTarget().createMCInstPrinter(
1272-
jl_ExecutionEngine->getTargetTriple(), OutputAsmDialect, MAI, MII, MRI);
1275+
std::unique_ptr<MCInstPrinter> InstPrinter(TM->getTarget().createMCInstPrinter(
1276+
jl_ExecutionEngine->getTargetTriple(), OutputAsmDialect, MAI, MII, MRI));
12731277
std::unique_ptr<MCAsmBackend> MAB(TM->getTarget().createMCAsmBackend(
12741278
STI, MRI, Options));
12751279
std::unique_ptr<MCCodeEmitter> MCE;
@@ -1278,8 +1282,10 @@ jl_value_t *jl_dump_function_asm_impl(jl_llvmf_dump_t* dump, char emit_mc, const
12781282
}
12791283
auto FOut = std::make_unique<formatted_raw_ostream>(asmfile);
12801284
std::unique_ptr<MCStreamer> S(TM->getTarget().createAsmStreamer(
1281-
#if JL_LLVM_VERSION >= 190000
1282-
*Context, std::move(FOut), InstPrinter, std::move(MCE), std::move(MAB)
1285+
#if JL_LLVM_VERSION >= 210000
1286+
*Context, std::move(FOut), std::move(InstPrinter), std::move(MCE), std::move(MAB)
1287+
#elif JL_LLVM_VERSION >= 190000
1288+
*Context, std::move(FOut), InstPrinter.release(), std::move(MCE), std::move(MAB)
12831289
#else
12841290
*Context, std::move(FOut), true, true, InstPrinter, std::move(MCE),
12851291
std::move(MAB), false

src/jitlayers.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
#include <llvm/ExecutionEngine/Orc/CompileUtils.h>
1515
#include <llvm/ExecutionEngine/Orc/ExecutionUtils.h>
1616
#include <llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h>
17+
#if JL_LLVM_VERSION >= 210000
18+
# include <llvm/ExecutionEngine/Orc/SelfExecutorProcessControl.h>
19+
#endif
1720
#include <llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h>
1821
#if JL_LLVM_VERSION >= 200000
1922
#include <llvm/ExecutionEngine/Orc/AbsoluteSymbols.h>
@@ -1936,7 +1939,8 @@ JuliaOJIT::JuliaOJIT()
19361939
MemMgr(createRTDyldMemoryManager()),
19371940
UnlockedObjectLayer(
19381941
ES,
1939-
[this]() {
1942+
[this](auto&&...) {
1943+
// LLVM 21+ passes in a memory buffer
19401944
std::unique_ptr<RuntimeDyld::MemoryManager> result(new ForwardingMemoryManager(MemMgr));
19411945
return result;
19421946
}

0 commit comments

Comments
 (0)