Commit Graph

1759 Commits

Author SHA1 Message Date
Ben Barham
c763ab5d1e [Serialization] Store offset of decls in .swiftsourceinfo
The locations stored in .swiftsourceinfo included the presumed file,
line, and column. When a location is requested it would read these, open
the external file, create a line map, and find the offset corresponding
to that line/column.

The offset is known during serialization though, so output it as well to
avoid having to read the file and generate the line map.

Since the serialized location is returned from `Decl::getLoc()`, it
should not be the presumed location. Instead, also output the line
directives so that the presumed location can be built as per normal
locations.

Finally, move the cache out of `Decl` and into `ASTContext`, since very
few declarations will actually have their locations deserialized. Make
sure to actually write to that cache so it's used - the old cache was
never written to.
2021-04-29 12:33:05 +10:00
Robert Widmann
22f3e9620b Remap aarch64_32 to arm64_32 When Searching for Modules
The triple name aarch64_32 does not actually name a valid platform. The
actual platform (and valid triple arch string, confusingly enough) is
arm64_32. Remap between the two to correct for this difference.

rdar://77281393
2021-04-28 17:39:06 -07:00
swift_jenkins
cdfbe048be Merge remote-tracking branch 'origin/main' into next 2021-04-23 10:41:42 -07:00
QuietMisdreavus
419483863f Revert "[Driver][Frontend] add the symbol graph dir to the supplementary file map" 2021-04-22 12:20:14 -06:00
swift_jenkins
648fbf1256 Merge remote-tracking branch 'origin/main' into next 2021-04-20 18:01:37 -07:00
Robert Widmann
0149ccd0ca Add arm64_32 support for Swift
Commit the platform definition and build script work necessary to
cross-compile for arm64_32.

arm64_32 is a variant of AARCH64 that supports an ILP32 architecture.
2021-04-20 14:59:04 -07:00
swift_jenkins
ae89b73b65 Merge remote-tracking branch 'origin/main' into next 2021-04-15 11:01:24 -07:00
Becca (née Brent) Royal-Gordon
6e710b2806 Merge pull request #36594 from beccadax/nonstandard-library
Preload standard library in ModuleInterfaceBuilder
2021-04-15 10:43:28 -07:00
swift_jenkins
03a8b0f0b9 Merge remote-tracking branch 'origin/main' into next 2021-04-14 02:01:22 -07:00
Ben Barham
c54c9c7079 [Gardening] Extract basic source info structs from RawComment.h 2021-04-14 10:05:27 +10:00
Karoy Lorentey
3b7b158ee1 [Basic] Update for fs::createUniqueFile changes in llvm
https://reviews.llvm.org/D97785 reintroduced a flags parameter to `fs::createUniqueFile`, this time preceding `params`. (Compare: https://github.com/apple/swift/pull/18472)

rdar://76036856
2021-03-30 21:24:46 -07:00
Arnold Schwaighofer
027119fecb Merge remote-tracking branch 'upstream/main' into next 2021-03-29 12:33:25 -07:00
Becca Royal-Gordon
1f713074ac [NFC] Fix issues with -verify mode
This commit fixes two weird bugs in -verify mode:

1. SourceLocs from the wrong SourceManager could be passed through a ForwardingDiagnosticConsumer into the DiagnosticVerifier.

2. -verify-additional-file did not error out correctly when the file couldn’t be opened.

No tests, as we only have basic tests for the diagnostic verifier.
2021-03-25 16:02:29 -07:00
Victoria Mitchell
97a4cba250 add the symbol graph dir to the supplementary file map
rdar://75582169
2021-03-24 09:44:23 -05:00
swift_jenkins
1f4d7c4b6d Merge remote-tracking branch 'origin/main' into next 2021-03-06 02:01:18 -08:00
Nathan Hawes
117f03b2f5 [Driver][Index] Add driver support to specify an overriding output path to record in the index data
The frontend supports this via new options -index-unit-output-path and
-index-unit-output-path-filelist that mirror -o and -output-filelist. These are
intended to allow sharing index data across builds in separate directories (so
different -o values) that are otherwise equivalent as far as the index data is
concerned (e.g. an ASAN build and a non-ASAN build) by supplying the same
-index-unit-output-path for both.

This change updates the driver to add these new options to the frontend
invocation 1) when a new "index-unit-output-path" entry is specified for one
or more input files in the -output-file-map json or 2) if -index-file is
specified, when a new -index-unit-output-path driver option is passed.

Resolves rdar://problem/74816412
2021-03-06 13:44:14 +10:00
swift_jenkins
30190b5884 Merge remote-tracking branch 'origin/main' into next 2021-03-04 16:04:09 -08:00
Rintaro Ishizaki
de71c61aa9 [SourceManager] Use llvm::SourceMgr::FindLocForLineAndColumn()
To resolvve offset from line and column.
'llvm::SourceMgr::FindLocForLineAndColumn()' uses line tables. It's much
faster than manual O(n) scanning.
2021-03-04 11:32:55 -08:00
Robert Widmann
0e0825a3e8 Work Around MSVC Regression in std::less 2021-03-03 18:49:33 -08:00
Doug Gregor
7509270a9e Merge pull request #35862 from DougGregor/concurrency-import-cleanups 2021-02-09 19:38:04 -08:00
Doug Gregor
ae3049f4b9 [Importer] Make sure we drop "WithBlock" as a completion-handler suffix.
Fixes rdar://73641827.
2021-02-09 15:00:32 -08:00
Doug Gregor
bd2064a5f9 Merge pull request #35839 from DougGregor/backward-compatible-module-interfaces 2021-02-09 07:16:48 -08:00
Doug Gregor
aa139a101c [Module interface] Use features in module interface generation.
When generating a module interface, emit `#if` around any declarations
that are tied to specific, named language features. This allows module
interfaces to be processed by older Swift compilers that do not
support these newer features, such as async/await or actors.

The amount of effort required to correctly handle a new kind of
feature varies somewhat drastically based on the feature itself. The
"simple" case is where a particular declaration can only exist if a
feature is available. For example, and `async` declaration is fairly
easy to handle; a `@_marker` protocol's conformances are not.

Fixes rdar://73326633.
2021-02-08 16:01:39 -08:00
Alexis Laferrière
17e926e93b [Basic] Don't use defined(LLVM_ENABLE_STATS) as it can be set to 0
LLVM_ENABLE_STATS can be defined to 0 since
https://reviews.llvm.org/D91094.

rdar://73834542
2021-02-08 14:27:41 -08:00
Varun Gandhi
0d1e7abc9a Merge pull request #35757 from cypherean/refactor_transform
Replace std::transform with llvm::transform
2021-02-05 08:17:48 -08:00
shreyaa-sharmaa
2b11d7acc7 Task SR-14138 Replace std::transform with llvm::transform 2021-02-04 12:58:33 +05:30
swift-ci
08055c27c1 Merge remote-tracking branch 'origin/main' into rebranch 2021-01-21 21:08:12 -08:00
Robert Widmann
73ac8d3531 Replace llvm::MD5 with StableHasher 2021-01-21 17:19:38 -08:00
Robert Widmann
f5cb08e3d1 Add a Stable Hash Algorithm
Use SipHash-2-4 to replace llvm::MD5 as the hashing implementation backing Fingerprints and the interface hash.
2021-01-21 17:19:38 -08:00
swift-ci
97044f4093 Merge remote-tracking branch 'origin/main' into rebranch 2021-01-19 14:52:10 -08:00
Robert Widmann
1fd5f0835a [NFC] Evict Mock Fingerprints Code From Interface 2021-01-19 11:44:41 -08:00
swift-ci
b5748f255b Merge remote-tracking branch 'origin/main' into rebranch 2021-01-16 14:52:22 -08:00
David Ungar
dbe4b6df43 Fix fingerprints in unit tests of driver. 2021-01-16 11:47:59 -08:00
David Ungar
7f36ab171b Allow Fingerprint::fromString to fail, returning None on bad input. 2021-01-15 13:46:46 -08:00
David Ungar
2ffa369c0d Catch conversion failure in Fingerprint 2021-01-15 13:46:46 -08:00
swift-ci
90eb4fe6af Merge remote-tracking branch 'origin/main' into rebranch 2021-01-15 13:12:33 -08:00
Xi Ge
fcbc2b4d9d Merge pull request #35414 from nkcsgexi/volatile-open-input
Frontend: add an option -bad-file-descriptor-retry-count
2021-01-15 12:58:55 -08:00
Xi Ge
ae9d873009 Frontend: add an option -bad-file-descriptor-retry-count
This option allows the compiler to retry opening an input file if the previous
opening returns an error of bad file descriptor. Swift-driver will set this
argument in certain circumstances to walk-around such error.

rdar://73157185
2021-01-15 10:28:27 -08:00
swift-ci
6841728fb2 Merge remote-tracking branch 'origin/main' into rebranch 2021-01-14 09:32:28 -08:00
Robert Widmann
cc0d919653 Remove Compiled Source 2021-01-13 23:00:16 -08:00
Robert Widmann
2475095021 Remove Ranges File Type 2021-01-13 22:42:17 -08:00
Robert Widmann
0102c52d18 Remove OutputFileMap's Knowledge of Range Dependencies 2021-01-13 22:14:02 -08:00
Nate Chandler
20db2c0981 Merge branch 'main' into rebranch
Conflicts:
	include/swift/Basic/AnyValue.h
2021-01-12 16:30:02 -08:00
Slava Pestov
5585cac9dd AST: Remove AnyValue type eraser now that it's no longer needed
I'm keeping AnyValue.h around, since it has some useful overloads of
hash_value() and simple_display() that don't have a good home at this
time.
2021-01-08 23:17:12 -05:00
swift_jenkins
a28809d097 Merge remote-tracking branch 'origin/main' into next 2020-12-16 13:03:38 -08:00
Artem Chikin
47da04fd72 Merge pull request #34417 from artemcm/FrontendParseableOutput
Add support for parseable-output straight from the frontend
2020-12-16 12:59:40 -08:00
swift_jenkins
e4f86c6724 Merge remote-tracking branch 'origin/main' into next 2020-12-15 16:25:38 -08:00
Robert Widmann
76a7ceea64 [NFC] Re-Core Fingerprint
Switch from a string core to a 128-bit integral core. This should make
Fingerprints much cheaper to copy around and sets us up for a future
where we can provide alternative implementations of the ambient hashing
algorithm.

rdar://72313506
2020-12-14 17:50:10 -08:00
Artem Chikin
915186ab47 Refactor Basic/Parseable-Output to remove dependency on Driver & Frontend
Introducing new entry-points that can be used from both Driver and Frontend clients, using an intermediary new type: `DetailedMessagePayload`, when needed.
2020-12-14 11:35:56 -08:00
Artem Chikin
269f1b91bc Add host-specific include for getpid() in FrontendTool. 2020-12-11 16:01:04 -08:00