Commit Graph

53 Commits

Author SHA1 Message Date
swift-ci
ae278ae961 Merge remote-tracking branch 'origin/master' into master-next 2019-10-30 14:50:00 -07:00
Owen Voorhees
8a6711769e [Diagnostics] Refactor DiagnosticConsumer interface
DiagnosticInfo now holds all the information needed to consume
a diagnostic, so remove unneeded parameters from handleDiagnostic.
2019-10-29 13:52:12 -07:00
swift-ci
6945d6192d Merge remote-tracking branch 'origin/master' into master-next 2019-09-26 09:29:43 -07:00
Jordan Rose
8ff1dac381 [AST] Break some header dependencies for faster rebuilds (#27374)
DiagnosticEngine.h no longer depends on Attr.h.
Expr.h no longer depends on TypeRepr.h.

No functionality change.
2019-09-26 09:17:10 -07:00
swift-ci
f513cc9fe8 Merge remote-tracking branch 'origin/master' into master-next 2019-09-05 18:09:59 -07:00
Owen Voorhees
68e6065c8e [Diagnostics][NFC] Introduce Structured fix-its
These are defined with macros like errors/warnings/notes, and
make use of format strings and diagnostic arguments. The intent
is to leverage diagnostic arguments in the future to disambiguate
ambiguously spelled types.

Ported a few miscellaneous fix-its to the new system
2019-09-05 10:43:25 -07:00
Jonas Devlieghere
b4d268e9e1 Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances in the swift repo.
2019-08-15 11:32:39 -07:00
Saleem Abdulrasool
731c31f9a5 MSVC: litter the code with llvm_unreachable (NFC)
Add `llvm_unreachable` to mark covered switches which MSVC does not
analyze correctly and believes that there exists a path through the
function without a return value.
2019-06-01 19:02:46 -07:00
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