Use a universal reference (&& instead of const &) for `debugString()` helper (NFC)
authorMehdi Amini <joker.eph@gmail.com>
Sat, 28 Aug 2021 00:40:28 +0000 (00:40 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Sat, 28 Aug 2021 00:41:41 +0000 (00:41 +0000)
Some classes like mlir::Operation have a non-const print() method.

mlir/include/mlir/Support/DebugStringHelper.h

index 0a94388..0a52f18 100644 (file)
@@ -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);