Index: mlir/test/lib/Dialect/Test/TestDialect.h =================================================================== --- mlir/test/lib/Dialect/Test/TestDialect.h +++ mlir/test/lib/Dialect/Test/TestDialect.h @@ -65,10 +65,10 @@ struct TestDialectVersion : public mlir::DialectVersion { TestDialectVersion() = default; - TestDialectVersion(uint32_t _major, uint32_t _minor) - : major(_major), minor(_minor){}; - uint32_t major = 2; - uint32_t minor = 0; + TestDialectVersion(uint32_t major_version, uint32_t minor_version) + : major_(major_version), minor_(minor_version){}; + uint32_t major_ = 2; + uint32_t minor_ = 0; }; // Define some classes to exercises the Properties feature. Index: mlir/test/lib/Dialect/Test/TestDialect.cpp =================================================================== --- mlir/test/lib/Dialect/Test/TestDialect.cpp +++ mlir/test/lib/Dialect/Test/TestDialect.cpp @@ -1293,7 +1293,7 @@ // We can materialize missing properties post parsing before verification. const auto *version = reinterpret_cast(*maybeVersion); - if ((version->major < 2)) { + if ((version->major_ < 2)) { return success(); } } @@ -1324,7 +1324,7 @@ // We can materialize missing properties post parsing before verification. const auto *version = reinterpret_cast(*maybeVersion); - if ((version->major < 2)) + if ((version->major_ < 2)) needToParseAnotherInt = false; } if (needToParseAnotherInt && failed(reader.readVarInt(value2))) Index: mlir/test/lib/Dialect/Test/TestDialectInterfaces.cpp =================================================================== --- mlir/test/lib/Dialect/Test/TestDialectInterfaces.cpp +++ mlir/test/lib/Dialect/Test/TestDialectInterfaces.cpp @@ -83,9 +83,9 @@ (succeeded(versionOr)) ? *reinterpret_cast(*versionOr) : TestDialectVersion(); - if (version.major < 2) + if (version.major_ < 2) return readAttrOldEncoding(reader); - if (version.major == 2 && version.minor == 0) + if (version.major_ == 2 && version.minor_ == 0) return readAttrNewEncoding(reader); // Forbid reading future versions by returning nullptr. return Attribute(); @@ -94,30 +94,30 @@ // Emit a specific version of the dialect. void writeVersion(DialectBytecodeWriter &writer) const final { auto version = TestDialectVersion(); - writer.writeVarInt(version.major); // major - writer.writeVarInt(version.minor); // minor + writer.writeVarInt(version.major_); // major + writer.writeVarInt(version.minor_); // minor } std::unique_ptr readVersion(DialectBytecodeReader &reader) const final { - uint64_t major, minor; - if (failed(reader.readVarInt(major)) || failed(reader.readVarInt(minor))) + uint64_t major_, minor_; + if (failed(reader.readVarInt(major_)) || failed(reader.readVarInt(minor_))) return nullptr; auto version = std::make_unique(); - version->major = major; - version->minor = minor; + version->major_ = major_; + version->minor_ = minor_; return version; } LogicalResult upgradeFromVersion(Operation *topLevelOp, const DialectVersion &version_) const final { const auto &version = static_cast(version_); - if ((version.major == 2) && (version.minor == 0)) + if ((version.major_ == 2) && (version.minor_ == 0)) return success(); - if (version.major > 2 || (version.major == 2 && version.minor > 0)) { + if (version.major_ > 2 || (version.major_ == 2 && version.minor_ > 0)) { return topLevelOp->emitError() << "current test dialect version is 2.0, can't parse version: " - << version.major << "." << version.minor; + << version.major_ << "." << version.minor_; } // Prior version 2.0, the old op supported only a single attribute called // "dimensions". We can perform the upgrade. Index: mlir/test/lib/IR/TestBytecodeCallbacks.cpp =================================================================== --- mlir/test/lib/IR/TestBytecodeCallbacks.cpp +++ mlir/test/lib/IR/TestBytecodeCallbacks.cpp @@ -29,17 +29,17 @@ bool parse(cl::Option &O, StringRef /*argName*/, StringRef arg, test::TestDialectVersion &v) { - long long major, minor; - if (getAsSignedInteger(arg.split(".").first, 10, major)) + long long major_, minor_; + if (getAsSignedInteger(arg.split(".").first, 10, major_)) return O.error("Invalid argument '" + arg); - if (getAsSignedInteger(arg.split(".").second, 10, minor)) + if (getAsSignedInteger(arg.split(".").second, 10, minor_)) return O.error("Invalid argument '" + arg); - v = test::TestDialectVersion(major, minor); + v = test::TestDialectVersion(major_, minor_); // Returns true on error. return false; } static void print(raw_ostream &os, const test::TestDialectVersion &v) { - os << v.major << "." << v.minor; + os << v.major_ << "." << v.minor_; }; }; @@ -127,7 +127,7 @@ [&](Type entryValue, std::optional &dialectGroupName, DialectBytecodeWriter &writer) -> LogicalResult { // Do not override anything if version less than 2.0. - if (targetEmissionVersion.major >= 2) + if (targetEmissionVersion.major_ >= 2) return failure(); // For version less than 2.0, override the encoding of IntegerType. @@ -159,7 +159,7 @@ // supported. For the purpose of the test, just use // `targetEmissionVersion`. (void)version; - if (targetEmissionVersion.major >= 2) + if (targetEmissionVersion.major_ >= 2) return success(); // `dialectName` is the name of the group we have the opportunity to