@@ -3460,17 +3460,11 @@ TypeConverter::getDeclRefRepresentation(SILDeclRef c) {
34603460 if (!c.hasDecl ())
34613461 return SILFunctionTypeRepresentation::CFunctionPointer;
34623462
3463- // TODO: Is this correct for operators?
34643463 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 ()))
34703465 return isa<clang::CXXConstructorDecl>(method) || method->isStatic ()
34713466 ? SILFunctionTypeRepresentation::CFunctionPointer
34723467 : SILFunctionTypeRepresentation::CXXMethod;
3473- }
34743468
34753469
34763470 // For example, if we have a function in a namespace:
@@ -4493,19 +4487,6 @@ TypeConverter::getLoweredFormalTypes(SILDeclRef constant,
44934487
44944488 auto partialFnPattern = bridgingFnPattern.getFunctionResultType ();
44954489 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-
45094490 auto paramPattern = partialFnPattern.getFunctionParamType (i);
45104491 auto bridgedParam =
45114492 getBridgedParam (rep, paramPattern, methodParams[i], bridging);
0 commit comments