Page MenuHomePhabricator

Break dependency from Core to ObjectFileJIT
ClosedPublic

Authored by zturner on May 22 2018, 2:12 PM.

Details

Summary

This was responsible for the cycle Core > ObjectFile > Core.

The only reason this dependency was here was so that Module could have a function called CreateJITModule which created things in a special order. Instead of making this specific to creating a jit module, I turn this into a function that can create a module for any type of object file plugin and forwards the arguments through. Since it is not instantiated in Core, the linker (and header file) dependency moves to the point where it is instantiated, which only happens in Expression. Conceptually, this location also happens to make more sense for a dependency on ObjectFileJIT. After all, we JIT expressions so it's no surprise that Expression needs to make use of ObjectFileJIT.

This change reduces the distinct cycle count from 38 to 37

Diff Detail

Repository
rL LLVM

Event Timeline

zturner created this revision.May 22 2018, 2:12 PM
labath accepted this revision.May 23 2018, 1:34 AM

The change sounds reasonable to me. I should just point out that this is the Core <-> ObjectFileJIT cycle you are breaking.

lldb/include/lldb/Core/Module.h
165 ↗(On Diff #148100)

std::forward<Args>(args)...

lldb/source/Expression/IRExecutionUnit.cpp
35–36 ↗(On Diff #148100)

#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h" should work here

This revision is now accepted and ready to land.May 23 2018, 1:34 AM
This revision was automatically updated to reflect the committed changes.