From 4846e66fdd510349d1fbd1c60b9f882a5b3ff585 Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Mon, 28 Aug 2017 23:00:13 +0000 Subject: Remove an unnecessary const_cast. I think that this is dating back to when emit used to take a const reference. llvm-svn: 311948 --- llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp') diff --git a/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp b/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp index eb259fd7a38..c31de0fc42e 100644 --- a/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp +++ b/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp @@ -165,7 +165,8 @@ void OptimizationRemarkEmitter::emit( yaml::Output *Out = F->getContext().getDiagnosticsOutputFile(); if (Out) { - auto *P = const_cast(&OptDiagBase); + // For remarks the << operator takes a reference to a pointer. + auto *P = &OptDiagBase; *Out << P; } // FIXME: now that IsVerbose is part of DI, filtering for this will be moved -- cgit v1.2.3