[clang-tools-extra] r190803 - Fix for removing not included files from a compilation database.
Manuel Klimek
klimek at google.com
Tue Sep 17 01:06:05 PDT 2013
On Mon, Sep 16, 2013 at 10:12 PM, Ariel J. Bernal
<ariel.j.bernal at intel.com>wrote:
> Author: ajbernal
> Date: Mon Sep 16 15:12:22 2013
> New Revision: 190803
>
> URL: http://llvm.org/viewvc/llvm-project?rev=190803&view=rev
> Log:
> 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.
>
I'd suggest to add a regression test ...
Cheers,
/Manuel
>
> Modified:
> clang-tools-extra/trunk/clang-modernize/tool/ClangModernize.cpp
>
> Modified: clang-tools-extra/trunk/clang-modernize/tool/ClangModernize.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/tool/ClangModernize.cpp?rev=190803&r1=190802&r2=190803&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/clang-modernize/tool/ClangModernize.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-modernize/tool/ClangModernize.cpp Mon
> Sep 16 15:12:22 2013
> @@ -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()) {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130917/f1191695/attachment.html>
More information about the cfe-commits
mailing list