summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2016-11-07 22:41:13 +0000
committerAdam Nemet <anemet@apple.com>2016-11-07 22:41:13 +0000
commitb103fc52d3ae1fb23414a3bd454aabacd1e7db1e (patch)
tree580ee3dae50d0422eb11101d3da1e1aa64796cd5 /llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp
parent6f020d91a1cd22352cead0fdcd6b17052663c52f (diff)
downloadbcm5719-llvm-b103fc52d3ae1fb23414a3bd454aabacd1e7db1e.tar.gz
bcm5719-llvm-b103fc52d3ae1fb23414a3bd454aabacd1e7db1e.zip
[OptDiag, opt-viewer] Save callee's location and display as link
With this we get a new field in the YAML record if the value being streamed out has a debug location. For examples, please see the changes to the tests. This is then used in opt-viewer to display a link for the callee function in the inlining remarks. Differential Revision: https://reviews.llvm.org/D26366 llvm-svn: 286169
Diffstat (limited to 'llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp')
-rw-r--r--llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp b/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp
index 6584876f20a..0a5ef1b9b23 100644
--- a/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp
+++ b/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp
@@ -115,6 +115,8 @@ template <> struct MappingTraits<DiagnosticInfoOptimizationBase::Argument> {
static void mapping(IO &io, DiagnosticInfoOptimizationBase::Argument &A) {
assert(io.outputting() && "input not yet implemented");
io.mapRequired(A.Key.data(), A.Val);
+ if (A.DLoc)
+ io.mapOptional("DebugLoc", A.DLoc);
}
};
OpenPOWER on IntegriCloud