Skip to content

Commit 9fd55c7

Browse files
committed
Fix errors and warnings building swift/PrintAsObjc on Windows using MSVC
1 parent 8be4df4 commit 9fd55c7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/PrintAsObjC/PrintAsObjC.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class ObjCPrinter : private DeclVisitor<ObjCPrinter>,
159159

160160
void print(const Decl *D) {
161161
PrettyStackTraceDecl trace("printing", D);
162-
visit(const_cast<Decl *>(D));
162+
ASTVisitor::visit(const_cast<Decl *>(D));
163163
}
164164

165165
void printAdHocCategory(iterator_range<const ValueDecl * const *> members) {
@@ -194,8 +194,6 @@ class ObjCPrinter : private DeclVisitor<ObjCPrinter>,
194194
}
195195

196196
private:
197-
using ASTVisitor::visit;
198-
199197
/// Prints a protocol adoption list: <code>&lt;NSCoding, NSCopying&gt;</code>
200198
///
201199
/// This method filters out non-ObjC protocols, along with the special
@@ -241,7 +239,7 @@ class ObjCPrinter : private DeclVisitor<ObjCPrinter>,
241239
protocolMembersOptional = VD->getAttrs().hasAttribute<OptionalAttr>();
242240
os << (protocolMembersOptional ? "@optional\n" : "@required\n");
243241
}
244-
visit(const_cast<ValueDecl*>(VD));
242+
ASTVisitor::visit(const_cast<ValueDecl*>(VD));
245243
}
246244
}
247245

@@ -821,7 +819,7 @@ class ObjCPrinter : private DeclVisitor<ObjCPrinter>,
821819
break;
822820
case NullabilityPrintKind::After:
823821
os << ' ';
824-
[[clang::fallthrough]];
822+
LLVM_FALLTHROUGH;
825823
case NullabilityPrintKind::Before:
826824
switch (*kind) {
827825
case OTK_None:
@@ -1536,7 +1534,7 @@ class ObjCPrinter : private DeclVisitor<ObjCPrinter>,
15361534
}
15371535
};
15381536

1539-
class ReferencedTypeFinder : private TypeVisitor<ReferencedTypeFinder> {
1537+
class ReferencedTypeFinder : public TypeVisitor<ReferencedTypeFinder> {
15401538
friend TypeVisitor;
15411539

15421540
ModuleDecl &M;
@@ -1782,6 +1780,8 @@ class ModuleWriter {
17821780
case EmissionState::Defined:
17831781
return true;
17841782
}
1783+
1784+
llvm_unreachable("Unhandled EmissionState in switch.");
17851785
}
17861786

17871787
void forwardDeclare(const NominalTypeDecl *NTD,

0 commit comments

Comments
 (0)