Revert "Define a cppAccessorType to const-ref in APFloatParameter and update ODS emitter to use it for verifier signatures"

This reverts commit 89af17c0c7.

This broke the gcc5 build.
This commit is contained in:
Mehdi Amini 2022-01-03 06:31:44 +00:00
parent 93c791839a
commit 1461bd13c9
5 changed files with 7 additions and 8 deletions

View file

@ -3135,7 +3135,6 @@ class StringRefParameter<string desc = ""> :
class APFloatParameter<string desc> :
AttrOrTypeParameter<"::llvm::APFloat", desc> {
let comparator = "$_lhs.bitwiseIsEqual($_rhs)";
let cppAccessorType = "const ::llvm::APFloat &";
}
// For standard ArrayRefs, which require allocation.

View file

@ -283,7 +283,7 @@ double FloatAttr::getValueAsDouble(APFloat value) {
}
LogicalResult FloatAttr::verify(function_ref<InFlightDiagnostic()> emitError,
Type type, const APFloat &value) {
Type type, APFloat value) {
// Verify that the type is correct.
if (!type.isa<FloatType>())
return emitError() << "expected floating point type";

View file

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

View file

@ -61,8 +61,8 @@ def B_CompoundAttrA : TestAttr<"CompoundA"> {
let genVerifyDecl = 1;
// DECL-LABEL: class CompoundAAttr : public ::mlir::Attribute
// 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);
// 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);
// 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);
// 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);
// DECL: static constexpr ::llvm::StringLiteral getMnemonic() {
// DECL: return {"cmpnd_a"};
// DECL: }
@ -71,7 +71,7 @@ def B_CompoundAttrA : TestAttr<"CompoundA"> {
// DECL: void print(::mlir::AsmPrinter &printer) const;
// DECL: int getWidthOfSomething() const;
// DECL: ::test::SimpleTypeA getExampleTdType() const;
// DECL: const ::llvm::APFloat &getApFloat() const;
// DECL: ::llvm::APFloat getApFloat() const;
// Check that AttributeSelfTypeParameter is handled properly.
// DEF-LABEL: struct CompoundAAttrStorage
@ -139,5 +139,5 @@ def F_ParamWithAccessorTypeAttr : TestAttr<"ParamWithAccessorType"> {
// DECL-LABEL: class ParamWithAccessorTypeAttr
// DECL: StringRef getParam()
// DEF: ParamWithAccessorTypeAttrStorage
// DEF: ParamWithAccessorTypeAttrStorage(StringRef param)
// DEF: ParamWithAccessorTypeAttrStorage(std::string param)
// DEF: StringRef ParamWithAccessorTypeAttr::getParam()

View file

@ -315,7 +315,7 @@ DefGen::getBuilderParams(std::initializer_list<MethodParameter> prefix) const {
SmallVector<MethodParameter> builderParams;
builderParams.append(prefix.begin(), prefix.end());
for (auto &param : params)
builderParams.emplace_back(param.getCppAccessorType(), param.getName());
builderParams.emplace_back(param.getCppType(), param.getName());
return builderParams;
}