13
13
14
14
namespace fir {
15
15
class ExtendedValue ;
16
- }
16
+ class FirOpBuilder ;
17
+ } // namespace fir
17
18
18
19
namespace Fortran {
19
20
namespace lower {
20
- class FirOpBuilder ;
21
21
22
22
// / Generate a call to the ADJUSTL runtime.
23
23
// / This calls the simple runtime entry point that then calls into the more
@@ -27,10 +27,8 @@ class FirOpBuilder;
27
27
// / result. \p StringBox must be a fir.box describing the adjustl string
28
28
// / argument. Note that the \p genAdjust() helper is called to do the majority
29
29
// / of the lowering work.
30
- void genAdjustL (Fortran::lower::FirOpBuilder &builder,
31
- mlir::Location loc,
32
- mlir::Value resultBox,
33
- mlir::Value stringBox);
30
+ void genAdjustL (fir::FirOpBuilder &builder, mlir::Location loc,
31
+ mlir::Value resultBox, mlir::Value stringBox);
34
32
35
33
// / Generate a call to the ADJUSTR runtime.
36
34
// / This calls the simple runtime entry point that then calls into the more
@@ -40,26 +38,22 @@ void genAdjustL(Fortran::lower::FirOpBuilder &builder,
40
38
// / result. \p StringBox must be a fir.box describing the adjustr string
41
39
// / argument. Note that the \p genAdjust() helper is called to do the majority
42
40
// / of the lowering work.
43
- void genAdjustR (Fortran::lower::FirOpBuilder &builder,
44
- mlir::Location loc,
45
- mlir::Value resultBox,
46
- mlir::Value stringBox);
41
+ void genAdjustR (fir::FirOpBuilder &builder, mlir::Location loc,
42
+ mlir::Value resultBox, mlir::Value stringBox);
47
43
48
44
// / Generate a call to the ADJUST[L|R] runtime.
49
45
// /
50
46
// / \p resultBox must be an unallocated allocatable used for the temporary
51
47
// / result. \p StringBox must be a fir.box describing the adjustr string
52
48
// / argument. The \p adjustFunc should be a mlir::FuncOp for the appropriate
53
49
// / runtime entry function.
54
- void genAdjust (Fortran::lower::FirOpBuilder &builder,
55
- mlir::Location loc,
56
- mlir::Value resultBox,
57
- mlir::Value stringBox,
50
+ void genAdjust (fir::FirOpBuilder &builder, mlir::Location loc,
51
+ mlir::Value resultBox, mlir::Value stringBox,
58
52
mlir::FuncOp &adjustFunc);
59
53
60
54
// / Generate call to a character comparison for two ssa-values of type
61
55
// / `boxchar`.
62
- mlir::Value genCharCompare (FirOpBuilder &builder, mlir::Location loc,
56
+ mlir::Value genCharCompare (fir:: FirOpBuilder &builder, mlir::Location loc,
63
57
mlir::CmpIPredicate cmp,
64
58
const fir::ExtendedValue &lhs,
65
59
const fir::ExtendedValue &rhs);
@@ -68,23 +62,23 @@ mlir::Value genCharCompare(FirOpBuilder &builder, mlir::Location loc,
68
62
// / are 4 arguments, 2 for the lhs and 2 for the rhs. Each CHARACTER must pass a
69
63
// / reference to its buffer (`ref<char<K>>`) and its LEN type parameter (some
70
64
// / integral type).
71
- mlir::Value genCharCompare (FirOpBuilder &builder, mlir::Location loc,
65
+ mlir::Value genCharCompare (fir:: FirOpBuilder &builder, mlir::Location loc,
72
66
mlir::CmpIPredicate cmp, mlir::Value lhsBuff,
73
67
mlir::Value lhsLen, mlir::Value rhsBuff,
74
68
mlir::Value rhsLen);
75
69
76
70
// / Generate call to INDEX runtime.
77
71
// / This calls the simple runtime entry points based on the KIND of the string.
78
72
// / No descriptors are used.
79
- mlir::Value genIndex (FirOpBuilder &builder, mlir::Location loc, int kind,
73
+ mlir::Value genIndex (fir:: FirOpBuilder &builder, mlir::Location loc, int kind,
80
74
mlir::Value stringBase, mlir::Value stringLen,
81
75
mlir::Value substringBase, mlir::Value substringLen,
82
76
mlir::Value back);
83
77
84
78
// / Generate call to INDEX runtime.
85
79
// / This calls the descriptor based runtime call implementation for the index
86
80
// / intrinsic.
87
- void genIndexDescriptor (FirOpBuilder &builder, mlir::Location loc,
81
+ void genIndexDescriptor (fir:: FirOpBuilder &builder, mlir::Location loc,
88
82
mlir::Value resultBox, mlir::Value stringBox,
89
83
mlir::Value substringBox, mlir::Value backOpt,
90
84
mlir::Value kind);
@@ -94,45 +88,45 @@ void genIndexDescriptor(FirOpBuilder &builder, mlir::Location loc,
94
88
// / result. \p stringBox must be a fir.box describing repeat string argument.
95
89
// / \p ncopies must be a value representing the number of copies.
96
90
// / The runtime will always allocate the resultBox.
97
- void genRepeat (Fortran::lower ::FirOpBuilder &builder, mlir::Location loc,
91
+ void genRepeat (fir ::FirOpBuilder &builder, mlir::Location loc,
98
92
mlir::Value resultBox, mlir::Value stringBox,
99
93
mlir::Value ncopies);
100
94
101
95
// / Generate call to trim runtime.
102
96
// / \p resultBox must be an unallocated allocatable used for the temporary
103
97
// / result. \p stringBox must be a fir.box describing trim string argument.
104
98
// / The runtime will always allocate the resultBox.
105
- void genTrim (Fortran::lower ::FirOpBuilder &builder, mlir::Location loc,
99
+ void genTrim (fir ::FirOpBuilder &builder, mlir::Location loc,
106
100
mlir::Value resultBox, mlir::Value stringBox);
107
101
108
102
// / Generate call to scan runtime.
109
103
// / This calls the descriptor based runtime call implementation of the scan
110
104
// / intrinsics.
111
- void genScanDescriptor (Fortran::lower:: FirOpBuilder &builder,
112
- mlir::Location loc , mlir::Value resultBox ,
113
- mlir::Value stringBox , mlir::Value setBox ,
114
- mlir::Value backBox, mlir::Value kind);
105
+ void genScanDescriptor (fir:: FirOpBuilder &builder, mlir::Location loc ,
106
+ mlir::Value resultBox , mlir::Value stringBox ,
107
+ mlir::Value setBox , mlir::Value backBox ,
108
+ mlir::Value kind);
115
109
116
110
// / Generate call to the scan runtime routine that is specialized on
117
111
// / \param kind.
118
112
// / The \param kind represents the kind of the elements in the strings.
119
- mlir::Value genScan (Fortran::lower:: FirOpBuilder &builder, mlir::Location loc,
120
- int kind, mlir::Value stringBase, mlir::Value stringLen,
113
+ mlir::Value genScan (fir:: FirOpBuilder &builder, mlir::Location loc, int kind ,
114
+ mlir::Value stringBase, mlir::Value stringLen,
121
115
mlir::Value setBase, mlir::Value setLen, mlir::Value back);
122
116
123
117
// / Generate call to verify runtime.
124
118
// / This calls the descriptor based runtime call implementation of the scan
125
119
// / intrinsics.
126
- void genVerifyDescriptor (Fortran::lower:: FirOpBuilder &builder,
127
- mlir::Location loc , mlir::Value resultBox ,
128
- mlir::Value stringBox , mlir::Value setBox ,
129
- mlir::Value backBox, mlir::Value kind);
120
+ void genVerifyDescriptor (fir:: FirOpBuilder &builder, mlir::Location loc ,
121
+ mlir::Value resultBox , mlir::Value stringBox ,
122
+ mlir::Value setBox , mlir::Value backBox ,
123
+ mlir::Value kind);
130
124
131
125
// / Generate call to the verify runtime routine that is specialized on
132
126
// / \param kind.
133
127
// / The \param kind represents the kind of the elements in the strings.
134
- mlir::Value genVerify (Fortran::lower:: FirOpBuilder &builder, mlir::Location loc,
135
- int kind, mlir::Value stringBase, mlir::Value stringLen,
128
+ mlir::Value genVerify (fir:: FirOpBuilder &builder, mlir::Location loc, int kind ,
129
+ mlir::Value stringBase, mlir::Value stringLen,
136
130
mlir::Value setBase, mlir::Value setLen,
137
131
mlir::Value back);
138
132
0 commit comments