[RFC] Inline assembler warnings for architecture directives

Renato Golin renato.golin at linaro.org
Fri May 29 09:00:05 PDT 2015


Eric / Saleem,

The simple patch attached works out for two of the three cases I'm trying to do:

 1. Multiple uses of .cpu/.fpu/.arch directives in asm files and inline asm;
 2. Use of those directives after code has been emitted in asm files;

But it doesn't cover the third case:

 3. Use of those directives at all in inline assembly.

There is a warning flag -Winline-asm which is enabled by default, and
supporessing it (via -Wno-inline-asm) does stop warning (1) above, but
I haven't figured out yet how. Warning uses PrintMessage with a type
DK_Warning, but nothing stopping it from being printed. The code is a
bit confusing.

My aim is to:

* Let -Winline-asm enabled by default, and warn (1) and (3) in inline
asm unless disabled.
* Add a new warning -W???, disabled by default, enabled by
-Weverything or -Wextra, that will turn on (1) and (2) in asm files.

I'll have to do that on the ARMAsmParser level, since anything more
generic won't know the difference between 1, 2 and 3.

Any ideas on how to get the warnings visible at that level?

cheers,
--renato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asmwarn.patch
Type: text/x-patch
Size: 5717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150529/1df8a358/attachment.bin>


More information about the cfe-commits mailing list