Skip to content

Commit 49c3a3c

Browse files
iamirzhanmeta-codesync[bot]
authored andcommitted
Skip declarations from external files
Summary: We don't need to traverse declarations coming from external file (c++ module). As pcm file will be added in the next diff it will make the traversal very slow. So, we're skipping these declarations in this diff Reviewed By: phlalx Differential Revision: D95952152 fbshipit-source-id: accbf6ae46ce938313b0150371984ba721b94c5f
1 parent 16c05c1 commit 49c3a3c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

glean/lang/clang/ast.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2716,6 +2716,11 @@ struct ASTVisitor : public clang::RecursiveASTVisitor<ASTVisitor> {
27162716
}
27172717

27182718
bool TraverseDecl(clang::Decl* decl) {
2719+
// Skip declarations from modules/PCM files and continue traversing the AST
2720+
if (decl && decl->isFromASTFile()) {
2721+
return true;
2722+
}
2723+
27192724
clang::DeclContext* context = nullptr;
27202725

27212726
folly::Optional<Cxx::Declaration> gleanDecl;

0 commit comments

Comments
 (0)