<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><br>
</p>
<div class="moz-cite-prefix">On 10/02/2017 10:57 PM, Matthias Braun
via llvm-dev wrote:<br>
</div>
<blockquote
cite="mid:B997C4A9-0CD9-4D7F-9511-B297DADC86CC@apple.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
The distinction between the LLVMTargetMachine and TargetMachine
classes has become somewhat muddy recently. So I created:
<div class=""><br class="">
</div>
<div class=""><a moz-do-not-send="true"
href="https://reviews.llvm.org/D38482" class="">https://reviews.llvm.org/D38482</a></div>
<div class=""><br class="">
</div>
<div class="">to clean things up. During review it was noted that
we may rather merge the two instead which looks like this:</div>
<div class=""><br class="">
</div>
<div class=""><a moz-do-not-send="true"
href="https://reviews.llvm.org/D38489" class="">https://reviews.llvm.org/D38489</a></div>
<div class=""><br class="">
</div>
<div class="">We really should choose one of the two over the
status quo. Some points for the discussion:</div>
<div class=""><br class="">
</div>
<div class="">- 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)</div>
<div class="">- 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.</div>
</blockquote>
<br>
If this is true, then it seems like we don't lose anything from
doing this (and the code gets cleaner). We don't currently have
anything in tree that motivates the current split. It does seem
useful to retain the ability to have a direct-from-the-IR backend
(mostly for translation into another IR).<br>
<br>
-Hal<br>
<br>
<blockquote
cite="mid:B997C4A9-0CD9-4D7F-9511-B297DADC86CC@apple.com"
type="cite">
<div class="">- The split would give some notion of an internal
CodeGen interface and an external interface visible to
frontend/middleend etc.</div>
<div class="">- The code gets simpler when merging the two and we
have to document/explain less.</div>
<div class=""><br class="">
</div>
<div class="">- Matthias</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</body>
</html>