This revision was automatically updated to reflect the committed changes. Closed by commit rGda236f235028: Strip preceeding -Xclang when stripping -fcolor-diagnostics or -fdiagnostics… (authored by kadircet). Herald added a project: clang. Herald added a subscriber: cfe-commits.
Changed prior to commit: https://reviews.llvm.org/D75019?vs=246526&id=246638#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75019/new/ https://reviews.llvm.org/D75019 Files: clang/lib/Tooling/ArgumentsAdjusters.cpp Index: clang/lib/Tooling/ArgumentsAdjusters.cpp =================================================================== --- clang/lib/Tooling/ArgumentsAdjusters.cpp +++ clang/lib/Tooling/ArgumentsAdjusters.cpp @@ -42,6 +42,12 @@ if (!Arg.startswith("-fcolor-diagnostics") && !Arg.startswith("-fdiagnostics-color")) AdjustedArgs.push_back(Args[i]); + // If we strip a color option, make sure we strip any preceeding `-Xclang` + // option as well. + // FIXME: This should be added to most argument adjusters! + else if (!AdjustedArgs.empty() && AdjustedArgs.back() == "-Xclang") + AdjustedArgs.pop_back(); + if (Arg == "-fsyntax-only") HasSyntaxOnly = true; }
Index: clang/lib/Tooling/ArgumentsAdjusters.cpp =================================================================== --- clang/lib/Tooling/ArgumentsAdjusters.cpp +++ clang/lib/Tooling/ArgumentsAdjusters.cpp @@ -42,6 +42,12 @@ if (!Arg.startswith("-fcolor-diagnostics") && !Arg.startswith("-fdiagnostics-color")) AdjustedArgs.push_back(Args[i]); + // If we strip a color option, make sure we strip any preceeding `-Xclang` + // option as well. + // FIXME: This should be added to most argument adjusters! + else if (!AdjustedArgs.empty() && AdjustedArgs.back() == "-Xclang") + AdjustedArgs.pop_back(); + if (Arg == "-fsyntax-only") HasSyntaxOnly = true; }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits