[llvm-dev] clang/llvm support for %= in inline assembly

Andrew Kelley via llvm-dev llvm-dev at lists.llvm.org
Sun Feb 5 08:19:25 PST 2017


On Sun, Feb 5, 2017 at 8:05 AM, Dimitry Andric <dimitry at andric.com> wrote:

> Appending %= to the label name only works if you append at least one ':'
> to the asm statement, otherwise it isn't seen as a so-called "assembler
> template", apparently:


Aha, ok, perfect, this results in LLVM IR:

  tail call void asm sideeffect "named_label_${:uid}:\0Ajnz
named_label_${:uid}\0A", "~{dirflag},~{fpsr},~{flags}"() #2, !dbg !20,
!srcloc !25

So LLVM IR does in fact already support it, and my use case is solved.
However, it is undocumented in http://llvm.org/docs/LangRef.html. Might be
night to add there for future developers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170205/0d552db0/attachment.html>


More information about the llvm-dev mailing list