[Mlir-commits] [mlir] c0b70de - Specify argument to be `const` for `debugString()` helper (NFC)

Mehdi Amini llvmlistbot at llvm.org
Fri Aug 27 17:11:07 PDT 2021


Author: Mehdi Amini
Date: 2021-08-28T00:10:53Z
New Revision: c0b70def210edfa52c0165682fecf080166b468f

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

LOG: Specify argument to be `const` for `debugString()` helper (NFC)

This allows using this helper with rvalues.

Added: 
    

Modified: 
    mlir/include/mlir/Support/DebugStringHelper.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Support/DebugStringHelper.h b/mlir/include/mlir/Support/DebugStringHelper.h
index 92acc4f515ad..0a943880814d 100644
--- a/mlir/include/mlir/Support/DebugStringHelper.h
+++ b/mlir/include/mlir/Support/DebugStringHelper.h
@@ -24,7 +24,8 @@
 namespace mlir {
 
 // Simple helper function that returns a string as printed from a op.
-template <typename T> static std::string debugString(T &op) {
+template <typename T>
+static std::string debugString(const T &op) {
   std::string instr_str;
   llvm::raw_string_ostream os(instr_str);
   op.print(os);


        


More information about the Mlir-commits mailing list