summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenAction.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/CodeGen/CodeGenAction.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/CodeGen/CodeGenAction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index 67859bad2b4..5952e671b5b 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -404,7 +404,8 @@ void BackendConsumer::OptimizationRemarkHandler(
Loc = SourceMgr.translateFileLineCol(FileMgr.getFile(Filename), Line,
Column);
}
- Diags.Report(Loc, diag::remark_fe_backend_optimization_remark)
+ Diags.Report(Loc, diag::remark_fe_backend_optimization_remark,
+ D.getPassName())
<< D.getMsg().str();
if (Line == 0)
OpenPOWER on IntegriCloud