[llvm-dev] TargetMachine vs LLVMTargetMachine

Matthias Braun via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 2 20:57:41 PDT 2017


The distinction between the LLVMTargetMachine and TargetMachine classes has become somewhat muddy recently. So I created:

https://reviews.llvm.org/D38482

to clean things up. During review it was noted that we may rather merge the two instead which looks like this:

https://reviews.llvm.org/D38489 <https://reviews.llvm.org/D38489>

We really should choose one of the two over the status quo. Some points for the discussion:

- I am not aware of any target that is actually implementing TargetMachine only but not LLVMTargetMachine (I assume the C backend used to do it before it was removed)
- Even when merging the two, I believe it is still possible to implement a target without linking to lib/CodeGen by returning nullptr for the various methods related to CodeGen.
- The split would give some notion of an internal CodeGen interface and an external interface visible to frontend/middleend etc.
- The code gets simpler when merging the two and we have to document/explain less.

- Matthias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171002/7435e622/attachment.html>


More information about the llvm-dev mailing list