@@ -3109,15 +3109,19 @@ static CanSILFunctionType getSILFunctionTypeForClangDecl(
3109
3109
}
3110
3110
3111
3111
if (auto method = dyn_cast<clang::CXXMethodDecl>(clangDecl)) {
3112
- AbstractionPattern origPattern = AbstractionPattern::getCXXMethod (origType, method,
3113
- foreignInfo.self );
3114
- bool isMutating =
3115
- TC.Context .getClangModuleLoader ()->isCXXMethodMutating (method);
3116
- auto conventions = CXXMethodConventions (method, isMutating);
3117
- return getSILFunctionType (TC, TypeExpansionContext::minimal (), origPattern,
3118
- substInterfaceType, extInfoBuilder, conventions,
3119
- foreignInfo, constant, constant, None,
3120
- ProtocolConformanceRef ());
3112
+ // Static methods and ctors should be lowered like plane functions
3113
+ // (case below).
3114
+ if (!isa<clang::CXXConstructorDecl>(method) || method->isStatic ()) {
3115
+ AbstractionPattern origPattern = AbstractionPattern::getCXXMethod (origType, method,
3116
+ foreignInfo.self );
3117
+ bool isMutating =
3118
+ TC.Context .getClangModuleLoader ()->isCXXMethodMutating (method);
3119
+ auto conventions = CXXMethodConventions (method, isMutating);
3120
+ return getSILFunctionType (TC, TypeExpansionContext::minimal (), origPattern,
3121
+ substInterfaceType, extInfoBuilder, conventions,
3122
+ foreignInfo, constant, constant, None,
3123
+ ProtocolConformanceRef ());
3124
+ }
3121
3125
}
3122
3126
3123
3127
if (auto func = dyn_cast<clang::FunctionDecl>(clangDecl)) {
0 commit comments