Commit Graph

9 Commits

Author SHA1 Message Date
Alex Hoppen
a49994d72f [Driver] Don’t crash if the output file map is incomplete
When using VS Code, it semi-frequently happens that sourcekitd is reading the output file map and the memory buffer containing the memory buffer containing the output file map is not complete and terminates at distinct powers of 2. I managed to attach a debugger once and the memory buffer containing the output file had size 0x3000 = 12288 while the actual output file map is 20319 bytes large. One hypothesis for this is that the read of output file map is racing with a write from a SwiftPM build but I haven’t been able to confirm it.

In either case, the result is that the output file map buffer ends with an unterminated string literal, which causes `getKey()` or `getValue()` in the JSON parser to return `nullptr` and then consequently hits an assertion failure in `dyn_cast`. Add a check for nullptr before invoking `dyn_cast` just like we do it in the outer `for` loop.

rdar://122364031
2024-02-21 07:09:23 -08:00
Robert Widmann
0e0825a3e8 Work Around MSVC Regression in std::less 2021-03-03 18:49:33 -08:00
Robert Widmann
0102c52d18 Remove OutputFileMap's Knowledge of Range Dependencies 2021-01-13 22:14:02 -08:00
Varun Gandhi
65577940d0 [NFC] Get rid of -Wrange-loop-analysis warnings. (#31324) 2020-04-27 09:47:52 -07:00
Ben Langmuir
9e2d7ca053 [outputfilemap] Fix another StringRef -> std::string conversion
This fix affects master-next, but it's safe to put on master.
2020-03-17 11:11:23 -07:00
David Ungar
742c3985bd Source-range-based dependencies
Frontend outputs source-as-compiled, and source-ranges file with function body ranges and ranges that were unparsed in secondaries.
Driver computes diffs for each source file. If diffs are in function bodies, only recompiles that one file. Else if diffs are in what another file did not parse, then the other file need not be rebuilt.
2019-11-12 20:41:02 -08:00
David Zarzycki
d2c5597707 [Tests] Stabilize output order maps against incidental changes
The output file map is created in DenseMap order, which is an unordered
and "unstable" collection type.
2019-03-18 07:22:23 -04:00
Jordan Rose
c89ce68359 Fix comment typo in e224e31720 (#19019) 2018-08-28 17:21:57 -07:00
Jordan Rose
e224e31720 Break almost all dependencies of Driver on Frontend
- Sink OutputFileMap{.h,.cpp} and ReferenceDependencyKeys.h to Basic
- Remove unnecessary includes of Frontend.h.
2018-08-27 20:47:58 -07:00