Commit Graph

14 Commits

Author SHA1 Message Date
Ben Langmuir
0a0571ae12 Revert "Update LocalizationFormat to use diagnosticIDStringFor"
The depenedency on libAST this introduced is causing build time
regressions.

This reverts commit ea86221d41.
2021-05-19 11:00:05 -07:00
Ben Langmuir
006e78e672 Merge pull request #37320 from fwcd/sourcekit-diagnostic-ids
[SourceKit] Add id and category to diagnostics
2021-05-17 14:25:40 -07:00
Hassan
481b29b6ca [Localization] Delay loading localization
- Add `LocalizationProducerState` to manage the states of LocalizationProducers.
- Add `initializeImpl` and `initializeIfNeeded` to manage lazily initialization of `LocalizationProducer`s.
- Move constructing a localization producer from DiagEngine to `LocalizationProrducer` itself.
2021-05-14 01:28:55 +02:00
fwcd
ea86221d41 Update LocalizationFormat to use diagnosticIDStringFor 2021-05-11 19:06:50 +02:00
Pavel Yaskevich
2cc25baf37 [Localization] Add a couple of missing imports
Import `Path.h` and `FileSystem.h` directly since they are the source
of `llvm::sys::path::extension` and `llvm::system::fs::OpenFlags`
respectively.

Resolves: rdar://77277253
2021-04-28 15:25:58 -07:00
Hassan
09b794d002 [Localization] Correct namings and improve comment 2021-03-23 22:39:35 +02:00
Hassan
8665e0cb55 [Localization] Move localization allocator from DiagEngine to the localization producer 2021-03-23 10:41:54 +02:00
Hassan
d4ae82628b [Localization] Assert if printDiagnosticNames is true; the StringSaver is also present 2021-03-21 21:00:53 +02:00
Hassan
ef7551d4f5 [Localization] Add an allocator to to retain diagnostic strings 2021-03-17 10:23:02 +02:00
Hassan
651655e3db [Localization] Allocate a copy of diagnostic + name strings in LocalizationProducer 2021-03-14 17:38:34 +02:00
Hassan
1b0e8f9cec [Localization] Make localization producer handle printing diagnostics IDs 2021-03-14 17:38:34 +02:00
Pavel Yaskevich
c7a15e108c [Localization] Simplify localization producer interface
Require producers to implement `getMessage(DiagID)` and
establish default implementation of `getMessageOr`, so
producers don't have to worry about handling fallback if
translation is unavailable.
2020-09-16 11:47:07 -07:00
Pavel Yaskevich
5d11fe6b62 [Localization] Extract def-to-yaml conversion logic into DefToYAMLConverter to ease testing 2020-09-03 16:33:23 -07:00
Saleem Abdulrasool
fe0a945898 AST: split out diagnostics serialization
Create a new diagnostics serialization library, splitting out of
swiftAST to reduce the overheads for building the tooling for
cross-compiling the toolchain.  This should reduce the build time for
swift-serialize-diagnostics to enable cross-compilation.
2020-08-24 09:21:55 -07:00