Skip to content

Commit 1d1df27

Browse files
committed
Fix switch error + format
1 parent bb3a721 commit 1d1df27

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2751,6 +2751,11 @@ ClangImporter::Implementation::lookupTypedef(clang::DeclarationName name) {
27512751

27522752
static bool isDeclaredInModule(const ClangModuleUnit *ModuleFilter,
27532753
const Decl *VD) {
2754+
// Sometimes imported decls get put into the clang header module. If we
2755+
// found one of these decls, don't filter it out.
2756+
if (VD->getModuleContext()->getName().str() == CLANG_HEADER_MODULE_NAME) {
2757+
return true;
2758+
}
27542759
auto ContainingUnit = VD->getDeclContext()->getModuleScopeContext();
27552760
return ModuleFilter == ContainingUnit;
27562761
}
@@ -2898,11 +2903,9 @@ class FilteringDeclaredDeclConsumer : public swift::VisibleDeclConsumer {
28982903

28992904
void foundDecl(ValueDecl *VD, DeclVisibilityKind Reason,
29002905
DynamicLookupInfo dynamicLookupInfo) override {
2901-
if (isDeclaredInModule(ModuleFilter, VD) ||
2902-
// Sometimes imported decls get put into the clang header module. If we
2903-
// found one of these decls, don't filter it out.
2904-
VD->getModuleContext()->getName().str() == CLANG_HEADER_MODULE_NAME)
2906+
if (isDeclaredInModule(ModuleFilter, VD)) {
29052907
NextConsumer.foundDecl(VD, Reason, dynamicLookupInfo);
2908+
}
29062909
}
29072910
};
29082911

lib/ClangImporter/ImportName.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1856,14 +1856,15 @@ ImportedName NameImporter::importNameImpl(const clang::NamedDecl *D,
18561856
case clang::OverloadedOperatorKind::OO_LessEqual:
18571857
case clang::OverloadedOperatorKind::OO_GreaterEqual:
18581858
case clang::OverloadedOperatorKind::OO_AmpAmp:
1859-
case clang::OverloadedOperatorKind::OO_PipePipe:
1859+
case clang::OverloadedOperatorKind::OO_PipePipe: {
18601860
auto operatorName = isa<clang::CXXMethodDecl>(functionDecl)
18611861
? "__operator" + std::string{getOperatorName(op)}
18621862
: clang::getOperatorSpelling(op);
18631863
baseName = swiftCtx.getIdentifier(operatorName).str();
18641864
isFunction = true;
18651865
addEmptyArgNamesForClangFunction(functionDecl, argumentNames);
18661866
break;
1867+
}
18671868
case clang::OverloadedOperatorKind::OO_Call:
18681869
baseName = "callAsFunction";
18691870
isFunction = true;

0 commit comments

Comments
 (0)