[LLVMdev] sub-classing MCObjectStreamer?

Mario Guerra mariog at codeaurora.org
Wed Dec 5 16:42:31 PST 2012


> I need to sub-class MCObjectStreamer to account for some of our
target-specific
> requirements, and it wasn't apparent to me how to register my version
after
> reviewing and stepping through code.  How do I wire up LLVM to use my sub-
> classed implementation instead of the default?

Okay, after more careful scrutiny of the code I see that MCObjectStreamer is
intended to be very generic and it would actually be MCELFStreamer that I
would need to subclass. I see from a search through the dev list that this
was discussed previously and discouraged, so I'll provide more context. 

We are working on integrated and stand-alone assemblers for a VLIW target
(Hexagon) and need to apply, among other things, instruction ordering rules
on a per-packet basis.  We could handle this in the lowering phase, but the
standalone assembly parser goes straight to MC and bypasses the lowering
pass altogether. This means we need to be able to work with packets in the
streamer. 

We could easily address this by subclassing the streamer, but this seems to
be discouraged as far as I can tell. Can we subclass MCELFStreamer to suit
our needs, or are there other ways to handle this case? 

Thanks,
- --
Mario Guerra
mariog at codeaurora.org
Qualcomm Innovation Center Inc is a member of Code Aurora Forum, hosted by
The Linux Foundation




More information about the llvm-dev mailing list