[Mlir-commits] [mlir] a978847 - Use const reference for diagnostic in callback (NFC)

Mehdi Amini llvmlistbot at llvm.org
Sat Jan 1 13:20:44 PST 2022


Author: Mehdi Amini
Date: 2022-01-01T21:15:50Z
New Revision: a978847e3aa4bdd64b242a31bc9037019581d1e3

URL: https://github.com/llvm/llvm-project/commit/a978847e3aa4bdd64b242a31bc9037019581d1e3
DIFF: https://github.com/llvm/llvm-project/commit/a978847e3aa4bdd64b242a31bc9037019581d1e3.diff

LOG: Use const reference for diagnostic in callback (NFC)

This isn't a "small" struct, flagged by Coverity.

Added: 
    

Modified: 
    mlir/lib/IR/Diagnostics.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/IR/Diagnostics.cpp b/mlir/lib/IR/Diagnostics.cpp
index 327264a046c88..2e2a1465ac0f8 100644
--- a/mlir/lib/IR/Diagnostics.cpp
+++ b/mlir/lib/IR/Diagnostics.cpp
@@ -907,7 +907,7 @@ struct ParallelDiagnosticHandlerImpl : public llvm::PrettyStackTraceEntry {
       return;
 
     os << "In-Flight Diagnostics:\n";
-    emitDiagnostics([&](Diagnostic diag) {
+    emitDiagnostics([&](const Diagnostic &diag) {
       os.indent(4);
 
       // Print each diagnostic with the format:


        


More information about the Mlir-commits mailing list