Commit Graph

36 Commits

Author SHA1 Message Date
Augusto Noronha
58df5534d2 [NFC][RemoteInspection] Add an opaque AddressSpace field to RemoteAddress
Add an extra opaque field to AddressSpace, which can be used by clients
of RemoteInspection to distinguish between different address spaces.

LLDB employs an optimization where it reads memory from files instead of
the running process whenever it can to speed up memory reads (these can
be slow when debugging something over a network). To do this, it needs
to keep track whether an address originated from a process or a file. It
currently distinguishes addresses by setting an unused high bit on the
address, but because of pointer authentication this is not a reliable
solution. In order to keep this optimization working, this patch adds an
extra opaque AddressSpace field to RemoteAddress, which LLDB can use on
its own implementation of MemoryReader to distinguish between addresses.

This patch is NFC for the other RemoteInspection clients, as it adds
extra information to RemoteAddress, which is entirely optional and if
unused should not change the behavior of the library.

Although this patch is quite big the changes are largely mechanical,
replacing threading StoredPointer with RemoteAddress.

rdar://148361743
2025-07-09 14:52:42 -07:00
Erik Eckstein
fa56ba2c3c link SwiftCompilerSources modules to lldb-moduleimport-test and swift-remoteast-test
This is needed once we implement mandatory passes in Swift, because those testing tools might parse swift interface files from the SDK.
2025-06-20 08:15:03 +02:00
Eric Miotto
f417630054 Add option to reduce build times when using ThinLTO and ld64 (#41058)
Internal configurations targeting Darwin employ ThinLTO to
improve compiler performance, however using it on all executable
causes build time to increase with no matching benefit.

To reduce build times in such configurations, we allow some
ancillary targets to opt out of LLVM IR optimizations when linking
ThinLTO with ld64 (e.g. tools used for bootstrapping or debugging the
Swift compiler) -- this behaviour is opt in through a new flag
`--swift-tools-ld64-lto-codegen-only-for-supporting-targets`.

Addresses rdar://76702687
2022-02-09 08:22:02 -08:00
Michael Gottesman
06cb5c0047 [cmake] Move a bunch of test binaries from install component 'tools' -> 'testsuite-tools'.
All of these are tools that are only meant to be used when testing swift. Thus
it doesn't make sense to include them in the catch all 'tools' install component
that distributions use to build all the tools.

I verified that all of the mac/linux presets in tree that have tools also has
testsuite-tools so this should be NFC. On Windows, I needed to add
testsuite-tools to build-windows.bat so should be NFC there as well.
2021-11-09 12:51:58 -08:00
David Zarzycki
55517d2f4a [CMake] Fix unified builds after #28003 2020-06-24 05:52:05 -04:00
Saleem Abdulrasool
88dbd7a175 Merge pull request #28967 from compnerd/editor
build: improve libedit handling for builds
2020-01-02 10:16:50 -08:00
Saleem Abdulrasool
1b850a2afd build: improve libedit handling for builds
Use the FindLibEdit.cmake module from LLDB to properly control where
the libedit libraries are searched for and linked from as well as where
the headers come from. This uses the standard mechanisms which allows
users to control where libedit is pulled from (which is important for
cross-compilation).

This second version is more aggressive about pruning the libedit
handling.  The Ubuntu 14.04 version of libedit does not have
`histedit.h`, and the intent is to rely on that to determine if we have
unicode support or not.
2019-12-29 16:32:49 -08:00
Saleem Abdulrasool
9bfe9505cb swift-remoteast-test: correct annotation of used functions (NFC)
The annotation must precede the declaration to which it appertains
during the definition.  The re-ordering was silently accepted by clang
but is not correct as per the GNU style.  This was flagged by GCC 7.
2019-12-23 15:39:36 -08:00
swift-ci
1f1fcb6ce5 Merge remote-tracking branch 'origin/master' into master-next 2019-03-07 13:49:14 -08:00
Mike Ash
fbe990481b [Runtime] Dynamically select the is-Swift bit at runtime on Apple platforms.
Recent Swift uses 2 as the is-Swift bit when running on newer versions, and 1 on older versions. Since it's difficult or impossible to know what we'll be running on at build time, make the selection at runtime.
2019-03-07 10:12:27 -05:00
David Zarzycki
71693ae2c2 [CMake] Track upstream rename: clang-headers -> clang-resource-headers 2019-03-05 10:48:35 -05:00
Slava Pestov
82f8d3f2e9 RemoteAST: Try to fix a use-after-free in swift-remoteast-test
Fixes <rdar://problem/48067187>.

We keep a global context alive now, but we have to destroy it before
Swift's ASTContext is torn down.
2019-02-21 16:39:58 -05:00
Slava Pestov
905a6def79 RemoteAST: Clean up use of std::pair and std::tuple for opened existentials with named structs 2019-02-12 15:18:03 -05:00
Slava Pestov
c16fed7d71 RemoteAST: Tweak swift-remoteast-test to reuse the context
I need this to reproduce a test failure.
2019-02-11 19:12:02 -05:00
Saleem Abdulrasool
0462bfeb77 swift-remote-test: correct the location of the ABI marker
The incorrect location of the ABI marker would result in the symbol not being
exposed when building with `cl` as it expects `__declspec(dllexport)` to be
after the return type.
2019-01-18 12:15:26 -08:00
Harlan Haskins
7b43e1d04d [FrontendTool] [NFC] Reduce scope of FrontendObserver
These APIs weren't used.
2018-11-29 19:18:56 -08:00
Saleem Abdulrasool
dd85d79105 tools: use target_link_libraries like clang (NFC)
Rather than using the `LINK_LIBRARIES` option, use target_link_libraries
like clang does.  Because these are all host tools, there is no name
mangling done for the libraries making this a no-op change.
2018-11-16 17:43:06 -08:00
Davide Italiano
4b5c2295d1 [RemoteAST] Support for extracting the type/valuea out of an existential.
This will be used in lldb.
<rdar://problem/41546568>
2018-07-30 17:00:23 -07:00
Saleem Abdulrasool
d641f0b079 swift-remoteast-test: mark exported interfaces
Mark the exported interfaces in the tool for the `ENABLE_EXPORTS`
to work properly.  This fixes the dependency tracking on Windows
and ensures that the tool is not continuously rebuilt.
2018-04-24 19:19:52 -07:00
swift-ci
9e935e1a9e Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-28 20:00:51 -08:00
Jordan Rose
3cd9f166bc Don't spend time initializing LLVM when running the driver (#14896)
Tiny start-up time optimization noticed while looking at how we do
PrettyStackTraceProgram. Also add PrettyStackTraceProgram to a few
more of our testing tools, via the new PROGRAM_START macro.
2018-02-28 19:56:19 -08:00
Bob Wilson
390058972a [master-next] Use PRIVATE in target_link_libraries for executables
This is needed to work with LLVM r319840.
2017-12-06 21:55:22 -08:00
John McCall
3d9ac50e2c Teach MetadataReader how to skip artificial subclasses,
and improve RemoteAST to provide corresponding APIs.
2017-02-16 15:41:50 -05:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Maxwell Swadling
35b2c68bd5 Revert "Revert "Introduce and use SWIFT_HAVE_LIBEDIT""
This reverts commit ef49338283.
2017-01-03 17:04:24 -08:00
Mishal Shah
ef49338283 Revert "Introduce and use SWIFT_HAVE_LIBEDIT" 2017-01-03 11:36:47 -08:00
Hugh Bellamy
76a6f87890 Introduce and use SWIFT_HAVE_LIBEDIT 2016-12-22 17:56:08 +00:00
practicalswift
38be6125e5 [gardening] C++ gardening: Terminate namespaces, fix argument names, ...
Changes:
* Terminate all namespaces with the correct closing comment.
* Make sure argument names in comments match the corresponding parameter name.
* Remove redundant get() calls on smart pointers.
* Prefer using "override" or "final" instead of "virtual". Remove "virtual" where appropriate.
2016-12-17 00:32:42 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Brian Gesiak
5bd8abacad [cmake] Bump minimum version to 3.4.3
The Swift README states that the minimum CMake version required to build the
Swift project is the same as LLVM's: 3.4.3. Bump the minimum version
used by CMake to correspond to the README.
2016-10-19 15:06:02 -04:00
Michael Gottesman
7e2568dcf0 [cmake-components] Introduce a new API add_swift_host_tool for creating/initializing swift tool targets.
The main action here is to sink the creation of the installation rule for all of
the swift host tools into this API. In a latter commit, I will use this API to
create include and build rules for add_swift_host_tool.
2016-08-28 14:12:14 -07:00
John McCall
83dc7cffe8 RemoteAST: implement member-offset calculations for tuples. 2016-04-27 19:00:30 -07:00
John McCall
812557ca24 Reorganization within RemoteAST. Basic error propagation.
Initial stabs towards reading foreign class metadata, although
these do not yet successfully resolve the declaration.
2016-04-25 16:57:19 -07:00
John McCall
f8fcd0ce11 Implement the RemoteAST test harness and add some skeletal tests. 2016-04-21 16:25:19 -07:00
Brian Gesiak
b1a4fd90b5 [RemoteAST] Only build remoteast-test for host
swift-remote-ast has dependencies that cannot be satisfied by all
of the targets Swift supports. Specifically, the Android target is
unable to link libraries that libRemoteAST depends on, such as uuid.
To fix builds for unsupported platforms, only build remoteast-test
for the host platform.
2016-04-20 17:16:07 -04:00
John McCall
e758ba3569 Stub out a RemoteAST library for translating remote metadata
pointers into a local AST.

This is intended primarily for the use of LLDB and does not have
a stable ABI.
2016-04-19 16:36:57 -07:00