@@ -416,7 +416,6 @@ class ModelASTWalker : public ASTWalker {
416
416
private:
417
417
static bool findUrlStartingLoc (StringRef Text, unsigned &Start,
418
418
std::regex& Regex);
419
- bool annotateIfConfigConditionIdentifiers (Expr *Cond);
420
419
bool handleAttrs (const ParsedDeclAttributes &Attrs);
421
420
bool handleAttrs (ArrayRef<TypeOrCustomAttr> Attrs);
422
421
@@ -1003,24 +1002,8 @@ ASTWalker::PreWalkAction ModelASTWalker::walkToDeclPre(Decl *D) {
1003
1002
}
1004
1003
pushStructureNode (SN, VD);
1005
1004
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.
1024
1007
} else if (auto *EnumCaseD = dyn_cast<EnumCaseDecl>(D)) {
1025
1008
SyntaxStructureNode SN;
1026
1009
setDecl (SN, D);
@@ -1172,17 +1155,6 @@ class IdRefWalker : public ASTWalker {
1172
1155
};
1173
1156
} // end anonymous namespace
1174
1157
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
-
1186
1158
bool ModelASTWalker::handleSpecialDeclAttribute (const DeclAttribute *D,
1187
1159
ArrayRef<Token> Toks) {
1188
1160
if (!D)
0 commit comments