[MLIR][Pass] Have PassRegistryEntry own pass strings
authorDaniel Resnick <danielzresnick@gmail.com>
Tue, 22 Feb 2022 17:41:48 +0000 (10:41 -0700)
committerDaniel Resnick <danielzresnick@gmail.com>
Wed, 23 Feb 2022 17:04:04 +0000 (10:04 -0700)
This eliminates the requirement that pass-related strings outlive pass
instances, which will facilitate future work enabling dynamic passes
written in other languages.

Differential Revision: https://reviews.llvm.org/D120341

mlir/include/mlir/Pass/PassRegistry.h

index 9167751..496bac7 100644 (file)
@@ -81,10 +81,10 @@ protected:
 
 private:
   /// The argument with which to invoke the pass via mlir-opt.
-  StringRef arg;
+  std::string arg;
 
   /// Description of the pass.
-  StringRef description;
+  std::string description;
 
   /// Function to register this entry to a pass manager pipeline.
   PassRegistryFunction builder;