summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/TextDiagnosticPrinter.cpp
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2014-04-21 23:16:03 +0000
committerDiego Novillo <dnovillo@google.com>2014-04-21 23:16:03 +0000
commit9f2399773256b63b503c9c7432b92257d338e0b9 (patch)
treed880e1eb0a8852a0d42494461d2c9eff4cee2ffa /clang/lib/Frontend/TextDiagnosticPrinter.cpp
parent97d484342c36754609c8d68b373940cb45da0dea (diff)
downloadbcm5719-llvm-9f2399773256b63b503c9c7432b92257d338e0b9.tar.gz
bcm5719-llvm-9f2399773256b63b503c9c7432b92257d338e0b9.zip
Allow adding a value to a flag in diagnostics.
Summary: This allows callers of Diags.Report() to append a value to the name of the flag associated with the diagnostic. This is useful in cases like the -Rpass flag, where we want the diagnostic to show the name of the pass that matched the pattern. Instead of showing "... [-Rpass]", this allows us to show "... [-Rpass=passname]". Reviewers: rsmith CC: cfe-commits Differential Revision: http://reviews.llvm.org/D3441 llvm-svn: 206826
Diffstat (limited to 'clang/lib/Frontend/TextDiagnosticPrinter.cpp')
-rw-r--r--clang/lib/Frontend/TextDiagnosticPrinter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/TextDiagnosticPrinter.cpp b/clang/lib/Frontend/TextDiagnosticPrinter.cpp
index 3b5eca6dd9d..e0516146b1a 100644
--- a/clang/lib/Frontend/TextDiagnosticPrinter.cpp
+++ b/clang/lib/Frontend/TextDiagnosticPrinter.cpp
@@ -83,6 +83,9 @@ static void printDiagnosticOptions(raw_ostream &OS,
if (!Opt.empty()) {
OS << (Started ? "," : " [")
<< (DiagnosticIDs::isRemark(Info.getID()) ? "-R" : "-W") << Opt;
+ StringRef OptValue = Info.getDiags()->getFlagNameValue();
+ if (!OptValue.empty())
+ OS << "=" << OptValue;
Started = true;
}
}
OpenPOWER on IntegriCloud