@@ -25,62 +25,62 @@ class DumpEvaluateExpr {
25
25
DumpEvaluateExpr (llvm::raw_ostream &str) : outs(str) {}
26
26
27
27
template <typename A>
28
- LLVM_DUMP_METHOD static void dump (const A &x) {
28
+ static void dump (const A &x) {
29
29
DumpEvaluateExpr{}.show (x);
30
30
}
31
31
template <typename A>
32
- LLVM_DUMP_METHOD static void dump (llvm::raw_ostream &stream, const A &x) {
32
+ static void dump (llvm::raw_ostream &stream, const A &x) {
33
33
DumpEvaluateExpr{stream}.show (x);
34
34
}
35
35
36
36
private:
37
37
template <typename A, bool C>
38
- LLVM_DUMP_METHOD void show (const Fortran::common::Indirection<A, C> &x) {
38
+ void show (const Fortran::common::Indirection<A, C> &x) {
39
39
show (x.value ());
40
40
}
41
41
template <typename A>
42
- LLVM_DUMP_METHOD void show (const Fortran::semantics::SymbolRef x) {
42
+ void show (const Fortran::semantics::SymbolRef x) {
43
43
show (*x);
44
44
}
45
45
template <typename A>
46
- LLVM_DUMP_METHOD void show (const std::unique_ptr<A> &x) {
46
+ void show (const std::unique_ptr<A> &x) {
47
47
show (x.get ());
48
48
}
49
49
template <typename A>
50
- LLVM_DUMP_METHOD void show (const std::shared_ptr<A> &x) {
50
+ void show (const std::shared_ptr<A> &x) {
51
51
show (x.get ());
52
52
}
53
53
template <typename A>
54
- LLVM_DUMP_METHOD void show (const A *x) {
54
+ void show (const A *x) {
55
55
if (x) {
56
56
show (*x);
57
57
return ;
58
58
}
59
59
print (" nullptr" );
60
60
}
61
61
template <typename A>
62
- LLVM_DUMP_METHOD void show (const std::optional<A> &x) {
62
+ void show (const std::optional<A> &x) {
63
63
if (x) {
64
64
show (*x);
65
65
return ;
66
66
}
67
67
print (" None" );
68
68
}
69
69
template <typename ... A>
70
- LLVM_DUMP_METHOD void show (const std::variant<A...> &u) {
70
+ void show (const std::variant<A...> &u) {
71
71
std::visit ([&](const auto &v) { show (v); }, u);
72
72
}
73
73
template <typename A>
74
- LLVM_DUMP_METHOD void show (const std::vector<A> &x) {
74
+ void show (const std::vector<A> &x) {
75
75
indent (" vector" );
76
76
for (const auto &v : x)
77
77
show (v);
78
78
outdent ();
79
79
}
80
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::BOZLiteralConstant &);
81
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::NullPointer &);
80
+ void show (const Fortran::evaluate::BOZLiteralConstant &);
81
+ void show (const Fortran::evaluate::NullPointer &);
82
82
template <typename T>
83
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::Constant<T> &x) {
83
+ void show (const Fortran::evaluate::Constant<T> &x) {
84
84
if constexpr (T::category == Fortran::common::TypeCategory::Derived) {
85
85
indent (" derived constant" );
86
86
for (const auto &map : x.values ())
@@ -91,103 +91,99 @@ class DumpEvaluateExpr {
91
91
print (" constant" );
92
92
}
93
93
}
94
- LLVM_DUMP_METHOD void show (const Fortran::semantics::Symbol &symbol);
95
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::StaticDataObject &);
96
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::ImpliedDoIndex &);
97
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::BaseObject &x);
98
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::Component &x);
99
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::NamedEntity &x);
100
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::TypeParamInquiry &x);
101
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::Triplet &x);
102
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::Subscript &x);
103
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::ArrayRef &x);
104
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::CoarrayRef &x);
105
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::DataRef &x);
106
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::Substring &x);
107
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::ComplexPart &x);
94
+ void show (const Fortran::semantics::Symbol &symbol);
95
+ void show (const Fortran::evaluate::StaticDataObject &);
96
+ void show (const Fortran::evaluate::ImpliedDoIndex &);
97
+ void show (const Fortran::evaluate::BaseObject &x);
98
+ void show (const Fortran::evaluate::Component &x);
99
+ void show (const Fortran::evaluate::NamedEntity &x);
100
+ void show (const Fortran::evaluate::TypeParamInquiry &x);
101
+ void show (const Fortran::evaluate::Triplet &x);
102
+ void show (const Fortran::evaluate::Subscript &x);
103
+ void show (const Fortran::evaluate::ArrayRef &x);
104
+ void show (const Fortran::evaluate::CoarrayRef &x);
105
+ void show (const Fortran::evaluate::DataRef &x);
106
+ void show (const Fortran::evaluate::Substring &x);
107
+ void show (const Fortran::evaluate::ComplexPart &x);
108
108
template <typename T>
109
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::Designator<T> &x) {
109
+ void show (const Fortran::evaluate::Designator<T> &x) {
110
110
indent (" designator" );
111
111
show (x.u );
112
112
outdent ();
113
113
}
114
114
template <typename T>
115
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::Variable<T> &x) {
115
+ void show (const Fortran::evaluate::Variable<T> &x) {
116
116
indent (" variable" );
117
117
show (x.u );
118
118
outdent ();
119
119
}
120
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::DescriptorInquiry &x);
121
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::SpecificIntrinsic &);
122
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::ProcedureDesignator &x);
123
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::ActualArgument &x);
124
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::ProcedureRef &x) {
120
+ void show (const Fortran::evaluate::DescriptorInquiry &x);
121
+ void show (const Fortran::evaluate::SpecificIntrinsic &);
122
+ void show (const Fortran::evaluate::ProcedureDesignator &x);
123
+ void show (const Fortran::evaluate::ActualArgument &x);
124
+ void show (const Fortran::evaluate::ProcedureRef &x) {
125
125
indent (" procedure ref" );
126
126
show (x.proc ());
127
127
show (x.arguments ());
128
128
outdent ();
129
129
}
130
130
template <typename T>
131
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::FunctionRef<T> &x) {
131
+ void show (const Fortran::evaluate::FunctionRef<T> &x) {
132
132
indent (" function ref" );
133
133
show (x.proc ());
134
134
show (x.arguments ());
135
135
outdent ();
136
136
}
137
137
template <typename T>
138
- LLVM_DUMP_METHOD void
139
- show (const Fortran::evaluate::ArrayConstructorValue<T> &x) {
138
+ void show (const Fortran::evaluate::ArrayConstructorValue<T> &x) {
140
139
show (x.u );
141
140
}
142
141
template <typename T>
143
- LLVM_DUMP_METHOD void
144
- show (const Fortran::evaluate::ArrayConstructorValues<T> &x) {
142
+ void show (const Fortran::evaluate::ArrayConstructorValues<T> &x) {
145
143
indent (" array constructor value" );
146
144
for (auto &v : x)
147
145
show (v);
148
146
outdent ();
149
147
}
150
148
template <typename T>
151
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::ImpliedDo<T> &x) {
149
+ void show (const Fortran::evaluate::ImpliedDo<T> &x) {
152
150
indent (" implied do" );
153
151
show (x.lower ());
154
152
show (x.upper ());
155
153
show (x.stride ());
156
154
show (x.values ());
157
155
outdent ();
158
156
}
159
- LLVM_DUMP_METHOD void show (const Fortran::semantics::ParamValue &x);
160
- LLVM_DUMP_METHOD void
157
+ void show (const Fortran::semantics::ParamValue &x);
158
+ void
161
159
show (const Fortran::semantics::DerivedTypeSpec::ParameterMapType::value_type
162
160
&x);
163
- LLVM_DUMP_METHOD void show (const Fortran::semantics::DerivedTypeSpec &x);
164
- LLVM_DUMP_METHOD void
165
- show (const Fortran::evaluate::StructureConstructorValues::value_type &x);
166
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::StructureConstructor &x);
161
+ void show (const Fortran::semantics::DerivedTypeSpec &x);
162
+ void show (const Fortran::evaluate::StructureConstructorValues::value_type &x);
163
+ void show (const Fortran::evaluate::StructureConstructor &x);
167
164
template <typename D, typename R, typename O>
168
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::Operation<D, R, O> &op) {
165
+ void show (const Fortran::evaluate::Operation<D, R, O> &op) {
169
166
indent (" unary op" );
170
167
show (op.left ());
171
168
outdent ();
172
169
}
173
170
template <typename D, typename R, typename LO, typename RO>
174
- LLVM_DUMP_METHOD void
175
- show (const Fortran::evaluate::Operation<D, R, LO, RO> &op) {
171
+ void show (const Fortran::evaluate::Operation<D, R, LO, RO> &op) {
176
172
indent (" binary op" );
177
173
show (op.left ());
178
174
show (op.right ());
179
175
outdent ();
180
176
}
181
- LLVM_DUMP_METHOD void
177
+ void
182
178
show (const Fortran::evaluate::Relational<Fortran::evaluate::SomeType> &x);
183
179
template <typename T>
184
- LLVM_DUMP_METHOD void show (const Fortran::evaluate::Expr<T> &x) {
180
+ void show (const Fortran::evaluate::Expr<T> &x) {
185
181
indent (" expr T" );
186
182
show (x.u );
187
183
outdent ();
188
184
}
189
185
190
- llvm::StringRef getIndentString () const ;
186
+ const char * getIndentString () const ;
191
187
void print (llvm::Twine s);
192
188
void indent (llvm::StringRef s);
193
189
void outdent ();
@@ -196,6 +192,16 @@ class DumpEvaluateExpr {
196
192
unsigned level = 0 ;
197
193
};
198
194
195
+ LLVM_DUMP_METHOD void
196
+ dumpEvExpr (const Fortran::evaluate::Expr<Fortran::evaluate::SomeType> &x);
197
+ LLVM_DUMP_METHOD void dumpEvExpr (
198
+ const Fortran::evaluate::Expr<
199
+ Fortran::evaluate::Type<Fortran::common::TypeCategory::Integer, 4 >> &x);
200
+ LLVM_DUMP_METHOD void dumpEvExpr (
201
+ const Fortran::evaluate::Expr<
202
+ Fortran::evaluate::Type<Fortran::common::TypeCategory::Integer, 8 >> &x);
203
+ LLVM_DUMP_METHOD void dumpEvExpr (const Fortran::evaluate::ArrayRef &x);
204
+
199
205
} // namespace Fortran::lower
200
206
201
207
#endif // FORTRAN_LOWER_EVEXPRDUMPER_H
0 commit comments