aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Tooling/ArgumentsAdjusters.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Tooling/ArgumentsAdjusters.cpp')
-rw-r--r--lib/Tooling/ArgumentsAdjusters.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Tooling/ArgumentsAdjusters.cpp b/lib/Tooling/ArgumentsAdjusters.cpp
index 942b35df453e..f56d08c47b9a 100644
--- a/lib/Tooling/ArgumentsAdjusters.cpp
+++ b/lib/Tooling/ArgumentsAdjusters.cpp
@@ -57,6 +57,22 @@ ArgumentsAdjuster getClangStripOutputAdjuster() {
};
}
+ArgumentsAdjuster getClangStripSerializeDiagnosticAdjuster() {
+ return [](const CommandLineArguments &Args, StringRef /*unused*/) {
+ CommandLineArguments AdjustedArgs;
+ for (size_t i = 0, e = Args.size(); i < e; ++i) {
+ StringRef Arg = Args[i];
+ if (Arg == "--serialize-diagnostics") {
+ // Skip the diagnostic output argument.
+ ++i;
+ continue;
+ }
+ AdjustedArgs.push_back(Args[i]);
+ }
+ return AdjustedArgs;
+ };
+}
+
ArgumentsAdjuster getClangStripDependencyFileAdjuster() {
return [](const CommandLineArguments &Args, StringRef /*unused*/) {
CommandLineArguments AdjustedArgs;