Commit Graph

26 Commits

Author SHA1 Message Date
Ben Barham
a7b50f357f Merge remote-tracking branch 'origin/main' into manual-main-merge
Conflicts:
  - `lib/Driver/ToolChains.cpp` conflicting with the `addAllArgs` rename
    for multiple options
2024-09-16 13:53:18 -07:00
Dmitrii Galimzianov
a8b71ea97f Add -print-diagnostic-groups flag
This change adds the `-print-diagnostic-groups` flag as described by SE-0443.
2024-09-11 13:34:42 +02:00
Dmitrii Galimzianov
28883b6654 [Diagnostics] Add -[no-]warning-as-error flags for precise control over warning behavior
This commit adds new compiler options -no-warning-as-error/-warning-as-error which allows users to specify behavior for exact warnings and warning groups.
2024-09-07 01:14:43 +02:00
Xi Ge
736ccef626 Merge remote-tracking branch 'apple/main' into rebranch 2024-06-20 15:16:55 -07:00
Tim Kientzle
1d961ba22d Add #include "swift/Basic/Assertions.h" to a lot of source files
Although I don't plan to bring over new assertions wholesale
into the current qualification branch, it's entirely possible
that various minor changes in main will use the new assertions;
having this basic support in the release branch will simplify that.
(This is why I'm adding the includes as a separate pass from
rewriting the individual assertions)
2024-06-05 19:37:30 -07:00
Ben Barham
cacfd3e3ae Rename llvm::support::endianness to llvm::endianness
LLVM is gearing up to move to `std::endianness` and as part of that has
moved `llvm::support::endianness` to `llvm::endianness`
(bbdbcd83e6702f314d147a680247058a899ba261). Rename our uses.
2024-04-08 08:58:58 -07:00
Ben Barham
9779c18da3 Rename startswith to starts_with
LLVM is presumably moving towards `std::string_view` -
`StringRef::startswith` is deprecated on tip. `SmallString::startswith`
was just renamed there (maybe with some small deprecation inbetween, but
if so, we've missed it).

The `SmallString::startswith` references were moved to
`.str().starts_with()`, rather than adding the `starts_with` on
`stable/20230725` as we only had a few of them. Open to switching that
over if anyone feels strongly though.
2024-03-13 22:25:47 -07:00
Ben Barham
ef8825bfe6 Migrate llvm::Optional to std::optional
LLVM has removed llvm::Optional, move over to std::optional. Also
clang-format to fix up all the renamed #includes.
2024-02-21 11:20:06 -08:00
Pavel Yaskevich
10b609caec [Localization] Remove YAML format and tool 2022-08-22 10:53:51 -07:00
Pavel Yaskevich
7c416ee122 [Localization] Implement .def to .strings converter
Format is as follows:

- Comment: /* ... */
- Diagnostic: "<id>" = "<translation>";
2022-08-22 09:22:18 -07:00
Josh Soref
94f2ea6747 spelling: diagnostic
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-01 04:32:23 -04:00
Evan Wilde
0aafd09835 F_None was renamed OF_None
This patch updates usages of F_None to OF_None, as LLVM changed that in
commit 3302af9d4c39642bebe64dd60a3aa162fefc44b2.
2021-06-23 10:36:39 -07:00
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