Commit Graph

3 Commits

Author SHA1 Message Date
Alexis Laferrière
1bc7a8ea7c [ClangImporter] Keep using the buffer start address as map key
rdar://71497407
2021-01-07 15:00:34 -08:00
Brent Royal-Gordon
dde1209026 Update SourceBufferImporter to avoid getBuffer()
This was recently removed from clang in https://reviews.llvm.org/D89427. Fixes rdar://70771582.
2020-10-29 12:22:57 -07:00
Jordan Rose
e364552876 [ClangImporter] Pull buffer importing out of ClangDiagnosticConsumer
Emitting Swift diagnostics in Clang buffers requires making those
buffers valid places to put Swift SourceLocs, which means making a
mirror of those buffers in the Swift SourceManager. This isn't a copy;
instead, any Clang SourceManagers that are involved are kept alive
until the importer is torn down. (There might be more than one because
of diagnostics emitted during module building.)

For a long time we only emitted diagnostics in Clang buffers if the
diagnostics came from Clang, but then we added another case for custom
Swift names that fail to import. I'm about to add another such
diagnostic, so let's formalize this buffer mapping first.

No intended functionality change.
2019-10-28 22:08:26 -07:00