[PATCH] MC: Allow targets to stop symbol name quoting

Matt Arsenault Matthew.Arsenault at amd.com
Thu Apr 23 10:53:50 PDT 2015


On 04/23/2015 08:24 AM, Rafael Ávila de Espíndola wrote:
> This needs a testcase.
I don't know how to test this without a target to do it on. This is part 
of the prerequisite patches to start upstreaming the HSAIL target

>
> This function is used to print assembly. You have an assembler that can handle any characters in the name? How?
No, but it also does not accept quoted symbols to avoid them. There is 
currently a suboptimal pass that handles a subset of the character 
restrictions HSAIL has which renames globals and replaces the disallowed 
characters with something else.

The real problem with this is that the characters used for different 
kinds of symbol prefixes (% and &) are rejected, causing the disallowed 
quotes to be added. The character rules are unlike other assembly 
targets and needs to be specially handled in some way, so I need a way 
to avoid assumptions about the allowed characters like this.


>
>
> ================
> Comment at: include/llvm/MC/MCSymbol.h:58
> @@ -57,1 +57,3 @@
>   
> +    /// True if the name should be quoted if "unacceptable" characters are used
> +    /// in the name.
> ----------------
> The comment is flipped, no?
I wasn't sure if I should invert this to make the true case enable 
quoting. Would it be better to change this all to UseSymbolNameQuoting 
or something like that?




More information about the llvm-commits mailing list