[PATCH] D149522: [JITLink] Add target features to LinkGraph

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 16:16:21 PDT 2023

lhames added a comment.

In D149522#4318568 <https://reviews.llvm.org/D149522#4318568>, @jobnoorman wrote:

> In D149522#4318006 <https://reviews.llvm.org/D149522#4318006>, @lhames wrote:
>> Yeah -- we definitely want to avoid the dependence on MC. One of the aims of ORC development over the next year or so is going to be splitting the library up so that ORC core depends only on libObject (and eventually, only on format-specific object file parsing libraries, but we don't have those yet. :) )
> That makes sense. Unfortunately, it isn't as easy to avoid as I thought. The problem is that to get the features from an object file, we have to call `ObjectFile::getFeatures` which returns a `SubtargetFeatures` and we have to call one of its methods to convert it to a `std::vector<std::string>`. So I don't immediately see a way around the `MC` dependency.
> On a related note: I wonder //why// `SubtargetFeatures` is part of `MC` and not of, say, `TargetParser` (like `Triple`).

Huh. That's a really good question. Maybe we can do this by moving `SubtargetFeatures`?

If we can't do that (or want a short term solution) then we should use `std::vector<std::string>` on the `LinkGraph` and hide the MC dependency in the implementation code. That'll make it easier to fix later without breaking clients.

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list