[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

Nick Kledzik kledzik at apple.com
Wed Mar 28 17:07:11 PDT 2012


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.

-Nick




More information about the llvm-commits mailing list