[LLVMdev] RFC: Could we move TargetLibraryInfo into lib/Analysis?

Chandler Carruth chandlerc at gmail.com
Wed Jan 14 11:33:11 PST 2015


On Wed, Jan 14, 2015 at 9:46 AM, Ahmed Bougacha <ahmed.bougacha at gmail.com>
wrote:

> On Wed, Jan 14, 2015 at 12:03 PM, Chandler Carruth <chandlerc at gmail.com>
> wrote:
> > While this is target information, it isn't actually part of the target
> today
> > and doesn't use any part of the target code. Maybe some day we can use a
> > target hook to initialize the data structures, but even then I feel like
> > this really belongs in the core analysis library.
>
> So I'm curious: do you have an idea of where better to put this
> hypothetical hook? Since it's mostly OS-dependent, it doesn't seem
> very fit for the way we do targets.
>

No idea at all, and I completely agree with you.

Ultimately, I think the word "target" here is misleading. It means target
in the since of a cross compilation target, but it has little to no
relevance to LLVM targets. As you mention, it is an OS and runtime library
availability issue.

Anyways, we don't need a hook today, and if we do at some point in the
future we can figure out how to add one.


>
> > Would there be any objections to just moving it into Analysis?
> >
> > Doing this would remove a seriously ugly layering violation we have
> today. I
> > believe this would remove the last dependency on lib/Target by
> lib/Analysis
> > and the largest set of dependencies on lib/Target by lib/Transforms.
> >
> > If there is general agreement, I will make it so.
>
> FWIW I agree, on all counts.


Awesome. Will make it so. (Especially now that the release is branched.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150114/b180a1da/attachment.html>


More information about the llvm-dev mailing list