3 Commits

Author SHA1 Message Date
Kuba Mracek
c3f865be4a Add #objectFormat compilation conditional (SE-0492) 2025-10-16 15:15:27 -07:00
Doug Gregor
2a46916536 Reseat CompilerBuildConfiguration on top of StaticBuildConfiguration
Now that we have a per-ASTContext StaticBuildConfiguration, reimplement
(almost) everything in CompilerBuildConfiguration to sit on top of it.
Only canImport requires the full ASTContext, so that gets its own
implementation, as does one other operation that can produce an error.
Aside from more code sharing, this provides additional validation that
the StaticBuildConfiguration we build is complete and accurate.
2025-09-29 18:42:15 -07:00
Doug Gregor
3082b04b75 [Macros] Feed the static build configuration into macro expansions
Thread the static build configuration (formed from language options) in
to the macro plugin handler, which will serialize it for use in the
macro implementation. test this with a simple macro that checks
whether a particular custom configuration (set via `-D`) is enabled or
not.

This required some re-layering, sinking the logic for building a
StaticBuildConfiguration from language options down into a new
swiftBasicSwift library, which sits on top of the C++ swiftBasic and
provides Swift functionality for it. That can be used by the C++
swiftAST to cache the StaticBuildConfiguration on the ASTContext,
making it available for other parts of ASTGen.
2025-09-29 18:42:15 -07:00