[cfe-dev] Warning options table
Chris Lattner
clattner at apple.com
Tue Mar 3 18:02:40 PST 2009
On Mar 3, 2009, at 5:53 PM, Ted Kremenek wrote:
>>> 2) But more importantly, I simply think that separate files, the
>>> way we
>>> have them now, are the better choice. So we have a SemaDiag.td, a
>>> LexDiag.td, etc.
>>
>>
>> For that, it is probably best to just have:
>>
>> let Library = "sema" in {
>>
>> at the top of each per-library file, and } at the end.
>>
>> -Chris
>
> Does having separate per-library files pose issues with implementing
> -Wall? That is, to implement -Wall, or any other option whose
> warnings might cross several libraries, don't we need the ability
> to potentially know about all the warnings across Clang? I think
> that was the original motivation to put all the warnings in one
> TableGen file.
We want each library to put its diags in separate .td files with a
"let" wrapping them, then we want one file that pulls in everything:
Diagnostics.td:
include "SemaDiags.td"
include "ParserDiags.td"
...
The tblgen backend should be invoked once for each library with the
full set of input, and only emit the diags corresponding to each
invocation. e.g,
tblgen Diagnostics.td -emit-clang-diags-info -clang-diags-library=Sema
-o Sema.inc
tblgen Diagnostics.td -emit-clang-diags-info -clang-diags-
library=Parser -o Parser.inc
...
-Chris
More information about the cfe-dev
mailing list