[LLVMdev] Function-at-a-time Processing

David A. Greene greened at obbligato.org
Wed Jul 28 16:11:19 PDT 2010

David Greene <dag at cray.com> writes:

> Perhaps there is a better way of doing this that's officially supported.
> Is this model of function processing supported at all?  If not, has
> anyone thought about how we might support it?  I think this is a model
> that is not all that uncommon so I would hope we could figure out a
> reasonable solution.

After looking at the implementations for opt and llc, I think I can make
this work.  Apparently there is much better separation of concerns (asm
vs. dwarf generation, for example) that makes this a bit easier than
before.  In 2.5, the AsmPrinter made all sorts of assumptions about
dwarf information being available, which required some trickery for
module-level doInitialization and doFinalization, which is what led to
the separate module-/function-level asm printers.

Now it appears that with 2.7 I can go back to a single asm printer and
just invoke it on each function as I get them.  This seems to work on a
small set of testcases.

So it appears my troubles were in trying to adapt a hack for 2.5 to 2.7
when we don't need the hack at all.


More information about the llvm-dev mailing list