@@ -3460,17 +3460,11 @@ TypeConverter::getDeclRefRepresentation(SILDeclRef c) {
3460
3460
if (!c.hasDecl ())
3461
3461
return SILFunctionTypeRepresentation::CFunctionPointer;
3462
3462
3463
- // TODO: Is this correct for operators?
3464
3463
if (auto method =
3465
- dyn_cast_or_null<clang::CXXMethodDecl>(c.getDecl ()->getClangDecl ())) {
3466
- // Subscripts and call operators are imported as normal methods.
3467
- bool staticOperator = method->isOverloadedOperator () &&
3468
- method->getOverloadedOperator () != clang::OO_Call &&
3469
- method->getOverloadedOperator () != clang::OO_Subscript;
3464
+ dyn_cast_or_null<clang::CXXMethodDecl>(c.getDecl ()->getClangDecl ()))
3470
3465
return isa<clang::CXXConstructorDecl>(method) || method->isStatic ()
3471
3466
? SILFunctionTypeRepresentation::CFunctionPointer
3472
3467
: SILFunctionTypeRepresentation::CXXMethod;
3473
- }
3474
3468
3475
3469
3476
3470
// For example, if we have a function in a namespace:
@@ -4493,19 +4487,6 @@ TypeConverter::getLoweredFormalTypes(SILDeclRef constant,
4493
4487
4494
4488
auto partialFnPattern = bridgingFnPattern.getFunctionResultType ();
4495
4489
for (unsigned i : indices (methodParams)) {
4496
- // C++ operators that are implemented as non-static member functions get
4497
- // imported into Swift as static methods that have an additional
4498
- // parameter for the left-hand-side operand instead of the receiver
4499
- // object. These are inout parameters and don't get bridged.
4500
- // TODO: Undo this if we stop using inout.
4501
- if (auto method = dyn_cast_or_null<clang::CXXMethodDecl>(
4502
- constant.getDecl ()->getClangDecl ())) {
4503
- if (i==0 && method->isOverloadedOperator ()) {
4504
- bridgedParams.push_back (methodParams[0 ]);
4505
- continue ;
4506
- }
4507
- }
4508
-
4509
4490
auto paramPattern = partialFnPattern.getFunctionParamType (i);
4510
4491
auto bridgedParam =
4511
4492
getBridgedParam (rep, paramPattern, methodParams[i], bridging);
0 commit comments