Commit Graph

54 Commits

Author SHA1 Message Date
Hamish Knight
ee49794d0f [AST] Introduce Argument::implicitInOut
This will allow us to abstract away the creation
of InOutExpr for bits of code synthesis.
2022-08-08 15:10:51 +01:00
Egor Zhdan
1be0086413 [cxx-interop] Mark operator! as prefix func
Prefix operators in Swift need to be marked as `prefix func`.

For example, the lack of `prefix` attribute prevents the user from conforming a C++ type that defines `operator!` to a Swift protocol that requires `static prefix func !(obj: Self) -> Self`.
2022-07-15 14:50:36 +01:00
Egor Zhdan
d29b78eed1 [cxx-interop] Import increment operators
C++ pre-increment operator `T& T::operator++()` is mapped into a non-mutating function `successor() -> Self`.

The naming matches existing functions for `UnsafePointer`/`UnsafeMutablePointer`.

The purpose of this is to be used for iterator bridging: C++ requires iterators to define a pre-increment operator (https://en.cppreference.com/w/cpp/named_req/Iterator), which Swift will use to iterate over C++ sequences and collections.
2022-06-20 17:38:11 +01:00
Egor Zhdan
1839ddb115 [ClangImporter] NFC: extract Swift decl synthesis logic into a separate file
`ImportDecl.cpp` contained 10k+ lines of code, which caused slowdowns in incremental compilation and while editing the code in the IDE.

This change extracts a chunk of largely self-contained decl synthesis logic into a separate file.
2022-06-17 16:52:18 +01:00