Skip to content

Commit

Permalink
Favour setOpaquePointers over flags when jit-compiling routines
Browse files Browse the repository at this point in the history
Command-line flags somehow proved flaky, switching to the explicit
API seems to ensure consistent behaviour.
  • Loading branch information
antoniofrighetto committed Dec 4, 2024
1 parent 6d8db3b commit 579b8b5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/passes/string-encoding/StringEncoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,17 +569,16 @@ void StringEncoding::genRoutines(const Triple &TargetTriple, EncodingInfo &EI,
(Twine("extern \"C\" {\n") + Routines[Idx] + "}\n").str();

{
EI.HM = ExitOnErr(
generateModule(Routine, HostTriple, "cpp", HostJIT->getContext(),
{"-std=c++17", "-mllvm", "--opaque-pointers"}));
EI.HM = ExitOnErr(generateModule(Routine, HostTriple, "cpp",
HostJIT->getContext(), {"-std=c++17"}));
}

{
Ctx.setDiscardValueNames(false);
Ctx.setOpaquePointers(true);
EI.TM = ExitOnErr(
generateModule(Routine, TargetTriple, "cpp", Ctx,
{"-target", TargetTriple.getTriple(), "-std=c++17",
"-mllvm", "--opaque-pointers"}));
{"-target", TargetTriple.getTriple(), "-std=c++17"}));
annotateRoutine(*EI.TM);
}
}
Expand Down

0 comments on commit 579b8b5

Please sign in to comment.