Commit Graph

115 Commits

Author SHA1 Message Date
Joe Groff
577f83a260 SIL: Type lowering for imported ObjC async decls.
When lowering the type for `@objc` entry points of async declarations, restore
the original ObjC signature with the completion handler argument in the lowered
SIL type.
2020-10-27 09:00:45 -07:00
Varun Gandhi
abce3de41c [NFC] Add some TODO comments for cleanup. 2020-09-24 00:38:45 -07:00
Slava Pestov
61104cf9c6 SIL: Clean up AbstractionPattern::getLayoutConstraint() 2020-08-15 03:09:12 -04:00
Michael Forster
26358c4588 Import member operator functions as static members (#32293)
This adds support to `ClangImporter` to import C++ member function operators as static methods into Swift, which is part of SR-12748.

The left-hand-side operand, which gets passed as the `this` pointer to the C++ function is represented as an additional first parameter in the Swift method. It gets mapped back in SILGen.

Two of the tests are disabled on Windows because we can't yet call member functions correctly on Windows (SR-13129).
2020-07-03 11:06:22 +02:00
Anthony Latsis
9fd1aa5d59 [NFC] Pre- increment and decrement where possible 2020-06-01 15:39:29 +03:00
Marcel Hlopko
e293330563 [CxxInterop] Import C++ references. (#31784) 2020-05-15 10:42:37 +02:00
Saleem Abdulrasool
6bf7593fd5 Revert "[CxxInterop] Import C++ references." (#31777) 2020-05-14 10:43:22 +02:00
Marcel Hlopko
30b5fd52e8 [CxxInterop] Import C++ references. (#31702) 2020-05-13 13:34:28 +02:00
Robert Widmann
c70dce0226 Merge pull request #31515 from AnthonyLatsis/assert-type-param-requires-class
AST: Assert we were given a type parameter in GenericSignatureImpl::requiresClass
2020-05-09 09:13:41 -07:00
Dmitri Gribenko
68bc265190 Correctly print an AbstractionPattern with C++ method types
Printing an AbstractionPattern with a CXXMethodType would previously
fail because the code would try to get a Clang type instead. I could
add an if statement but instead, I split off the cases related to C++
method type into a new block, as that seems to follow the pattern in
AbstractionPattern::print().
2020-05-08 13:27:49 +02:00
Anthony Latsis
ab1ca1d6f7 AST: Assert we were given a type parameter in GenericSignatureImpl::requiresClass 2020-05-03 16:46:52 +03:00
Joe Groff
aa8a07aec9 Merge pull request #31347 from jckarter/opaque-structural-type-reabstraction
SILGen: Fix some issues with tuple/metatype/function reabstraction against opaque return types.
2020-04-29 08:17:28 -07:00
Joe Groff
65a2f92de5 SILGen: Fix some issues with tuple/metatype/function reabstraction against opaque return types.
- Getting a tuple element from an opaque return type `AbstractionPattern` should produce another
  opaque abstraction pattern.
- Relax an assertion failure when lowering metatypes against opaque return type abstraction
  patterns.

Fixes rdar://problem/58787252.
2020-04-27 14:49:34 -07:00
Saleem Abdulrasool
fa46f7131c sprinkle some llvm_unreachable for MSVC (NFC)
MSVC does not realize that the switch is exhaustive and requires that
the path is explicitly marked as unreachable.  This silences the C4715
warning ("not all control paths return a value").
2020-04-24 18:59:07 -07:00
Michael Gottesman
e1a19e4173 [sil] Split library into subfolders, while still building as a single library still.
Specifically, I split it into 3 initial categories: IR, Utils, Verifier. I just
did this quickly, we can always split it more later if we want.

I followed the model that we use in SILOptimizer: ./lib/SIL/CMakeLists.txt vends
 a macro (sil_register_sources) to the sub-folders that register the sources of
 the subdirectory with a global state variable that ./lib/SIL/CMakeLists.txt
 defines. Then after including those subdirs, the parent cmake declares the SIL
 library. So the output is the same, but we have the flexibility of having
 subdirectories to categorize source files.
2020-03-30 11:01:00 -07:00