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:
parent
93c791839a
commit
1461bd13c9
|
@ -3135,7 +3135,6 @@ class StringRefParameter<string desc = ""> :
|
||||||
class APFloatParameter<string desc> :
|
class APFloatParameter<string desc> :
|
||||||
AttrOrTypeParameter<"::llvm::APFloat", desc> {
|
AttrOrTypeParameter<"::llvm::APFloat", desc> {
|
||||||
let comparator = "$_lhs.bitwiseIsEqual($_rhs)";
|
let comparator = "$_lhs.bitwiseIsEqual($_rhs)";
|
||||||
let cppAccessorType = "const ::llvm::APFloat &";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// For standard ArrayRefs, which require allocation.
|
// For standard ArrayRefs, which require allocation.
|
||||||
|
|
|
@ -283,7 +283,7 @@ double FloatAttr::getValueAsDouble(APFloat value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
LogicalResult FloatAttr::verify(function_ref<InFlightDiagnostic()> emitError,
|
LogicalResult FloatAttr::verify(function_ref<InFlightDiagnostic()> emitError,
|
||||||
Type type, const APFloat &value) {
|
Type type, APFloat value) {
|
||||||
// Verify that the type is correct.
|
// Verify that the type is correct.
|
||||||
if (!type.isa<FloatType>())
|
if (!type.isa<FloatType>())
|
||||||
return emitError() << "expected floating point type";
|
return emitError() << "expected floating point type";
|
||||||
|
|
|
@ -129,7 +129,7 @@ TestI64ElementsAttr::verify(function_ref<InFlightDiagnostic()> emitError,
|
||||||
|
|
||||||
LogicalResult
|
LogicalResult
|
||||||
TestAttrWithFormatAttr::verify(function_ref<InFlightDiagnostic()> emitError,
|
TestAttrWithFormatAttr::verify(function_ref<InFlightDiagnostic()> emitError,
|
||||||
int64_t one, StringRef two, IntegerAttr three,
|
int64_t one, std::string two, IntegerAttr three,
|
||||||
ArrayRef<int> four) {
|
ArrayRef<int> four) {
|
||||||
if (four.size() != static_cast<unsigned>(one))
|
if (four.size() != static_cast<unsigned>(one))
|
||||||
return emitError() << "expected 'one' to equal 'four.size()'";
|
return emitError() << "expected 'one' to equal 'four.size()'";
|
||||||
|
|
|
@ -61,8 +61,8 @@ def B_CompoundAttrA : TestAttr<"CompoundA"> {
|
||||||
let genVerifyDecl = 1;
|
let genVerifyDecl = 1;
|
||||||
|
|
||||||
// DECL-LABEL: class CompoundAAttr : public ::mlir::Attribute
|
// 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 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, 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, ::llvm::APFloat apFloat, ::llvm::ArrayRef<int> dims, ::mlir::Type inner);
|
||||||
// DECL: static constexpr ::llvm::StringLiteral getMnemonic() {
|
// DECL: static constexpr ::llvm::StringLiteral getMnemonic() {
|
||||||
// DECL: return {"cmpnd_a"};
|
// DECL: return {"cmpnd_a"};
|
||||||
// DECL: }
|
// DECL: }
|
||||||
|
@ -71,7 +71,7 @@ def B_CompoundAttrA : TestAttr<"CompoundA"> {
|
||||||
// DECL: void print(::mlir::AsmPrinter &printer) const;
|
// DECL: void print(::mlir::AsmPrinter &printer) const;
|
||||||
// DECL: int getWidthOfSomething() const;
|
// DECL: int getWidthOfSomething() const;
|
||||||
// DECL: ::test::SimpleTypeA getExampleTdType() const;
|
// DECL: ::test::SimpleTypeA getExampleTdType() const;
|
||||||
// DECL: const ::llvm::APFloat &getApFloat() const;
|
// DECL: ::llvm::APFloat getApFloat() const;
|
||||||
|
|
||||||
// Check that AttributeSelfTypeParameter is handled properly.
|
// Check that AttributeSelfTypeParameter is handled properly.
|
||||||
// DEF-LABEL: struct CompoundAAttrStorage
|
// DEF-LABEL: struct CompoundAAttrStorage
|
||||||
|
@ -139,5 +139,5 @@ def F_ParamWithAccessorTypeAttr : TestAttr<"ParamWithAccessorType"> {
|
||||||
// DECL-LABEL: class ParamWithAccessorTypeAttr
|
// DECL-LABEL: class ParamWithAccessorTypeAttr
|
||||||
// DECL: StringRef getParam()
|
// DECL: StringRef getParam()
|
||||||
// DEF: ParamWithAccessorTypeAttrStorage
|
// DEF: ParamWithAccessorTypeAttrStorage
|
||||||
// DEF: ParamWithAccessorTypeAttrStorage(StringRef param)
|
// DEF: ParamWithAccessorTypeAttrStorage(std::string param)
|
||||||
// DEF: StringRef ParamWithAccessorTypeAttr::getParam()
|
// DEF: StringRef ParamWithAccessorTypeAttr::getParam()
|
||||||
|
|
|
@ -315,7 +315,7 @@ DefGen::getBuilderParams(std::initializer_list<MethodParameter> prefix) const {
|
||||||
SmallVector<MethodParameter> builderParams;
|
SmallVector<MethodParameter> builderParams;
|
||||||
builderParams.append(prefix.begin(), prefix.end());
|
builderParams.append(prefix.begin(), prefix.end());
|
||||||
for (auto ¶m : params)
|
for (auto ¶m : params)
|
||||||
builderParams.emplace_back(param.getCppAccessorType(), param.getName());
|
builderParams.emplace_back(param.getCppType(), param.getName());
|
||||||
return builderParams;
|
return builderParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue