Skip to content

Commit 1461bd1

Browse files
committed
Revert "Define a cppAccessorType to const-ref in APFloatParameter and update ODS emitter to use it for verifier signatures"
This reverts commit 89af17c. This broke the gcc5 build.
1 parent 93c7918 commit 1461bd1

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

mlir/include/mlir/IR/OpBase.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3135,7 +3135,6 @@ class StringRefParameter<string desc = ""> :
31353135
class APFloatParameter<string desc> :
31363136
AttrOrTypeParameter<"::llvm::APFloat", desc> {
31373137
let comparator = "$_lhs.bitwiseIsEqual($_rhs)";
3138-
let cppAccessorType = "const ::llvm::APFloat &";
31393138
}
31403139

31413140
// For standard ArrayRefs, which require allocation.

mlir/lib/IR/BuiltinAttributes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ double FloatAttr::getValueAsDouble(APFloat value) {
283283
}
284284

285285
LogicalResult FloatAttr::verify(function_ref<InFlightDiagnostic()> emitError,
286-
Type type, const APFloat &value) {
286+
Type type, APFloat value) {
287287
// Verify that the type is correct.
288288
if (!type.isa<FloatType>())
289289
return emitError() << "expected floating point type";

mlir/test/lib/Dialect/Test/TestAttributes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ TestI64ElementsAttr::verify(function_ref<InFlightDiagnostic()> emitError,
129129

130130
LogicalResult
131131
TestAttrWithFormatAttr::verify(function_ref<InFlightDiagnostic()> emitError,
132-
int64_t one, StringRef two, IntegerAttr three,
132+
int64_t one, std::string two, IntegerAttr three,
133133
ArrayRef<int> four) {
134134
if (four.size() != static_cast<unsigned>(one))
135135
return emitError() << "expected 'one' to equal 'four.size()'";

mlir/test/mlir-tblgen/attrdefs.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ def B_CompoundAttrA : TestAttr<"CompoundA"> {
6161
let genVerifyDecl = 1;
6262

6363
// DECL-LABEL: class CompoundAAttr : public ::mlir::Attribute
64-
// DECL: static CompoundAAttr getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, int widthOfSomething, ::test::SimpleTypeA exampleTdType, const ::llvm::APFloat &apFloat, ::llvm::ArrayRef<int> dims, ::mlir::Type inner);
65-
// DECL: static ::mlir::LogicalResult verify(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, int widthOfSomething, ::test::SimpleTypeA exampleTdType, const ::llvm::APFloat &apFloat, ::llvm::ArrayRef<int> dims, ::mlir::Type inner);
64+
// DECL: static CompoundAAttr getChecked(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::MLIRContext *context, int widthOfSomething, ::test::SimpleTypeA exampleTdType, ::llvm::APFloat apFloat, ::llvm::ArrayRef<int> dims, ::mlir::Type inner);
65+
// DECL: static ::mlir::LogicalResult verify(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, int widthOfSomething, ::test::SimpleTypeA exampleTdType, ::llvm::APFloat apFloat, ::llvm::ArrayRef<int> dims, ::mlir::Type inner);
6666
// DECL: static constexpr ::llvm::StringLiteral getMnemonic() {
6767
// DECL: return {"cmpnd_a"};
6868
// DECL: }
@@ -71,7 +71,7 @@ def B_CompoundAttrA : TestAttr<"CompoundA"> {
7171
// DECL: void print(::mlir::AsmPrinter &printer) const;
7272
// DECL: int getWidthOfSomething() const;
7373
// DECL: ::test::SimpleTypeA getExampleTdType() const;
74-
// DECL: const ::llvm::APFloat &getApFloat() const;
74+
// DECL: ::llvm::APFloat getApFloat() const;
7575

7676
// Check that AttributeSelfTypeParameter is handled properly.
7777
// DEF-LABEL: struct CompoundAAttrStorage
@@ -139,5 +139,5 @@ def F_ParamWithAccessorTypeAttr : TestAttr<"ParamWithAccessorType"> {
139139
// DECL-LABEL: class ParamWithAccessorTypeAttr
140140
// DECL: StringRef getParam()
141141
// DEF: ParamWithAccessorTypeAttrStorage
142-
// DEF: ParamWithAccessorTypeAttrStorage(StringRef param)
142+
// DEF: ParamWithAccessorTypeAttrStorage(std::string param)
143143
// DEF: StringRef ParamWithAccessorTypeAttr::getParam()

mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ DefGen::getBuilderParams(std::initializer_list<MethodParameter> prefix) const {
315315
SmallVector<MethodParameter> builderParams;
316316
builderParams.append(prefix.begin(), prefix.end());
317317
for (auto &param : params)
318-
builderParams.emplace_back(param.getCppAccessorType(), param.getName());
318+
builderParams.emplace_back(param.getCppType(), param.getName());
319319
return builderParams;
320320
}
321321

0 commit comments

Comments
 (0)