[Mlir-commits] [mlir] 4387975 - Use a universal reference (&& instead of const &) for `debugString()` helper (NFC)

Mehdi Amini llvmlistbot at llvm.org
Fri Aug 27 17:41:54 PDT 2021


Author: Mehdi Amini
Date: 2021-08-28T00:41:41Z
New Revision: 4387975170112ad51a6cb57b5b77ebd72cc73c57

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

LOG: Use a universal reference (&& instead of const &) for `debugString()` helper (NFC)

Some classes like mlir::Operation have a non-const print() method.

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 0a943880814d..0a52f1853e49 100644
--- a/mlir/include/mlir/Support/DebugStringHelper.h
+++ b/mlir/include/mlir/Support/DebugStringHelper.h
@@ -25,7 +25,7 @@ namespace mlir {
 
 // Simple helper function that returns a string as printed from a op.
 template <typename T>
-static std::string debugString(const T &op) {
+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