[llvm-dev] MCAsmParser end-of-function API

Ryan Taylor via llvm-dev llvm-dev at lists.llvm.org
Tue Jul 20 07:21:57 PDT 2021


David,

  Could you print out a directive/tag/comment in the AsmPrinter in
EmitFunctionBodyEnd and use that as a marker in AsmParser, as a workaround?

-Ryan

On Tue, Jul 20, 2021 at 9:15 AM David Greene via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Fangrui Song <maskray at google.com> writes:
>
> > But may I ask why you need to emit something in (MC)AsmParser?
> > AsmPrinter appears to be the more appropriate place.
>
> I am just learning the MC layer so perhaps I am indeed looking in the
> wrong place.
>
> I am thinking about the operation of llvm-mc, assembling a .s file into
> an object file.  So I guess the ELF/Object streamer is the right place
> to emit something, but it's not clear to me how it gets told we're at a
> function end.
>
> > (Most targets only need to emit alignment at function start,
> > so they don't need to care about padding at function end.)
>
> Yeah, there are a lot of assumptions in the MC layer that don't
> necessarily hold for the target I'm working on.  :) I've been able to
> work around most of them but the "pure assembler" flow is one I haven't
> figured out yet.
>
> Thanks for your help!
>
>                       -David
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210720/80cc9436/attachment.html>


More information about the llvm-dev mailing list