Skip to content

Commit

Permalink
Merge pull request Ericsson#556 from mcserep/filter-cpp-compile-commands
Browse files Browse the repository at this point in the history
Filter C/C++ compile commands
  • Loading branch information
intjftw authored Feb 21, 2022
2 parents 52327cd + 05f3e24 commit 5e1c7a0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugins/cpp/parser/src/cppparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,15 @@ bool CppParser::parseByJson(

std::vector<clang::tooling::CompileCommand> compileCommands =
compDb->getAllCompileCommands();

compileCommands.erase(
std::remove_if(compileCommands.begin(), compileCommands.end(),
[&](const clang::tooling::CompileCommand& c)
{
return !isSourceFile(c.Filename);
}),
compileCommands.end());

std::size_t numCompileCommands = compileCommands.size();

//--- Create a thread pool for the current commands ---//
Expand Down

0 comments on commit 5e1c7a0

Please sign in to comment.