File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 26
26
#include < sstream>
27
27
#include < string>
28
28
29
+ using namespace swift ;
30
+
29
31
namespace {
30
32
// / A helper class to collect all nominal type declarations that conform to
31
33
// / specific protocols provided as input.
32
- class NominalTypeConformanceCollector : public swift :: ASTWalker {
34
+ class NominalTypeConformanceCollector : public ASTWalker {
33
35
const std::unordered_set<std::string> &Protocols;
34
- std::vector<swift:: NominalTypeDecl *> &ConformanceTypeDecls;
36
+ std::vector<NominalTypeDecl *> &ConformanceTypeDecls;
35
37
36
38
public:
37
39
NominalTypeConformanceCollector (
38
40
const std::unordered_set<std::string> &Protocols,
39
- std::vector<swift:: NominalTypeDecl *> &ConformanceDecls)
41
+ std::vector<NominalTypeDecl *> &ConformanceDecls)
40
42
: Protocols(Protocols), ConformanceTypeDecls(ConformanceDecls) {}
41
43
42
- bool walkToDeclPre (swift::Decl *D) override {
43
- if (auto *NTD = llvm::dyn_cast<swift::NominalTypeDecl>(D))
44
- for (auto &Protocol : NTD->getAllProtocols ())
45
- if (Protocols.count (Protocol->getName ().str ().str ()) != 0 )
46
- ConformanceTypeDecls.push_back (NTD);
44
+ bool walkToDeclPre (Decl *D) override {
45
+ if (auto *NTD = llvm::dyn_cast<NominalTypeDecl>(D))
46
+ if (!isa<ProtocolDecl>(NTD))
47
+ for (auto &Protocol : NTD->getAllProtocols ())
48
+ if (Protocols.count (Protocol->getName ().str ().str ()) != 0 )
49
+ ConformanceTypeDecls.push_back (NTD);
47
50
return true ;
48
51
}
49
52
};
You can’t perform that action at this time.
0 commit comments