@@ -1746,8 +1746,8 @@ def fir_FieldIndexOp : fir_OneResultOp<"field_index", [NoSideEffect]> {
1746
1746
"mlir::Type":$recTy, CArg<"mlir::ValueRange","{}">:$operands)>];
1747
1747
1748
1748
let extraClassDeclaration = [{
1749
- static constexpr llvm::StringRef fieldAttrName () { return "field_id"; }
1750
- static constexpr llvm::StringRef typeAttrName () { return "on_type"; }
1749
+ static constexpr llvm::StringRef getFieldAttrName () { return "field_id"; }
1750
+ static constexpr llvm::StringRef getTypeAttrName () { return "on_type"; }
1751
1751
llvm::StringRef getFieldName() { return field_id(); }
1752
1752
}];
1753
1753
}
@@ -2012,16 +2012,17 @@ def fir_LenParamIndexOp : fir_OneResultOp<"len_param_index", [NoSideEffect]> {
2012
2012
let builders = [OpBuilder<(ins "llvm::StringRef":$fieldName,
2013
2013
"mlir::Type":$recTy),
2014
2014
[{
2015
- $_state.addAttribute(fieldAttrName(), $_builder.getStringAttr(fieldName));
2016
- $_state.addAttribute(typeAttrName(), TypeAttr::get(recTy));
2015
+ $_state.addAttribute(getFieldAttrName(),
2016
+ $_builder.getStringAttr(fieldName));
2017
+ $_state.addAttribute(getTypeAttrName(), TypeAttr::get(recTy));
2017
2018
}]
2018
2019
>];
2019
2020
2020
2021
let extraClassDeclaration = [{
2021
- static constexpr llvm::StringRef fieldAttrName () { return "field_id"; }
2022
- static constexpr llvm::StringRef typeAttrName () { return "on_type"; }
2022
+ static constexpr llvm::StringRef getFieldAttrName () { return "field_id"; }
2023
+ static constexpr llvm::StringRef getTypeAttrName () { return "on_type"; }
2023
2024
mlir::Type getOnType() {
2024
- return (*this)->getAttrOfType<TypeAttr>(typeAttrName ()).getValue();
2025
+ return (*this)->getAttrOfType<TypeAttr>(getTypeAttrName ()).getValue();
2025
2026
}
2026
2027
}];
2027
2028
}
@@ -2104,8 +2105,10 @@ def fir_DoLoopOp : region_Op<"do_loop",
2104
2105
];
2105
2106
2106
2107
let extraClassDeclaration = [{
2107
- static constexpr llvm::StringRef unorderedAttrName() { return "unordered"; }
2108
- static constexpr llvm::StringRef finalValueAttrName() {
2108
+ static constexpr llvm::StringRef getUnorderedAttrName() {
2109
+ return "unordered";
2110
+ }
2111
+ static constexpr llvm::StringRef getFinalValueAttrName() {
2109
2112
return "finalValue";
2110
2113
}
2111
2114
@@ -2143,7 +2146,7 @@ def fir_DoLoopOp : region_Op<"do_loop",
2143
2146
mlir::Block *getBody() { return ®ion().front(); }
2144
2147
2145
2148
void setUnordered() {
2146
- (*this)->setAttr(unorderedAttrName (),
2149
+ (*this)->setAttr(getUnorderedAttrName (),
2147
2150
mlir::UnitAttr::get(getContext()));
2148
2151
}
2149
2152
@@ -2254,7 +2257,7 @@ def fir_IterWhileOp : region_Op<"iterate_while",
2254
2257
];
2255
2258
2256
2259
let extraClassDeclaration = [{
2257
- static constexpr llvm::StringRef finalValueAttrName () {
2260
+ static constexpr llvm::StringRef getFinalValueAttrName () {
2258
2261
return "finalValue";
2259
2262
}
2260
2263
mlir::Block *getBody() { return ®ion().front(); }
@@ -2339,14 +2342,14 @@ def fir_CallOp : fir_Op<"call", [CallOpInterface]> {
2339
2342
}]>];
2340
2343
2341
2344
let extraClassDeclaration = [{
2342
- static constexpr StringRef calleeAttrName () { return "callee"; }
2345
+ static constexpr StringRef getCalleeAttrName () { return "callee"; }
2343
2346
2344
2347
mlir::FunctionType getFunctionType();
2345
2348
2346
2349
/// Get the argument operands to the called function.
2347
2350
operand_range getArgOperands() {
2348
2351
if (auto calling =
2349
- (*this)->getAttrOfType<SymbolRefAttr>(calleeAttrName ()))
2352
+ (*this)->getAttrOfType<SymbolRefAttr>(getCalleeAttrName ()))
2350
2353
return {arg_operand_begin(), arg_operand_end()};
2351
2354
return {arg_operand_begin() + 1, arg_operand_end()};
2352
2355
}
@@ -2357,7 +2360,7 @@ def fir_CallOp : fir_Op<"call", [CallOpInterface]> {
2357
2360
/// Return the callee of this operation.
2358
2361
CallInterfaceCallable getCallableForCallee() {
2359
2362
if (auto calling =
2360
- (*this)->getAttrOfType<SymbolRefAttr>(calleeAttrName ()))
2363
+ (*this)->getAttrOfType<SymbolRefAttr>(getCalleeAttrName ()))
2361
2364
return calling;
2362
2365
return getOperand(0);
2363
2366
}
@@ -2397,10 +2400,10 @@ def fir_DispatchOp : fir_Op<"dispatch", []> {
2397
2400
// operand[0] is the object (of box type)
2398
2401
operand_iterator arg_operand_begin() { return operand_begin() + 1; }
2399
2402
operand_iterator arg_operand_end() { return operand_end(); }
2400
- static constexpr llvm::StringRef passArgAttrName () {
2403
+ static constexpr llvm::StringRef getPassArgAttrName () {
2401
2404
return "pass_arg_pos";
2402
2405
}
2403
- static constexpr llvm::StringRef methodAttrName () { return "method"; }
2406
+ static constexpr llvm::StringRef getMethodAttrName () { return "method"; }
2404
2407
unsigned passArgPos();
2405
2408
}];
2406
2409
}
@@ -2498,11 +2501,13 @@ def fir_ConstcOp : fir_Op<"constc", [NoSideEffect]> {
2498
2501
let verifier = "return ::verify(*this);";
2499
2502
2500
2503
let extraClassDeclaration = [{
2501
- static constexpr llvm::StringRef realAttrName () { return "real"; }
2502
- static constexpr llvm::StringRef imagAttrName () { return "imaginary"; }
2504
+ static constexpr llvm::StringRef getRealAttrName () { return "real"; }
2505
+ static constexpr llvm::StringRef getImagAttrName () { return "imaginary"; }
2503
2506
2504
- mlir::Attribute getReal() { return (*this)->getAttr(realAttrName()); }
2505
- mlir::Attribute getImaginary() { return (*this)->getAttr(imagAttrName()); }
2507
+ mlir::Attribute getReal() { return (*this)->getAttr(getRealAttrName()); }
2508
+ mlir::Attribute getImaginary() {
2509
+ return (*this)->getAttr(getImagAttrName());
2510
+ }
2506
2511
}];
2507
2512
}
2508
2513
@@ -2746,15 +2751,17 @@ def fir_GlobalOp : fir_Op<"global", [IsolatedFromAbove, Symbol]> {
2746
2751
];
2747
2752
2748
2753
let extraClassDeclaration = [{
2749
- static constexpr llvm::StringRef symbolAttrName() { return "symref"; }
2750
- static constexpr llvm::StringRef constantAttrName() { return "constant"; }
2751
- static constexpr llvm::StringRef initValAttrName() { return "initVal"; }
2752
- static constexpr llvm::StringRef linkageAttrName() { return "linkName"; }
2753
- static constexpr llvm::StringRef typeAttrName() { return "type"; }
2754
+ static constexpr llvm::StringRef getSymbolAttrName() { return "symref"; }
2755
+ static constexpr llvm::StringRef getConstantAttrName() {
2756
+ return "constant";
2757
+ }
2758
+ static constexpr llvm::StringRef getInitValAttrName() { return "initVal"; }
2759
+ static constexpr llvm::StringRef getLinkageAttrName() { return "linkName"; }
2760
+ static constexpr llvm::StringRef getTypeAttrName() { return "type"; }
2754
2761
2755
2762
/// The printable type of the global
2756
2763
mlir::Type getType() {
2757
- return (*this)->getAttrOfType<TypeAttr>(typeAttrName ()).getValue();
2764
+ return (*this)->getAttrOfType<TypeAttr>(getTypeAttrName ()).getValue();
2758
2765
}
2759
2766
2760
2767
/// The semantic type of the global
@@ -2812,8 +2819,10 @@ def fir_GlobalLenOp : fir_Op<"global_len", []> {
2812
2819
let printer = "::print(p, *this);";
2813
2820
2814
2821
let extraClassDeclaration = [{
2815
- static constexpr llvm::StringRef lenParamAttrName() { return "lenparam"; }
2816
- static constexpr llvm::StringRef intAttrName() { return "intval"; }
2822
+ static constexpr llvm::StringRef getLenParamAttrName() {
2823
+ return "lenparam";
2824
+ }
2825
+ static constexpr llvm::StringRef getIntAttrName() { return "intval"; }
2817
2826
}];
2818
2827
}
2819
2828
@@ -2894,8 +2903,8 @@ def fir_DTEntryOp : fir_Op<"dt_entry", []> {
2894
2903
let printer = "::print(p, *this);";
2895
2904
2896
2905
let extraClassDeclaration = [{
2897
- static constexpr llvm::StringRef methodAttrName () { return "method"; }
2898
- static constexpr llvm::StringRef procAttrName () { return "proc"; }
2906
+ static constexpr llvm::StringRef getMethodAttrName () { return "method"; }
2907
+ static constexpr llvm::StringRef getProcAttrName () { return "proc"; }
2899
2908
}];
2900
2909
}
2901
2910
0 commit comments