Commit Graph

6639 Commits

Author SHA1 Message Date
Andrew Rogers
48cd587866 PR feedback: add Process.readRawString to get byte count in GetStringLengthFunction 2024-12-04 11:35:12 -08:00
Andrew Rogers
5a277d499d PR feedback: short-circuit return on readArray of 0 items 2024-12-04 11:23:32 -08:00
Andrew Rogers
671db08c1d PR feedback: use precondition in place of assert 2024-12-04 11:19:54 -08:00
Andrew Rogers
3b0e5bb160 consistent use of /proc 2024-12-04 11:19:25 -08:00
Andrew Rogers
9e5f0ca9cd PR feedback: update copyright to 2024 2024-12-04 11:00:37 -08:00
Andrew Rogers
aa6bfabf60 PR feedback: fix typo in README.md 2024-12-04 10:59:19 -08:00
Andrew Rogers
31460f63b8 specify -Xlinker instead of -Xswiftc in README.md 2024-12-03 20:01:14 -08:00
Andrew Rogers
6dc7c3265d address some code review comments 2024-12-03 17:15:02 -08:00
Andrew Rogers
4906ed9c36 [linux] define _GNU_SOURCE for process_vm_readv 2024-12-03 15:53:05 -08:00
Andrew Rogers
59d39a1c7d [linux] exclude dump-array support 2024-12-03 14:47:16 -08:00
Andrew Rogers
049af2e0e0 [linux] add Linux build instructions to README.txt 2024-12-03 14:47:16 -08:00
Andrew Rogers
2ee5d15886 [linux] swift-inspect support for Linux 2024-12-03 14:47:16 -08:00
Kuba (Brecka) Mracek
8792efedf0 Merge pull request #77115 from kubamracek/embedded-mangling-prefix
[Mangling] [NFC] Prepare for a new mangling prefix for Embedded Swift: $e
2024-12-03 08:10:49 -08:00
Kuba Mracek
e527e8f307 [embedded] Teach swift-demangle about prefix, add test 2024-12-02 15:01:24 -08:00
Kuba Mracek
9c77074cac [Mangling] Establish a new mangling prefix for Embedded Swift: $e 2024-12-02 15:01:24 -08:00
Kuba Mracek
6f4ae28520 [ASTMangler] Pass ASTContext to all instantiations of ASTMangler 2024-12-02 15:01:04 -08:00
Allan Shortlidge
e131682e19 Merge pull request #77886 from tshortli/consolidate-availability-queries-on-decl
AST: Consolidate queries for `@available` attributes on `Decl`
2024-12-02 14:21:45 -08:00
Allan Shortlidge
c5398e17d3 AST: Introduce Decl::getDeprecatedAttr().
It replaces `DeclAttr::getDeprecated()` as the designated way to query for the
attribute that makes a decl deprecated.
2024-12-02 07:35:58 -08:00
Allan Shortlidge
2358712870 AST/Sema: Remove DeclAttr::isUnavailable().
Update callers to use `Decl::isUnavailable()` instead.
2024-12-02 07:35:58 -08:00
Allan Shortlidge
1dc7aa5b7b AST: Introduce Decl::isUnavailable().
Replace calls to `AvailableAttr::isUnavailable()` with `Decl::isUnavailable()`.
2024-12-02 07:35:58 -08:00
Saleem Abdulrasool
57afdab2f6 tools: use LibXml2::LibXml2 to link against
Adjust the build rules to use the `LibXml2::LibXml2` target rather
than use the explicit include paths and link flags. This allows us to
track additional dependencies (implicit linked libraries) as well as
properly propagate the include paths and library search paths.
2024-11-26 13:18:14 -08:00
Allan Shortlidge
ad7383499b Merge pull request #77758 from tshortli/available-attr-conveniences
AST: `AvailableAttr` cleanup
2024-11-21 13:03:07 -08:00
Hamish Knight
23e3f5f5de Merge pull request #77666 from hamishknight/lets-try-this-again
[AST] Remove `ModuleDecl::addFile`
2024-11-21 20:15:58 +00:00
Allan Shortlidge
36230cd9c6 AST: Use an accessor to get the PlatformKind from an AvailableAttr. 2024-11-21 09:10:36 -08:00
Saleem Abdulrasool
bb3d3a59a7 Merge pull request #77724 from compnerd/inspection
swift-inspect: add initial CMake based build system
2024-11-20 21:14:23 -08:00
Saleem Abdulrasool
22a014b484 swift-inspect: add initial CMake based build system
This addition will allow us to cross-compile swift-inspect to Windows
ARM64. Enabling the Windows ARM64 build permits the toolchain to become
more similar across the architectures.
2024-11-19 15:41:52 -08:00
Saleem Abdulrasool
87b3d51c70 swift-inspect: remove obsolete workaround
`-fno-split-cold-code` should no longer be needed after
llvm/llvm-project#99759. Remove the use of unsafe flags.
2024-11-19 12:20:43 -08:00
Hamish Knight
4946c799af [AST] Remove ModuleDecl::addFile
Rather than exposing an `addFile` member on
ModuleDecl, have the `create` members take a
lambda that populates the files for the module.
Once module construction has finished, the files
are immutable.
2024-11-17 14:17:20 +00:00
Hamish Knight
309c02410b [IDE] Avoid relying on after-the-fact use of addFile
We shouldn't be attempting to append SourceFiles
to the module after-the-fact for syntactic macro
expansion, refactor things such that the SourceFile
is created alongside the ModuleDecl.
2024-11-17 14:17:20 +00:00
Doug Gregor
24a12ebc34 Renable GeneratedSourceInfo::Attribute to GeneratedSourceInfo::AttributeFromClang 2024-11-15 09:02:49 -08:00
Artem Chikin
201edb83f6 Merge pull request #77606 from artemcm/MoveLibSwiftScanOutOfTools
[CMake] Establish a dependency from standard library variants onto 'libSwiftScan'
2024-11-14 12:31:12 -08:00
Artem Chikin
338b9141e3 Move libSwiftScan from 'tools' to 'lib/Tooling'
'tools' should be reserved for executable tools.
2024-11-14 08:44:32 -08:00
Doug Gregor
989c73d014 Ensure that buffers containing Clang swift_attr attributes are parsed as attributes
Previously, they were being parsed as top-level code, which would cause
errors because there are no definitions. Introduce a new
GeneratedSourceInfo kind to mark the purpose of these buffers so the
parser can handle them appropriately.
2024-11-13 21:19:37 -08:00
Steven Wu
47b3efdb6e [Macro] Add a new macro loading option that do not involve searching
Add flag `-load-resolved-plugin` to load macro plugin, which provides a
pre-resolved entry into PluginLoader so the plugins can be loaded based
on module name without searching the file system. The option is mainly
intended to be used by explicitly module build and the flag is supplied
by dependency scanner.
2024-10-31 10:56:21 -07:00
Hamish Knight
499fe6dc48 Merge pull request #77072 from hamishknight/complete-options
[IDE] Pass LangOptions to `ide::isSourceInputComplete`
2024-10-30 20:17:47 +00:00
swift-ci
f94276ddb2 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-22 15:04:38 -07:00
Mike Ash
37dc7d5c66 [swift-inspect] Force forkCorpse if VMUProcInfo advises it.
Various processes, such as launchd, are unsafe to inspect directly. Inspecting them pauses them and the system does not like it when they're paused. Forking a corpse avoids this, as the original process continues running while we inspect the forked corpse.

VMUProcInfo provides a shouldAnalyzeWithCorpse call which tells us whether we're inspecting one of those processes. When we are, then we force the forkCorpse option even when it's not specified.

Add shims to Symbolication+Extensions.swift to allow calls to VMUProcInfo and use it to force forkCorpse when appropriate.

rdar://124720793
2024-10-22 12:27:11 -04:00
swift-ci
e4ff9e578e Merge remote-tracking branch 'origin/main' into rebranch 2024-10-21 11:26:28 -07:00
Ben Barham
6b3cc32328 [CursorInfo] Take a copy of USR when resolving cursor info
Resolving cursor info is async and can occur after the request has been
deleted, make sure to take a copy of the `USR` (which is part of that
request).

Resolves rdar://137320169.
2024-10-18 16:44:05 -07:00
swift-ci
138625f758 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-18 10:41:34 -07:00
Tony Allevato
bd4cfee965 Merge pull request #76872 from allevato/swift-synthesize-interface-tool
Add a new driver tool/mode to print the synthesized Swift interface for a module.
2024-10-18 13:26:22 -04:00
Hamish Knight
b840730958 [IDE] Pass LangOptions to ide::isSourceInputComplete
Ensure we account for things like the enablement
of bare slash regex literals.
2024-10-17 14:04:34 +01:00
Hamish Knight
81dc7d87ed [Parse] Remove TypeChecker and SIL options parameter from ParserUnit
Providing these is a bit of a layering violation,
the parser shouldn't care about these options (there
does seem to be one current use of `TypeCheckerOpts`
in the parser for designated operator types, but
that's a legacy feature that was never officially
supported).
2024-10-17 14:04:34 +01:00
Tony Allevato
2cfcdd8ed1 Add a new driver tool/mode to print the synthesized Swift interface for a module.
This mode is similar to `swift-symbolgraph-extract`; it takes a subset of compiler
flags to configure the invocation for module loading, as well as a module name
whose contents should be extracted. It does not take any other input files. The
output is a single text file specified by `-o` (or `stdout` if not specified).

While the most common use case for this would be viewing the synthesized Swift
interface for a Clang module, since the implementation simply calls
`swift::ide::printModuleInterface` under the hood, it's usable for any module
that Swift can import. Thus, it could also be used to view a synthesized textual
representation of, say, a compiled `.swiftmodule`.

One could imagine that in the future, we might add more flags to
`swift-synthesize-interface` to modify various `PrintOptions` used when
generating the output, if we think those would be useful.
2024-10-10 15:30:41 -04:00
swift-ci
72676c2c4a Merge remote-tracking branch 'origin/main' into rebranch 2024-10-08 15:43:57 -07:00
Doug Gregor
f255cf6922 Test printing of declarations created by macros on imported decls 2024-10-08 11:12:52 -07:00
swift-ci
b8a5d2d6d7 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-03 01:35:42 -07:00
Konrad `ktoso` Malawski
dea3b59331 Merge pull request #76250 from ktoso/wip-experimental-isolated-deinit 2024-10-03 17:19:10 +09:00
swift-ci
e5f97d79c5 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-30 07:15:01 -07:00
nate-chandler
ba8f8ea282 Merge pull request #76526 from nate-chandler/general-coro/20240906/1
[CoroutineAccessors] Initial framing.
2024-09-30 07:04:04 -07:00