[LLVMdev] MCStreamer itnerface

Nathan Jeffords blunted2night at gmail.com
Tue May 4 12:53:50 PDT 2010


I should probably elaborate on why I feel the interface should be as such.

It seems to be the common case is compiler outputting to object files. In
this case, all fragments are associated with symbols. What section the
fragments go into is generally irrelevant to the compiler, except in special
cases like global variable constructor/destructor lists and the like.

At code generation time, the compiler would for all normal symbols,
not specify any grouping information, and allow the streamer to make
decisions about where to place data based of the content. For special
scenarios, like constructor/destructor a set of hints could be defined to
produce the expected behavior.

i.e.
struct SectionHint {};

// used by assemblers to put symbols into the
// section specified by a section directive
struct NamedSectionHint : SectionHint {
  // then name of the section to put the symbol in
  std::string Name;
};


struct OrderedNamedHint : NamedSection {
  // the order to place the symbol into the section when finally linked,
  // each different "ordered section" should produce a separate section
  // in the object file
  // positive means put in ascending order before any other sections with
the same name
  //  1 if first, 2 is second, and so on
  // negative means put in descending order after any other sections with
the same name
  // -1 is last, -2 is second to last, and so on
  int Order;
};

Any NamedHints would show up in between positive & negative named hints with
the same name.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100504/697efeb6/attachment.html>


More information about the llvm-dev mailing list