Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Tooling/ArgumentsAdjusters.cpp
Show All 36 Lines | for (size_t i = 0, e = Args.size(); i < e; ++i) { | ||||
if (llvm::any_of(OutputCommands, [&Arg](llvm::StringRef OutputCommand) { | if (llvm::any_of(OutputCommands, [&Arg](llvm::StringRef OutputCommand) { | ||||
return Arg.startswith(OutputCommand); | return Arg.startswith(OutputCommand); | ||||
})) | })) | ||||
continue; | continue; | ||||
if (!Arg.startswith("-fcolor-diagnostics") && | if (!Arg.startswith("-fcolor-diagnostics") && | ||||
!Arg.startswith("-fdiagnostics-color")) | !Arg.startswith("-fdiagnostics-color")) | ||||
AdjustedArgs.push_back(Args[i]); | AdjustedArgs.push_back(Args[i]); | ||||
// If we strip a color option, make sure we strip any preceeding `-Xclang` | |||||
// option as well. | |||||
sammccall: Maybe add a FIXME: this should apply to most arg adjusters! | |||||
// FIXME: This should be added to most argument adjusters! | |||||
else if (!AdjustedArgs.empty() && AdjustedArgs.back() == "-Xclang") | |||||
AdjustedArgs.pop_back(); | |||||
if (Arg == "-fsyntax-only") | if (Arg == "-fsyntax-only") | ||||
HasSyntaxOnly = true; | HasSyntaxOnly = true; | ||||
} | } | ||||
if (!HasSyntaxOnly) | if (!HasSyntaxOnly) | ||||
AdjustedArgs.push_back("-fsyntax-only"); | AdjustedArgs.push_back("-fsyntax-only"); | ||||
return AdjustedArgs; | return AdjustedArgs; | ||||
}; | }; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |
Maybe add a FIXME: this should apply to most arg adjusters!