Commit Graph

19 Commits

Author SHA1 Message Date
Ellie Shin
6c002edb38 Add emit-package-module-interface-path and experimental-package-interface-load to features.json 2024-01-11 18:49:26 -08:00
Steven Wu
76bde39ee7 [Caching] Encoding cache key for input file with index instead of path
Avoid path encoding difference (for example, real_path vs. path from
symlink) by eliminating the path from cache key. Cache key is now
encoded with the index of the input file from all the input files from
the command-line, reguardless if those inputs will produce output or
not. This is to ensure stable ordering even the batching is different.

Add a new cache computation API that is preferred for using input index
directly. Old API for cache key is deprecated but still updated to
fallback to real_path comparsion if needed.

As a result of swift scan API change, rename the feature in JSON file to
avoid version confusion between swift-driver and libSwiftScan.

rdar://119387650
2023-12-18 14:06:00 -08:00
Steven Wu
a09052f2a7 Add cache-compile-job to features.json
Add `cache-compile-job` to toolchain feature JSON file so build
system/swift driver can query.
2023-11-10 10:46:13 -08:00
Max Desiatov
b7d8a9b22b Add ld-path-driver-option to features.json (#69586)
Dependency of https://github.com/apple/swift-package-manager/pull/7021.

The `-ld-path` option was introduced on `main` in https://github.com/apple/swift-driver/pull/1442 and `release/5.10` in https://github.com/apple/swift-driver/pull/1442. SwiftPM needs to detect this flag to pass options to the driver correctly, and it's suitable to do this via `feature.json` instead of checking for the compiler version via other means.

Partially resolves rdar://117049947.
2023-11-02 18:08:18 +00:00
Artem Chikin
3f0c0f0553 [Compile Time Constant Extraction] Add extraction of all conformances and type aliases of applicable nominal types
This change adds to the extracted type metadata the following fields:
- Conformances: this is a list of all protocols that the given nominal type conforms to
- associated type aliases: this is a list of all associated types across all conformances that the given nominal type substitutes with concrete types. For a given associated type, we gather:
  - Associated type name
  - Substituted type's fully-qualified name
  - Substituted type's mangled name
  - If the substituted type is opaque:
    - List of conformance requirements of this opaque type
    - List of same-type requirements of this opaque type
2023-06-22 07:13:24 -07:00
Ellie Shin
3c81a02112 Rename package-name flag 2023-04-12 15:22:45 -07:00
Ellie Shin
f26890a31d Add package-name to lib/Option/features.json
Resolves rdar://106448681
2023-03-08 13:46:38 -08:00
Max Obermeier
504fe3c3a4 Make emission of extension block symbols formal feature
- add name to lib/Option/features.json
 - add flag for explicitly disabling extension block symbols feature
2022-10-19 19:13:11 +02:00
Artem Chikin
869e70f993 [Compile Time Constant Extraction] Add 'features.json' entry for ability to emit constant value side-car file 2022-08-19 11:40:08 -07:00
Artem Chikin
514996e755 [Compile Time Constant Extraction] Use 'Expr::printConstExprValue' instead of rolling it ourselves. 2022-08-19 11:39:40 -07:00
Xi Ge
f8986dcdb6 FeatureFlags: rename feature flag enable-bare-slash-regex. NFC 2022-04-21 11:01:34 -07:00
Artem Chikin
7ba377b3c2 Rename flag for enabling forward slash literals to be less ambiguous.
Previous spelling could easily be mistaken for gating the entire feature.

Part of rdar://91119995
2022-04-06 09:46:40 -07:00
Artem Chikin
b04ae26391 Add support for -enable-regex-literals flag
- Add driver and frontend option
- Add LangOptions entry
- Ensure driver propagates flag to frontends
- Add feature to `features.json`

Part of rdar://91119995
2022-04-01 12:14:28 -07:00
Ben Barham
a1e3afadb2 [Option] Add feature flag for empty ABI descriptors
Allow clients to check whether they can force empty ABI descriptors to
be output.
2022-03-21 13:25:51 -07:00
Ben Barham
50c9af4fca [Frontend] Add feature flag for the index unit path warning removal
6e683ca823 removed the warning that was
being output when `-index-unit-output-path` was given without
`-index-store-path`. Add a feature flag to mark the compiler as having
removed this warning.

Resolves rdar://86833719.
2022-01-20 10:34:37 -08:00
Xi Ge
f97653ef37 Frontend: teach -emit-module and -merge-modules to emit ABI descriptor files 2021-09-21 16:51:52 -07:00
Alexis Laferrière
97c4fdc0e3 [Driver] Set the feature flag library-level
Set the flag to indicate the availability of the -library-level flag in
the compiler and driver. As driver submissions can be delayed we are
integrating this flag late as a safety measure.

rdar://82742547
2021-09-03 15:45:06 -07: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
Ben Barham
d57d9fd726 Add features file describing new available flags
The only available method to check for features at the moment is through
version checks. This is errorprone and doesn't work well for OSS
toolchains or locally built compilers.

features.json is intended to communicate to build systems that a new
flag is available, in order to assist with a transitional period where
not all supported toolchains may have a particular flag. It is *not*
intended to be a comprehensive report of all flags available.

Note that the names are intended to be features, so while they may match
up to the corresponding flag name, this isn't necessarily the case.
2020-11-12 11:53:18 +10:00