[llvm-commits] [lld] r153589 - in /lld/trunk: include/lld/Core/Pass.h include/lld/Core/Platform.h include/lld/Platform/Platform.h lib/Passes/GOTPass.cpp lib/Passes/StubsPass.cpp tools/lld-core/lld-core.cpp

Chandler Carruth chandlerc at google.com
Wed Mar 28 17:09:24 PDT 2012


On Wed, Mar 28, 2012 at 5:07 PM, Nick Kledzik <kledzik at apple.com> wrote:

>
> On Mar 28, 2012, at 4:57 PM, Michael Spencer wrote:
>
> > On Wed, Mar 28, 2012 at 4:37 PM, Chandler Carruth <chandlerc at google.com>
> wrote:
> >> On Wed, Mar 28, 2012 at 11:49 AM, Michael J. Spencer <
> bigcheesegs at gmail.com>
> >> wrote:
> >>>
> >>> Move Platform.h to Core as Core depends on Platform.h, and the Platform
> >>> library depends on Core. This breaks that cycle.
> >>
> >>
> >> Really? It sounds like it papers over the cycle. I suspect Core should
> not
> >> depend on Platform.h if the Platform library depends on Core.
> >
> > I agree that it's weird. It's used by the Resolver and SymbolTable. I
> > suppose these should be split out of Core.
>
> A Platform is an abstract interface.  It is a higher level concept than
> what is going on in Core.    The interfaces for Core should not depend on
> Platform (other than it being a forward declared class).  On the other
> hand, the implementation of Core does need a Platform object at runtime to
> resolve things in platform specific ways.  But that is ok, because in
> practice the only thing that instantiates a Resolver is a top level linker
> which can also instantiate an Platform.


This sounds like you do actually need the complete *abstract* interface for
Platform to be inside of Core. Notably, this will likely require you to
provide the virtual destructor for the class in a Core source file to get
links to be completely correct and without cycles.

See my other email, it may just be a naming oddity of libraries vs.
interfaces.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120328/19db2a59/attachment.html>


More information about the llvm-commits mailing list