Skip to content

Commit 5e1c7a0

Browse files
authored
Merge pull request #556 from mcserep/filter-cpp-compile-commands
Filter C/C++ compile commands
2 parents 52327cd + 05f3e24 commit 5e1c7a0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

plugins/cpp/parser/src/cppparser.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,15 @@ bool CppParser::parseByJson(
750750

751751
std::vector<clang::tooling::CompileCommand> compileCommands =
752752
compDb->getAllCompileCommands();
753+
754+
compileCommands.erase(
755+
std::remove_if(compileCommands.begin(), compileCommands.end(),
756+
[&](const clang::tooling::CompileCommand& c)
757+
{
758+
return !isSourceFile(c.Filename);
759+
}),
760+
compileCommands.end());
761+
753762
std::size_t numCompileCommands = compileCommands.size();
754763

755764
//--- Create a thread pool for the current commands ---//

0 commit comments

Comments
 (0)