@@ -416,7 +416,6 @@ class ModelASTWalker : public ASTWalker {
416416private:
417417 static bool findUrlStartingLoc (StringRef Text, unsigned &Start,
418418 std::regex& Regex);
419- bool annotateIfConfigConditionIdentifiers (Expr *Cond);
420419 bool handleAttrs (const ParsedDeclAttributes &Attrs);
421420 bool handleAttrs (ArrayRef<TypeOrCustomAttr> Attrs);
422421
@@ -1003,24 +1002,8 @@ ASTWalker::PreWalkAction ModelASTWalker::walkToDeclPre(Decl *D) {
10031002 }
10041003 pushStructureNode (SN, VD);
10051004
1006- } else if (auto *ConfigD = dyn_cast<IfConfigDecl>(D)) {
1007- for (auto &Clause : ConfigD->getClauses ()) {
1008- if (Clause.Cond && !annotateIfConfigConditionIdentifiers (Clause.Cond ))
1009- return Action::SkipNode ();
1010-
1011- InactiveClauseRAII inactiveClauseRAII (inInactiveClause, !Clause.isActive );
1012- for (auto &Element : Clause.Elements ) {
1013- if (auto *E = Element.dyn_cast <Expr*>()) {
1014- E->walk (*this );
1015- } else if (auto *S = Element.dyn_cast <Stmt*>()) {
1016- S->walk (*this );
1017- } else {
1018- Element.get <Decl*>()->walk (*this );
1019- }
1020- NodesVisitedBefore.insert (Element);
1021- }
1022- }
1023-
1005+ } else if (isa<IfConfigDecl>(D)) {
1006+ // Note: nothing to do.
10241007 } else if (auto *EnumCaseD = dyn_cast<EnumCaseDecl>(D)) {
10251008 SyntaxStructureNode SN;
10261009 setDecl (SN, D);
@@ -1172,17 +1155,6 @@ class IdRefWalker : public ASTWalker {
11721155};
11731156} // end anonymous namespace
11741157
1175- bool ModelASTWalker::annotateIfConfigConditionIdentifiers (Expr *Cond) {
1176- if (!Cond)
1177- return true ;
1178- auto passNode = [&](CharSourceRange R) {
1179- return passNonTokenNode ({ SyntaxNodeKind::BuildConfigId, R });
1180- };
1181-
1182- IdRefWalker<decltype (passNode)> Walker (passNode);
1183- return Cond->walk (Walker);
1184- }
1185-
11861158bool ModelASTWalker::handleSpecialDeclAttribute (const DeclAttribute *D,
11871159 ArrayRef<Token> Toks) {
11881160 if (!D)
0 commit comments