[LLVMdev] MCAsmStreamer implementation

Sergei Larin slarin at codeaurora.org
Thu Mar 29 08:09:51 PDT 2012


Hello everyone, 

  I have a design choice question about MCAsmStreamer. Recently I found
myself in need to override a single method from it (EmitCommonSymbol) for
Hexagon backend while leaving all other functionality intact. I was
surprised to realize that I had to create a whole new class
HexagonMCAsmStreamer public MCStreamer which is 99% duplicate of
MCAsmStreamer.
  My question is - what was the reason for designing the MCAsmStreamer the
way it is? Why could it not be made "derivable" for targets? I could see
that PTX had to do it the same way, and maybe they had a good reason to
override multiple methods, but I see no justification in my case for
creating duplicate code base of that complexity and size.
  If there is no compelling reason for the current implementation, I would
be more than happy to provide a patch.

Thanks.

Sergei Larin

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum.






More information about the llvm-dev mailing list