Commit Graph

45 Commits

Author SHA1 Message Date
David Ungar
aa0687a816 Typo and handle recursive RAII case. 2019-04-05 11:14:27 -07:00
David Ungar
cba4ae831e Better comment. 2019-04-04 15:47:22 -07:00
David Ungar
7428feef72 Format 2019-04-03 16:21:20 -07:00
David Ungar
d0330523d0 suppress non-primary errors if there is no responsible primary 2019-04-03 16:19:45 -07:00
David Ungar
44daa88ebd Format 2019-04-03 12:53:31 -07:00
David Ungar
9cc3a4a9d8 Rename defaultDiagnosticLoc to bufferIndirectlyCausingDiagnostic. 2019-04-03 12:52:49 -07:00
David Ungar
fd63a1ea73 Change strategy for non-primaries
No more vacuous subconsumers. Output into active primary or everywhere.
2019-04-03 11:38:58 -07:00
David Ungar
7ac4592419 Rm ForAnyKind 2019-04-03 11:01:57 -07:00
David Ungar
b112f73780 Typos 2019-04-02 22:52:14 -07:00
David Ungar
0baa668920 Format 2019-04-02 22:28:38 -07:00
David Ungar
c139c5909a Pass defaultDiagnosticLoc to handleDiagnostic, not currentPrimaryInput. 2019-04-02 22:27:55 -07:00
David Ungar
3b8b903807 Refactor handleDiagnostic 2019-04-02 21:41:40 -07:00
David Ungar
c90d9e69b6 Format 2019-04-02 00:43:59 -07:00
David Ungar
7a0e0ffc8a Store current primary in diagnostic engine, pass it down via handleDiagnostic. Unformmated. 2019-04-02 00:43:28 -07:00
Graydon Hoare
d4e6479f88 Add a new ForwardingDiagnosticConsumer type. 2018-11-13 13:24:22 -08:00
David Ungar
7e19f7829b consumerAndRangeForLocation -> subconsumerForLocation 2018-08-06 18:00:17 -07:00
David Ungar
11c1f0f01e Format 2018-08-03 22:49:09 -07:00
David Ungar
cd3c82d9e2 Addressing comments. 2018-08-03 22:48:13 -07:00
David Ungar
1af9741dc7 format 2018-08-03 09:11:09 -07:00
David Ungar
cb3af7c0d4 factoring and commenting 2018-08-03 09:10:43 -07:00
David Ungar
b4b3b0fcec ConsumerSpecificInformation points to the subconsumer & factor some code into the substructures. 2018-08-02 21:59:48 -07:00
David Ungar
dc952441a0 Format 2018-08-02 21:15:21 -07:00
David Ungar
67c8d9c357 Make Subconsumer into a class. 2018-08-02 21:14:49 -07:00
David Ungar
01582a2fe3 Rename ConsumerPair -> Subconsumer 2018-08-02 20:44:01 -07:00
Jordan Rose
cefb0b62ba Replace old DEBUG macro with new LLVM_DEBUG
...using a sed command provided by Vedant:

$ find . -name \*.cpp -print -exec sed -i "" -E "s/ DEBUG\(/ LLVM_DEBUG(/g" {} \;
2018-07-20 14:37:26 -07:00
David Ungar
20d099d4ce Remove now-unneeded argument from finishProcessing. 2018-06-12 16:37:04 -07:00
David Ungar
372f8ce8b0 Truncate serialized dia files instead of non-specific error. 2018-06-12 16:26:50 -07:00
David Ungar
74898f552e Rename info to consumerInfo to be less confusable with Info in procedNonSpecificError. 2018-05-15 12:48:21 -07:00
David Ungar
e0ed336d67 Adjust the error text. 2018-05-14 09:14:36 -07:00
David Ungar
f9e9a735dc Set the locations of the errors. 2018-05-14 08:35:53 -07:00
David Ungar
c315bddd07 Zeroing in… 2018-05-13 22:16:23 -07:00
David Ungar
5206ce0a31 FIx functionality & address other concerns. 2018-05-13 18:49:53 -07:00
David Ungar
b4dce8222f Track errors 2018-05-12 20:54:19 -07:00
David Ungar
524d88e921 Pass SM in finishProcessing 2018-05-12 19:40:09 -07:00
David Ungar
8baef6abd5 WIP backup 2018-05-11 17:28:39 -07:00
David Ungar
70aecfef36 Emit error diagnostic for a primary if all errors suppressed 2018-05-11 15:14:42 -07:00
David Ungar
aaf51f7853 Addressing review comments. 2018-05-10 10:38:09 -07:00
David Ungar
c5b82b8b94 Cleanup 2018-05-09 19:41:49 -07:00
David Ungar
1e66ee6e28 Another null-pointer fix. 2018-05-09 19:32:34 -07:00
David Ungar
4f003b41de Check for null pointer in finishProcessing. 2018-05-09 18:51:46 -07:00
David Ungar
02fcbf7226 optional pointer to consumer replaces NullDiagnosticConsumer placeholder 2018-05-09 18:09:40 -07:00
Graydon Hoare
689663d2e2 [BatchMode] Fix interaction of bridging PCH and file specific diag consumer.
In batch mode, when using serialized diagnostics, we have a
FileSpecificDiagnosticConsumer splitting diags out to separate .dia files (one
per primary). This constructs a mapping from filenames to consumers when it's
first given a diag. So far so good.

It assumes, however, that there are source buffers to be found for each input
file it knows the name of. This is true -- and useful to assert -- once the
source buffers are set up. It's also a prerequisite for building the map it
uses to direct diags.

Unfortunately there's a small window between the consumer being built and the
source manager getting buffers, and in this window we attach to a bridging PCH.
If that attaching generates a diag of itself (say due to a bogus module map or
such) then the diag consumer is asked to build its map without source buffers.
The thing to do here is just to fall back to the "no mapping found" case; the
only tricky part is identifying when we're in that window of time. I've chosen
to use the approximating condition of "none of the file buffers exist at all".
2018-03-23 20:22:53 -07:00
Jordan Rose
57087c4af3 RangeSpecificDiagnosticConsumer -> FileSpecificDiagnosticConsumer
It turns out that we need to have the diagnostic consumers set up
before we've actually opened the input files, which makes sense
because we might want to emit diagnostics about not being able to open
an input file. Switch to using file names instead, and mapping those
over to source ranges only once we actually need to handle a
diagnostic with a valid source location.
2018-03-02 13:23:16 -08:00
Jordan Rose
51fa9332d8 Add a RangeSpecificDiagnosticConsumer
If a top-level diagnostic is in a particular source range, the
RangeSpecificDiagnosticConsumer will funnel it and any attached notes
to a particular "sub-consumer" designated for that range (intended to
be used with whole files). If it's not in a range designated for any
sub-consumer, the diagnostic is passed to all registered
sub-consumers.

This is intended to be used for batch mode, so that diagnostics that
are definitely associated with a particular file can be emitted in
that file's .dia output, while diagnostics that may be associated with
other files (such as those that come from Clang) will still get
presented to the user.
2018-03-02 13:23:15 -08:00
Maxwell Swadling
93d485e4f7 Changed handleDiagnostic to take a format string and format args instead of the formatted string
This allows diagnostic consumers to modify the way formatting of diagnostics is performed.
rdar://problem/31305854
2017-04-14 11:28:04 -07:00