Skip to content

Commit

Permalink
Allow inspecting LLVM code during imaging mode (JuliaLang#36974)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Aug 11, 2020
1 parent cf82c19 commit d5429f8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/aotcompile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,11 @@ void *jl_get_llvmf_defn(jl_method_instance_t *mi, size_t world, char getwrapper,
Function *F = NULL;
if (m) {
// if compilation succeeded, prepare to return the result
// For imaging mode, global constants are currently private without initializer
// which isn't legal. Convert them to extern linkage so that the code can compile
// and will better match what's actually in sysimg.
for (auto &global : output.globals)
global.second->setLinkage(GlobalValue::ExternalLinkage);
if (optimize)
PM->run(*m.get());
const std::string *fname;
Expand Down

0 comments on commit d5429f8

Please sign in to comment.