[PATCH] D67774: [Mangle] Add flag to asm labels to disable '\01' prefixing
Aaron Ballman via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 7 12:02:46 PST 2020
On Tue, Jan 7, 2020 at 2:57 PM John McCall via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
>
> On Tue, Jan 7, 2020 at 1:44 PM Aaron Ballman via Phabricator
> <reviews at reviews.llvm.org> wrote:
> > aaron.ballman added inline comments.
> >
> >
> > ================
> > Comment at: cfe/trunk/lib/AST/Mangle.cpp:127
> > + // do not add a "\01" prefix.
> > + if (!ALA->getIsLiteralLabel() || ALA->getLabel().startswith("llvm.")) {
> > + Out << ALA->getLabel();
> > ----------------
> > Sorry to dredge up an old review, but I recently ran into a bug in this area and am not certain of how to fix it. What should happen if the asm label is a literal which is empty?
>
> The problems here are unique to empty labels, right?
To the best of my knowledge, yes.
> Can we just
> diagnose this as an error?
I don't think so -- GCC's function attribute documentation seems to
suggest you should do this with noinline functions (see the docs for
noinline here https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes)
> Is this bug occurring with real code, or
> is LLDB constructing something bizarre?
It was a c-reduced test case that we found when doing AST dumping to
JSON, so I think the code was probably real at one point. Our reduced
test case wound up as:
void a() __asm__("");
void a();
with clang -cc1 -ast-dump=json causing a failed assertion in LLVM's
mangler (called from Clang's mangler).
~Aaron
>
> John.
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
More information about the llvm-commits
mailing list