[cfe-dev] Inline Asm Warnings in Clang

Renato Golin renato.golin at linaro.org
Sun May 31 12:05:37 PDT 2015


Clang folks,

I had a read around the reporting code in Clang and I have to say I'm
a bit lost...

In ARMAsmParser, we have warnings:

    if (ARMMCRegisterClasses[ARM::GPRRegClassID].contains(Reg))
        Warning(RegLoc, "register list not in ascending order");

When using inline asm, clang has the -Wno-inline-asm, which disables
those warnings. But when compiling assmebly files directly, that -W
directive doesn't work (intentionally).

I'd like to create a new -W flag, -Wasm-directives or something, which
will warn on architecture changing directives misuse.

DiagnosticsSemaKinds.td seems to have a large list of inline asm
warnings, but I need to use the Diag.Warn(..., ID) so that it can
suppress if the ID is disabled. Meanwhile, inside the ARMAsmParser,
the Warning function doesn't have an ID to suppress. So, even if I
create such a warning flag in Clang, how do I make it work inside the
assembly parser?

cheers,
--renato



More information about the cfe-dev mailing list