Commit Graph

11 Commits

Author SHA1 Message Date
Allan Shortlidge
2730c19891 Macros: Stop explicitly enabling accepted ExtensionMacros feature in tests.
NFC.
2023-12-10 10:10:15 -08:00
Allan Shortlidge
953489d3d6 Serialization: Resolve macro conformances during serialization.
This ensures that conformances get serialized correctly when
`-experimental-lazy-typecheck` is specified.

Resolves rdar://119463830.
2023-12-10 10:06:54 -08:00
Holly Borla
b7a53f9303 [Macros] Handle the case where an extension macro conformance has a null
type repr because it was deserialized.
2023-07-07 17:16:03 -07:00
Doug Gregor
91e9a2ae6b [Test] Ensure that freestanding macros in unprocessed #ifs aren't expanded.
Tracked by rdar://110083415.
2023-06-02 15:17:34 -07:00
Ben Barham
fe2104ca99 [Macros] Automatically format expanded macros
Rather than requiring macro implementations to add required whitespace
and indentation, basic format all macro expansions. Right now this uses
the default four space indentation, we can consider having that inferred
later. Macros can opt-out of automatic formatting by implementing
`formatMode` and setting it to `.disabled`.

Also moves the extra newlines before/after expansions to a new "Inline
Macro" refactoring.

Resolves rdar://107731047.
2023-04-27 21:24:46 -07:00
Ben Barham
e5a28caa9a [Test] Fix swift_swift_parser feature and use in tests
The macro tests were all using "REQUIRES: OS=macosx" as a proxy for
"have the Swift Swift parser". There was an existing feature for this,
but it was just checking whether the path was passed through. Fix that
to use the same variable as in CMake.

Also remove all extraneous `-I` and `-L` to the host libs in the target
invocations.
2023-04-03 09:25:03 -07:00
Rintaro Ishizaki
1d2fd4223f [Test] Add %host_triple and %host_sdkroot substitutions
Macro tests need to build host libraries/tools. We can't use %target-*
substitutions for that.

rdar://107398734
2023-03-31 07:41:41 -07:00
Doug Gregor
f88d2c638f Clean up feature flags for macros.
Enable expression macros by default, and add separate feature flags for
attached and freestanding macros.
2023-03-02 14:34:59 -08:00
Alex Hoppen
cc8b0aa212 [Macros] Use Swift 5 in tests 2023-02-07 18:35:36 +01:00
Holly Borla
5227b540a9 [Macros] Validate the macro expansion via FileCheck for multi-file macro test. 2023-02-05 21:23:30 -08:00
Holly Borla
5c3872748a [Macros] Invoke member macro expansion during qualified lookup.
Otherwise, members that are added via macro expansion will not be visible
in other source files.
2023-02-05 21:23:30 -08:00