Skip to content

Commit 59df1df

Browse files
committed
[NFC][MLIR][TableGen] Drop namespace around op constraints functions
Op constraints are emitted as uniqued static standalone funtions and need not be surrounded by the Op's C++ namespace.
1 parent 08e9540 commit 59df1df

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

mlir/include/mlir/TableGen/CodeGenHelpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class StaticVerifierFunctionEmitter {
8888
///
8989
/// Constraints that do not meet the restriction that they can only reference
9090
/// `$_self` and `$_op` are not uniqued.
91-
void emitOpConstraints(ArrayRef<const llvm::Record *> opDefs);
91+
void emitOpConstraints();
9292

9393
/// Unique all compatible type and attribute constraints from a pattern file
9494
/// and emit them at the top of the generated file.

mlir/lib/TableGen/CodeGenHelpers.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ StaticVerifierFunctionEmitter::StaticVerifierFunctionEmitter(
4949
raw_ostream &os, const RecordKeeper &records, StringRef tag)
5050
: os(os), uniqueOutputLabel(getUniqueOutputLabel(records, tag)) {}
5151

52-
void StaticVerifierFunctionEmitter::emitOpConstraints(
53-
ArrayRef<const Record *> opDefs) {
54-
NamespaceEmitter namespaceEmitter(os, Operator(*opDefs[0]).getCppNamespace());
52+
void StaticVerifierFunctionEmitter::emitOpConstraints() {
5553
emitTypeConstraints();
5654
emitAttrConstraints();
5755
emitPropConstraints();

mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4871,7 +4871,7 @@ static void emitOpClassDefs(const RecordKeeper &records,
48714871
constraintPrefix);
48724872
os << formatv(opCommentHeader, "Local Utility Method", "Definitions");
48734873
staticVerifierEmitter.collectOpConstraints(defs);
4874-
staticVerifierEmitter.emitOpConstraints(defs);
4874+
staticVerifierEmitter.emitOpConstraints();
48754875

48764876
// Emit the classes.
48774877
emitOpClasses(records, defs, os, staticVerifierEmitter,

0 commit comments

Comments
 (0)