Commit Graph

22 Commits

Author SHA1 Message Date
Xi Ge
7bf010777e Frontend: when emitting loaded module trace file, also emit a JSON file tracking Objc method calls issued from the source code. 2024-10-24 17:19:21 -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
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
Rintaro Ishizaki
a61ed80813 [Macros] Track macro dependency separately in module trace
Macro plugins are not normal Swift modules, track them differently.
Add "swiftmacros" field to the JSON file.

rdar://118013482
2024-01-19 12:56:02 -08:00
Hamish Knight
ccd32eb452 NFC: Remove ClangModuleLoader.h include from ExtInfo.h
This was unnecessarily pulling in a whole bunch
of Clang headers when all was needed was a
forward declaration.
2023-10-09 20:29:03 +01:00
Steven Wu
da62873402 [OutputBackend] Virtualize LoadedModuleTraceFile
Virtualize LoadedModuleTraceFile output using the new appending support
in virtual output backend.
2023-07-11 13:42:29 -07:00
Rintaro Ishizaki
a551c01d6a [Macros] Track plugin dependencies
* Factor out ASTContext plugin loading to newly introduced 'PluginLoader'
* Insert 'DependencyTracker' to 'PluginLoader'
* Add dependencies right before loading the plugins

rdar://104938481
2023-04-25 10:50:32 -07:00
Rintaro Ishizaki
59f744c36a [Macros] Track loaded plugin paths in each ASTContext
PluginRegistry is now shared between multiple ASTContext. ASTContext
should track its loaded plugin library paths separately.
2023-03-27 16:55:34 -07:00
Alexis Laferrière
205a2edf38 [Sema] Intro set of import filters for general use
Calling getImportedModules requires to list the desired kind of imports.
With the new kind of imports this has become cumbersome. Let's simplify
it by offering common sets of imports. Advanced call sites can still
list the desired imports explicitly.
2023-03-17 16:05:44 -07:00
Richard Wei
c6139f2f78 [Macros] Emit loaded module trace for plugins loaded from search paths
When loading plugins from `-plugin-path`, use the global `PluginRegistry` to keep a record of what's loaded. Emit these dependencies to the loaded module trace.
2023-03-06 02:19:56 -08:00
Alexis Laferrière
6980cf211b [Serialization] Intro package-only module wide information and serialize it 2023-03-03 11:43:20 -08:00
Alexis Laferrière
4330921806 [Sema] Remove ImportFilterKind::SPIAccessControl
That filter wasn't needed in practice, we can remove it.
2023-03-03 11:42:59 -08:00
Richard Wei
4480d89536 [Macros] Emit plugin dependencies to loaded module trace. (#63367)
Emit plugins loaded with `-load-plugin-library` to loaded module trace.

Resolves rdar://102212316.
2023-02-03 09:16:14 +08:00
Doug Gregor
aa969c7ccb [Module trace] Eliminate use of report_fatal_error in non-assertions builds
This code path can have its invariants broken by catastrophic build
failures and needs to not crash.
2022-12-22 09:47:47 -08:00
Anthony Latsis
2843e0c871 Gardening: Migrate compiler sources to GitHub issues 2022-09-29 23:58:55 +03:00
Ben Barham
c676dfc2fa [rebranch] Update uses of ErrorHandling.h functions
llvm-project `ErrorHandling.h` was updated to remove std::string. This
added a new `report_fatal_error` overload taking a `const Twine &`,
removed the overload that took `const std::string &`, and updated
`fatal_error_handler_t` to use `const char *` rather than `const
std::string &`.

Fix uses of these functions to take into account these updates. Note
that without the `const std::string &` overload, passing a `std::string`
into `report_fatal_error` now results in an ambiguous match between the
`StringRef` and `Twine` overloads so we need to be explicit about one or
the other.
2021-11-13 15:33:09 +10:00
Artem Chikin
2905433c6f Emit module trace atomically.
Ensure that we only have one writer to the module trace file at a time by using LLVM's `LockFileManager` utilities, similarly to `ModuleInterfaceBuilder`

Resolves rdar://76743462
2021-10-26 14:59:12 -07:00
Evan Wilde
8112cda531 Updated F_Text and F_Append
These enum cases were also updated to OF_Text and OF_Append.
2021-06-23 14:29:52 -07:00
Robert Widmann
d946df7895 Include Incremental Dependencies in Module Trace 2021-03-02 12:52:52 -08:00
Robert Widmann
76d25e7097 [NFC] Fixup InputFile Convenience Getters
Follow programming guidelines for these getters more closely and have them return a non-owning view of the underlying data instead of relying on callers to take const references to the copy that is returned here.
2020-11-12 14:54:02 -08:00
Robert Widmann
19e6bee374 [NFC] Use the Correct const-Qualification in Dependency Code
T *const does not prevent logically non-const accesses to the underlying data, it merely indicates that the pointer value itself is const. This modifier can be cast off by a copy, so it's not generally what you want here. Switch to const T * instead.
2020-11-12 10:57:56 -08:00
Robert Widmann
17143cb9c3 [NFC] Split ModuleTrace Infrastructure out of FrontendTool 2020-11-11 14:32:44 -08:00