[LLVMdev] MCStreamer itnerface

Nathan Jeffords blunted2night at gmail.com
Tue May 4 11:03:58 PDT 2010


This is a brain-dump of my thoughts on the MCStreamer interface
after several
days of digging around trying to get a COFF writer working.

All fragments should be associated with a symbol. For assembler components,
a
unnammed "virtual" symbol can be used when there is no explicit label
defined.

Section assignment should be the responsiblity of the object imlementing the
MCStreamer interface, with the caller givin the ability to give hints as to
what section to place the symbol into.

instead of SwitchSection, there would be BeginSymbol, and SymbolSymbol, it
would
be illegal to call any EmitXXX function outside of these two calls

BeginSymbol(Symbol, SectionHint)
  EmitAttribute(...)
  EmitAttribute(...)
  ...
StartFragmentEmission()
  EmitFragment(...)
  EmitFragment(...)
  ...
EndSymbol()

Object file writers would typically start recording fragments and attributes
for
a symbol on the BeginSymbol, then at EndSymbol they would evaluate what was
streamed, and decide what section the symbol should be placed in.

Assembly writers could with some state data emit assemble as emission calls
are
made. Assembler parsers could use 'section symbols' to provide section level
attributes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100504/5cedc774/attachment.html>


More information about the llvm-dev mailing list