Artem Chikin
79073edb5b
[Compile Time Constant Extraction] Extract the instance type for type values - not the metatype
...
The intended design is to extract actual types of type values appearing in conformance properties, whereas the original extraction code-path queried and recorded the type values' types - their metatypes.
Resolves rdar://108609420
2023-04-27 08:11:38 -07:00
James Paolantonio
bb2a2e8efe
[Compile Time Constant Extraction] Look through InjectIntoOptionalExpr ( #64416 )
2023-03-16 15:42:22 -04:00
Artem Chikin
87f1c2f6bd
[Compile Time Constant Extraction] Extract mangled names for Type values
...
Resolves rdar://106151566
2023-03-06 17:47:55 -03:00
swift-ci
03b7ad6b33
Merge pull request #64004 from artemcm/ConstExtractFixes
...
[Compile Time Constant Extraction] Look through Optional injection and underlying-to-opaque conversions
2023-03-02 11:30:03 -08:00
Artem Chikin
76b9281fac
[Compile Time Constant Extraction] Handle expression-less default argument expressions
...
Resolves rdar://106006282
2023-03-02 08:48:28 -08:00
Artem Chikin
86b8ca6f91
[Compile Time Constant Extraction] Look through underlying-to-opaque conversions
...
Resolves rdar://106006689
2023-03-01 11:01:34 -08:00
Artem Chikin
ee9b4766ad
[Compile Time Constant Extraction] Extract InjectIntoOptional arguments
...
Resolves rdar://106059663
2023-03-01 09:22:45 -08:00
Doug Gregor
200f2340d9
[Macros] Be deliberate about walking macro arguments vs. expansions
...
Provide ASTWalker with a customization point to specify whether to
check macro arguments (which are type checked but never emitted), the
macro expansion (which is the result of applying the macro and is
actually emitted into the source), or both. Provide answers for the
~115 different ASTWalker visitors throughout the code base.
Fixes rdar://104042945, which concerns checking of effects in
macro arguments---which we shouldn't do.
2023-02-28 17:48:23 -08:00
James Paolantonio
9e94cb9c6e
[Compile Time Constant Extraction] Extract Types ( #63820 )
2023-02-23 13:18:35 -05:00
Artem Chikin
aa70ac7e52
[Compile Time Constant Extraction] Extract explicit cast property init values
...
For some types which are e.g. ExpressibleByStringLiteral, we may encounter a coerce expression with a compile-time-knowable parameter/sub-expression.
2023-02-21 09:28:45 -08:00
Artem Chikin
d5f09b496a
[Compile Time Constant Extraction] Extract runtime metadata attributes
...
Part of rdar://104192094
2023-02-08 14:31:44 -07:00
James Paolantonio
af7cf15133
[Compile Time Constant Extraction] Extract Property Wrapper Line + File Information ( #63195 )
2023-01-26 08:49:20 -08:00
Erik Eckstein
7d8bf37e5e
change to the new llvm::Optional APIs
...
This is a follow-up of https://github.com/apple/swift/pull/62217
2023-01-25 09:18:36 +01:00
Artem Chikin
959216c0f6
Merge pull request #63175 from artemcm/DeSugarArraysAndDictionariesWhenPrinting
...
[Compile Time Constant Extraction] Print desugared array, dictionary, optional types
2023-01-24 09:32:08 -08:00
James Paolantonio
c4c1b82771
[Compile Time Constant Extraction] Extract availability annotations ( #63174 )
2023-01-24 09:03:41 -08:00
Artem Chikin
544dae4713
[Compile Time Constant Extraction] Print desugared arrays, dictionaries, optionals
...
Resolves rdar://103187206
2023-01-23 17:12:31 -08:00
James Paolantonio
f4a7e4ca18
[Compile Time Constant Extraction] Extract result builder-type information ( #63091 )
2023-01-20 09:40:31 -05:00
James Paolantonio
093f00a902
[Compile Time Constant Extraction] Extract enums ( #63005 )
2023-01-19 15:10:07 -05:00
James Paolantonio
5a1207569e
[Compile Time Constant Extraction] Extract line numbers ( #62870 )
2023-01-09 16:31:41 -05:00
James Paolantonio
4a2908041f
[Compile Time Constant Extraction] Update string literal output formatting ( #62836 )
2023-01-06 07:04:51 -05:00
Quinn Taylor
5683a6145a
Merge pull request #62752 from quinntaylor/const-extract-dictionary
...
[Compile Time Constant Extraction] Add extraction of Dictionary values.
2023-01-05 13:14:31 -05:00
James Paolantonio
0d52c41e61
[Compile Time Constant Extraction] Add extraction of paren expressions ( #62816 )
2023-01-04 09:27:00 -05:00
Quinn Taylor
b4a1fc615b
Check that pointer type is TupleValue before doing the static cast.
2022-12-22 13:35:16 -05:00
Quinn Taylor
a0aa3180bb
Address PR feedback, including narrowing element type of DictionaryValue to TupleValue.
2022-12-22 12:10:51 -05:00
Quinn Taylor
813f542d2a
[Compile Time Constant Extraction] Add extraction of Dictionary values.
2022-12-21 22:40:01 -05:00
James Paolantonio
5ec4143f4a
[Compile Time Constant Extraction] Add extraction of arrays ( #62491 )
2022-12-14 17:46:09 -05:00
James Paolantonio
b6d098618d
[Compile Time Constant Extraction] Add extraction of property wrappers ( #62555 )
2022-12-14 09:28:09 -05:00
James Paolantonio
0d666e2911
[Compile Time Constant Extraction] Add extraction of tuples ( #62436 )
2022-12-13 13:17:42 -05:00
James Paolantonio
186e55f5fd
[Compile Time Constant Extraction] Add extraction computed variables in extensions ( #62465 )
2022-12-09 08:13:38 -05:00
Quinn Taylor
5ad497047a
Updated formatting using clang-format.
2022-12-08 13:07:29 -05:00
Quinn Taylor
c434075a6c
[Compile Time Constant Extraction] Refactor to support recursion.
...
Extract `extractCompileTimeValue()` function to recursively handle `CompileTimeValue` hierarchies.
Inline `extractLiteralOutput()` to only be used from the one remaining call site.
Refactor `ExprKind::Call` handling to reduce branching for args with a `DefaultArgumentExpr`.
2022-12-08 12:17:03 -05:00
James Paolantonio
7832de07f9
[Compile Time Constant Extraction] Add extraction of initialization calls ( #62365 )
2022-12-06 08:44:57 -05:00
Quinn Taylor
43a126c28a
[Compile Time Constant Extraction] Add valueKind property to JSON output.
...
For computed Swift properties where `valueKind` is `"Runtime"`, exclude the `value` JSON property.
2022-11-29 13:58:30 -05:00
James Paolantonio
9f69176035
[Compile Time Constant Extraction] Add extraction of single statement returns of computed properties.
2022-11-28 10:32:05 -05:00
Artem Chikin
5a38d65fb3
Move 'ConstExtract' request from TypeCheckRequest into its own component's collection of requests.
2022-10-28 13:55:09 -07:00
Artem Chikin
2817883cb0
[Compile Time Constant Extraction] Allow quoted protocol names inside argument list to '-const-gather-protocols-file'
2022-10-12 10:11:52 -07:00
Hamish Knight
4716f61fba
[AST] Introduce explicit actions for ASTWalker
...
Replace the use of bool and pointer returns for
`walkToXXXPre`/`walkToXXXPost`, and instead use
explicit actions such as `Action::Continue(E)`,
`Action::SkipChildren(E)`, and `Action::Stop()`.
There are also conditional variants, e.g
`Action::SkipChildrenIf`, `Action::VisitChildrenIf`,
and `Action::StopIf`.
There is still more work that can be done here, in
particular:
- SourceEntityWalker still needs to be migrated.
- Some uses of `return false` in pre-visitation
methods can likely now be replaced by
`Action::Stop`.
- We still use bool and pointer returns internally
within the ASTWalker traversal, which could likely
be improved.
But I'm leaving those as future work for now as
this patch is already large enough.
2022-09-13 10:35:29 +01:00
Pavel Yaskevich
bca9004ae1
Merge pull request #60707 from xedin/switch-to-string-format-for-locale
...
[Localization] Switch diagnostics/localization to `.strings` format
2022-08-23 09:49:27 -07:00
Slava Pestov
ecc552f8d7
ConstExtract: Stop calling getAllConformances() on protocols
2022-08-23 00:03:36 -04:00
Pavel Yaskevich
10b609caec
[Localization] Remove YAML format and tool
2022-08-22 10:53:51 -07:00
Artem Chikin
38455e29f3
[Compile Time Constant Extraction] Print fully-qualified type names
2022-08-19 11:39:46 -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
Artem Chikin
6e7f3076b8
Add rudimentary emission of compile-time-known default-initialized property values of specific conformances.
2022-08-01 11:06:59 -07:00