[Mlir-commits] [mlir] 6d6ad76 - [mlir][NFC] Provide accessor for TableGen record for constraints

River Riddle llvmlistbot at llvm.org
Mon Oct 18 08:54:50 PDT 2021


Author: Mathieu Fehr
Date: 2021-10-18T15:46:08Z
New Revision: 6d6ad76a6037f0aac03f122371cf60af65482989

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

LOG: [mlir][NFC] Provide accessor for TableGen record for constraints

Besides accessing the record, there is currently no way to access all possible
constraint informations, such as the base constraint of a variadic constraint
for example.

Reviewed By: rriddle

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

Added: 
    

Modified: 
    mlir/include/mlir/TableGen/Constraint.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/TableGen/Constraint.h b/mlir/include/mlir/TableGen/Constraint.h
index 4a74cac6dc69e..5ecf326da1e79 100644
--- a/mlir/include/mlir/TableGen/Constraint.h
+++ b/mlir/include/mlir/TableGen/Constraint.h
@@ -59,6 +59,9 @@ class Constraint {
     return Constraint(reinterpret_cast<const llvm::Record *>(ptr));
   }
 
+  // Return the underlying def.
+  const llvm::Record *getDef() const { return def; }
+
 protected:
   Constraint(Kind kind, const llvm::Record *record);
 


        


More information about the Mlir-commits mailing list