8000 Do not pollute output with 'non-toplevel-identifiers' in debug mode. · arduino/arduino-preprocessor@f195c49 · GitHub
[go: up one dir, main page]

Skip to content

Commit f195c49

Browse files
committed
Do not pollute output with 'non-toplevel-identifiers' in debug mode.
1 parent addd97c commit f195c49

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

main.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@ class INOPreprocessorMatcherCallback : public MatchFinder::MatchCallback {
142142

143143
const VarDecl *v = match.Nodes.getNodeAs<VarDecl>("var_decl");
144144
if (v) {
145+
if (v->getParentFunctionOrMethod()) {
146+
//if (debugOutput) {
147+
// outs() << " Variable is not top level, ignoring.\n";
148+
//}
149+
return;
150+
}
151+
145152
FullSourceLoc loc = ctx->getFullLoc(v->getLocStart());
146153
SourceRange r = v->getSourceRange();
147154
FullSourceLoc begin = ctx->getFullLoc(r.getBegin());
@@ -153,12 +160,6 @@ class INOPreprocessorMatcherCallback : public MatchFinder::MatchCallback {
153160
outs() << " (range " << begin.getSpellingLineNumber() << ":" << begin.getSpellingColumnNumber();
154161
outs() << " to " << end.getSpellingLineNumber() << ":" << end.getSpellingColumnNumber() << ")\n";
155162
}
156-
if (v->getParentFunctionOrMethod()) {
157-
if (debugOutput) {
158-
outs() << " Variable is not top level, ignoring.\n";
159-
}
160-
return;
161-
}
162163

163164
detectInsertionPoint(sm, begin, end);
164165
}

0 commit comments

Comments
 (0)
0