[llvm-commits] [PATCH] PR889: devirtualize Value::printCustom

Chandler Carruth chandlerc at google.com
Mon Nov 14 01:53:37 PST 2011


On Mon, Nov 14, 2011 at 1:45 AM, Jay Foad <jay.foad at gmail.com> wrote:

> http://llvm.org/bugs/show_bug.cgi?id=889
>
> As a small step towards the goal of PR889 "Eliminate Virtual Methods
> In VMCore To Make Value Objects Smaller", this patch eliminates the
> virtual method Value::printCustom.
>
> As I mentioned in the PR, this is complicated because we don't want to
> introduce a library dependency from AsmWriter (which is in LLVMCore)
> to PseudoSourceValue (which is in LLVMCodeGen). The approach I took is
> to refactor PseudoSourceValue a bit so that the printCustom method is
> trivial, and can be moved out of the .cpp file and into an inline
> function in the .h file.
>

I don't think this is an acceptable way to approach this. You're still
adding a dependency on CodeGen to VMCore. You've just wrapped it up into a
header file dependency instead of a link-time dependency. I think this is
likely to make our already troublesome layering story significantly worse.
VMCore should not know of or need anything CodeGen. If this routine does,
there is some deeper design issue that needs to be resolved.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111114/97edafd8/attachment.html>


More information about the llvm-commits mailing list