[llvm] r181466 - Pull up AssemblyWriter interface into header to allow subclassing

Malea, Daniel daniel.malea at intel.com
Thu May 23 15:38:54 PDT 2013


OK cool, I agree that not subclassing AssemblyWriter is a much cleaner
approach, and does not penalize other clients of that class with virtual
function calls.

Thanks for the hint about AssemblyAnnotationWriter; I was able to use that
interface to meet my requirements without having to add another hook. I
also took the header out of the public API.

Committed in 182617.


Thanks again for keeping an eye on this stuff,
Dan

On 2013-05-22 12:57 AM, "Chris Lattner" <clattner at apple.com> wrote:

>
>On May 21, 2013, at 1:03 PM, "Malea, Daniel" <daniel.malea at intel.com>
>wrote:
>
>> Is it making the functions virtual that's worrisome, or are you
>> uncomfortable with exposing the AssemblyWriter interface at all? This
>> commit makes all the AssemblyWriter::print* functions virtual to keep
>>the
>> interface consistent.
>
>My primary objection is making AssemblyWriter public.  Virtually
>everything in it is an internal implementation detail.  It should not be
>public.
>
>> Really though, DebugIR's implementation only needs to "hook into"
>> printInstructionLine() and printInstruction(), in order to:
>
>A thin interface along the lines of
>llvm/Assembly/AssemblyAnnotationWriter.h (which I'm also not a huge fan
>of) is much preferable to making all of AssemblyWriter public.
>
>-Chris
>





More information about the llvm-commits mailing list