Skip to content

Commit 0854397

Browse files
committed
SILOptimizer: rename cdecl to ctor (NFC)
`cdecl` is a keyword in the non-conforming C++ dialect used on Windows which expands to `__cdecl`. Simply rename the variable to avoid the replacement. Although it is possible to `#undef cdecl`, renaming makes it less confusing for non-Windows developers.
1 parent ce531be commit 0854397

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/SILOptimizer/Mandatory/OSLogOptimization.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -792,10 +792,10 @@ bool isAutoGeneratedInitOfOSLogMessage(SILFunction &fun) {
792792
Decl *decl = declContext->getAsDecl();
793793
if (!decl)
794794
return false;
795-
ConstructorDecl *cdecl = dyn_cast<ConstructorDecl>(decl);
796-
if (!cdecl)
795+
ConstructorDecl *ctor = dyn_cast<ConstructorDecl>(decl);
796+
if (!ctor)
797797
return false;
798-
DeclContext *parentContext = cdecl->getParent();
798+
DeclContext *parentContext = ctor->getParent();
799799
if (!parentContext)
800800
return false;
801801
NominalTypeDecl *typeDecl = parentContext->getSelfNominalTypeDecl();

0 commit comments

Comments
 (0)