Ignore macros and implicit AST nodes, as well as anything outside of the
main source file.
Details
Diff Detail
- Build Status
Buildable 9220 Build 9220: arc lint + arc unit
Event Timeline
Just as a general note: adding cfe-commits after the fact is usually not a good idea, as we lose the history of the review in the email list (which is the source of truth).
implicit nodes are noisy / they generally don't add information; I guess one could also keep them.
I excluded nodes outside of the main file are because the visualisation only works with single files for now.
That will change, same as with macros.
| lib/Tooling/ASTDiff/ASTDiff.cpp | ||
|---|---|---|
| 181 | You should just use one call isNodeExcluded that will redirect to node-specific overload, and avoid the multiple clauses in conditions, i.e..: static bool isSpecializedNodeExcluded(const Decl *D) { }
static bool isSpecializedNodeExcluded(const Stmt *S) {}
template <class T>
static bool isNodeExcluded(const SourceManager &SrcMgr, T *N) {
.... current code ...
return isSpecializedNodeExcluded(N);
}Then you can use if (isNodeExcluded(Tree.AST.getSourceManager(), D)) everywhere. | |
| test/Tooling/clang-diff-ast.cpp | ||
|---|---|---|
| 68 |
| |
| test/Tooling/clang-diff-ast.cpp | ||
|---|---|---|
| 68 | I want to assert that there is no output here, because other files are excluded, there may be a better way.. | |
You should just use one call isNodeExcluded that will redirect to node-specific overload, and avoid the multiple clauses in conditions, i.e..:
static bool isSpecializedNodeExcluded(const Decl *D) { } static bool isSpecializedNodeExcluded(const Stmt *S) {} template <class T> static bool isNodeExcluded(const SourceManager &SrcMgr, T *N) { .... current code ... return isSpecializedNodeExcluded(N); }Then you can use if (isNodeExcluded(Tree.AST.getSourceManager(), D)) everywhere.