forked from OSchip/llvm-project
Fix for removing not included files from a compilation database.
remove_if doesn't alter the container properties. Need to use erase to remove the elements past the new end. llvm-svn: 190803
This commit is contained in:
parent
6e2dd7b553
commit
defd1a93c9
|
@ -360,7 +360,9 @@ int main(int argc, const char **argv) {
|
|||
// Use source paths from the compilation database.
|
||||
// We only transform files that are explicitly included.
|
||||
Sources = Compilations->getAllFiles();
|
||||
std::remove_if(Sources.begin(), Sources.end(), isFileNotIncludedPredicate);
|
||||
std::vector<std::string>::iterator E = std::remove_if(
|
||||
Sources.begin(), Sources.end(), isFileNotIncludedPredicate);
|
||||
Sources.erase(E, Sources.end());
|
||||
}
|
||||
|
||||
if (Sources.empty()) {
|
||||
|
|
Loading…
Reference in New Issue