[cfe-dev] cfe-dev Digest, Vol 45, Issue 19
Argyrios Kyrtzidis
kyrtzidis at apple.com
Wed Apr 13 11:18:14 PDT 2011
Hi Matthieu, I really like your suggestions for improving diagnostics!
On Mar 19, 2011, at 11:12 AM, Matthieu Monrocq wrote:
>
> 2. I have added an Index to map the name of the diagnostic back to the ID. For efficient search this index is sorted... on first use. I could not find a way to get the TableGen backend to sort it by itself because the diagnostics are splitted over multiple files. Because it is sorted only on first use, I don't expect any impact (apart from the memory it takes) during a regular run, since it should only be invoked through the help menu. Also, even if sorting is "relatively" expensive (< 2k elements), since it's for the help, I guess it does not matter too much.
.td files can include other .td files. You could add a new .td file aggregating all the diagnostics so you can have TableGen produce the necessary sorted arrays.
>
> I just have one little issue: what if I don't find it ? At the moment I hijacked diag::DIAG_UPPER_LIMIT for signaling an invalid name. Is this correct ?
>
> I was also thinking that we could probably propose a fuzzy match for a best effort search, in case we didn't locate the name, because users may make a typo when invoking the help.
Proposing a match if one was not found is a good idea.
> I would suggest adding a boolean parameter to indicate whether the call wishes for this extended search or not. Thoughts ?
Why not always propose a match ?
>
> 3. I have had some troubles extracting names from the IDs. Most IDs are well-behaved and begin by `fatal_`, `err_`, `ext_`, `warn_` or `note_` but there's a couple that do not (beginning by `error_` or embedding the `warn` in the middle of the string or just not indicating anything of the sort). For those, I simply print the whole ID as the name, however I'd like to provide a clean-up (separate) patch to "standardize" them.
Please "standardize" them.
-Argiris
More information about the cfe-dev
mailing list