diff options
Diffstat (limited to 'llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp b/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp index d3f7493a787..7198e474d4b 100644 --- a/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp +++ b/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp @@ -99,28 +99,27 @@ void MappingTraits<DiagnosticInfoOptimizationBase *>::mapping( llvm_unreachable("Unknown remark type"); // These are read-only for now. - DebugLoc DL = OptDiag->getDebugLoc(); + DiagnosticLocation DL = OptDiag->getLocation(); StringRef FN = GlobalValue::getRealLinkageName(OptDiag->getFunction().getName()); StringRef PassName(OptDiag->PassName); io.mapRequired("Pass", PassName); io.mapRequired("Name", OptDiag->RemarkName); - if (!io.outputting() || DL) + if (!io.outputting() || DL.isValid()) io.mapOptional("DebugLoc", DL); io.mapRequired("Function", FN); io.mapOptional("Hotness", OptDiag->Hotness); io.mapOptional("Args", OptDiag->Args); } -template <> struct MappingTraits<DebugLoc> { - static void mapping(IO &io, DebugLoc &DL) { +template <> struct MappingTraits<DiagnosticLocation> { + static void mapping(IO &io, DiagnosticLocation &DL) { assert(io.outputting() && "input not yet implemented"); - auto *Scope = cast<DIScope>(DL.getScope()); - StringRef File = Scope->getFilename(); + StringRef File = DL.getFilename(); unsigned Line = DL.getLine(); - unsigned Col = DL.getCol(); + unsigned Col = DL.getColumn(); io.mapRequired("File", File); io.mapRequired("Line", Line); @@ -135,8 +134,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); + if (A.Loc.isValid()) + io.mapOptional("DebugLoc", A.Loc); } }; |