1- // ===-- Lower /DumpEvaluateExpr.cpp ---- ------------------------------------===//
1+ // ===-- Semantics /DumpEvaluateExpr.cpp ------------------------------------===//
22//
33// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44// See https://llvm.org/LICENSE.txt for license information.
55// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66//
77// ===----------------------------------------------------------------------===//
88
9- #include " flang/Lower/DumpEvaluateExpr .h"
9+ #include " flang/Semantics/dump-expr .h"
1010#include < iostream>
1111
1212static constexpr char whiteSpacePadding[] =
1313 " >> " ;
1414static constexpr auto whiteSize = sizeof (whiteSpacePadding) - 1 ;
1515
16- inline const char *Fortran::lower::DumpEvaluateExpr::getIndentString () const {
16+ inline const char *
17+ Fortran::semantics::DumpEvaluateExpr::getIndentString () const {
1718 auto count = (level * 2 >= whiteSize) ? whiteSize : level * 2 ;
1819 return whiteSpacePadding + whiteSize - count;
1920}
2021
21- void Fortran::lower ::DumpEvaluateExpr::show (
22+ void Fortran::semantics ::DumpEvaluateExpr::show (
2223 const Fortran::evaluate::CoarrayRef &x) {
2324 indent (" coarray ref" );
2425 show (x.base ());
@@ -29,20 +30,20 @@ void Fortran::lower::DumpEvaluateExpr::show(
2930 outdent ();
3031}
3132
32- void Fortran::lower ::DumpEvaluateExpr::show (
33+ void Fortran::semantics ::DumpEvaluateExpr::show (
3334 const Fortran::evaluate::BOZLiteralConstant &) {
3435 print (" BOZ literal constant" );
3536}
3637
37- void Fortran::lower ::DumpEvaluateExpr::show (
38+ void Fortran::semantics ::DumpEvaluateExpr::show (
3839 const Fortran::evaluate::NullPointer &) {
3940 print (" null pointer" );
4041}
4142
42- void Fortran::lower ::DumpEvaluateExpr::show (
43+ void Fortran::semantics ::DumpEvaluateExpr::show (
4344 const Fortran::semantics::Symbol &symbol) {
4445 const auto &ultimate{symbol.GetUltimate ()};
45- print (" symbol: " s + std::string ( toStringRef ( symbol.name ()) ));
46+ print (" symbol: " s + symbol.name (). ToString ( ));
4647 if (const auto *assoc =
4748 ultimate.detailsIf <Fortran::semantics::AssocEntityDetails>()) {
4849 indent (" assoc details" );
@@ -51,31 +52,31 @@ void Fortran::lower::DumpEvaluateExpr::show(
5152 }
5253}
5354
54- void Fortran::lower ::DumpEvaluateExpr::show (
55+ void Fortran::semantics ::DumpEvaluateExpr::show (
5556 const Fortran::evaluate::StaticDataObject &) {
5657 print (" static data object" );
5758}
5859
59- void Fortran::lower ::DumpEvaluateExpr::show (
60+ void Fortran::semantics ::DumpEvaluateExpr::show (
6061 const Fortran::evaluate::ImpliedDoIndex &) {
6162 print (" implied do index" );
6263}
6364
64- void Fortran::lower ::DumpEvaluateExpr::show (
65+ void Fortran::semantics ::DumpEvaluateExpr::show (
6566 const Fortran::evaluate::BaseObject &x) {
6667 indent (" base object" );
6768 show (x.u );
6869 outdent ();
6970}
70- void Fortran::lower ::DumpEvaluateExpr::show (
71+ void Fortran::semantics ::DumpEvaluateExpr::show (
7172 const Fortran::evaluate::Component &x) {
7273 indent (" component" );
7374 show (x.base ());
7475 show (x.GetLastSymbol ());
7576 outdent ();
7677}
7778
78- void Fortran::lower ::DumpEvaluateExpr::show (
79+ void Fortran::semantics ::DumpEvaluateExpr::show (
7980 const Fortran::evaluate::NamedEntity &x) {
8081 indent (" named entity" );
8182 if (const auto *component = x.UnwrapComponent ())
@@ -85,14 +86,14 @@ void Fortran::lower::DumpEvaluateExpr::show(
8586 outdent ();
8687}
8788
88- void Fortran::lower ::DumpEvaluateExpr::show (
89+ void Fortran::semantics ::DumpEvaluateExpr::show (
8990 const Fortran::evaluate::TypeParamInquiry &x) {
9091 indent (" type inquiry" );
9192 show (x.base ());
9293 outdent ();
9394}
9495
95- void Fortran::lower ::DumpEvaluateExpr::show (
96+ void Fortran::semantics ::DumpEvaluateExpr::show (
9697 const Fortran::evaluate::Triplet &x) {
9798 indent (" triplet" );
9899 show (x.lower ());
@@ -101,29 +102,29 @@ void Fortran::lower::DumpEvaluateExpr::show(
101102 outdent ();
102103}
103104
104- void Fortran::lower ::DumpEvaluateExpr::show (
105+ void Fortran::semantics ::DumpEvaluateExpr::show (
105106 const Fortran::evaluate::Subscript &x) {
106107 indent (" subscript" );
107108 show (x.u );
108109 outdent ();
109110}
110111
111- void Fortran::lower ::DumpEvaluateExpr::show (
112+ void Fortran::semantics ::DumpEvaluateExpr::show (
112113 const Fortran::evaluate::ArrayRef &x) {
113114 indent (" array ref" );
114115 show (x.base ());
115116 show (x.subscript ());
116117 outdent ();
117118}
118119
119- void Fortran::lower ::DumpEvaluateExpr::show (
120+ void Fortran::semantics ::DumpEvaluateExpr::show (
120121 const Fortran::evaluate::DataRef &x) {
121122 indent (" data ref" );
122123 show (x.u );
123124 outdent ();
124125}
125126
126- void Fortran::lower ::DumpEvaluateExpr::show (
127+ void Fortran::semantics ::DumpEvaluateExpr::show (
127128 const Fortran::evaluate::Substring &x) {
128129 indent (" substring" );
129130 show (x.parent ());
@@ -132,33 +133,33 @@ void Fortran::lower::DumpEvaluateExpr::show(
132133 outdent ();
133134}
134135
135- void Fortran::lower ::DumpEvaluateExpr::show (
136+ void Fortran::semantics ::DumpEvaluateExpr::show (
136137 const Fortran::semantics::ParamValue &x) {
137138 indent (" param value" );
138139 show (x.GetExplicit ());
139140 outdent ();
140141}
141142
142- void Fortran::lower ::DumpEvaluateExpr::show (
143+ void Fortran::semantics ::DumpEvaluateExpr::show (
143144 const Fortran::semantics::DerivedTypeSpec::ParameterMapType::value_type
144145 &x) {
145146 show (x.second );
146147}
147148
148- void Fortran::lower ::DumpEvaluateExpr::show (
149+ void Fortran::semantics ::DumpEvaluateExpr::show (
149150 const Fortran::semantics::DerivedTypeSpec &x) {
150151 indent (" derived type spec" );
151152 for (auto &v : x.parameters ())
152153 show (v);
153154 outdent ();
154155}
155156
156- void Fortran::lower ::DumpEvaluateExpr::show (
157+ void Fortran::semantics ::DumpEvaluateExpr::show (
157158 const Fortran::evaluate::StructureConstructorValues::value_type &x) {
158159 show (x.second );
159160}
160161
161- void Fortran::lower ::DumpEvaluateExpr::show (
162+ void Fortran::semantics ::DumpEvaluateExpr::show (
162163 const Fortran::evaluate::StructureConstructor &x) {
163164 indent (" structure constructor" );
164165 show (x.derivedTypeSpec ());
@@ -167,21 +168,21 @@ void Fortran::lower::DumpEvaluateExpr::show(
167168 outdent ();
168169}
169170
170- void Fortran::lower ::DumpEvaluateExpr::show (
171+ void Fortran::semantics ::DumpEvaluateExpr::show (
171172 const Fortran::evaluate::Relational<Fortran::evaluate::SomeType> &x) {
172173 indent (" expr some type" );
173174 show (x.u );
174175 outdent ();
175176}
176177
177- void Fortran::lower ::DumpEvaluateExpr::show (
178+ void Fortran::semantics ::DumpEvaluateExpr::show (
178179 const Fortran::evaluate::ComplexPart &x) {
179180 indent (" complex part" );
180181 show (x.complex ());
181182 outdent ();
182183}
183184
184- void Fortran::lower ::DumpEvaluateExpr::show (
185+ void Fortran::semantics ::DumpEvaluateExpr::show (
185186 const Fortran::evaluate::ActualArgument &x) {
186187 indent (" actual argument" );
187188 if (const auto *symbol = x.GetAssumedTypeDummy ())
@@ -191,7 +192,7 @@ void Fortran::lower::DumpEvaluateExpr::show(
191192 outdent ();
192193}
193194
194- void Fortran::lower ::DumpEvaluateExpr::show (
195+ void Fortran::semantics ::DumpEvaluateExpr::show (
195196 const Fortran::evaluate::ProcedureDesignator &x) {
196197 indent (" procedure designator" );
197198 if (const auto *component = x.GetComponent ())
@@ -203,28 +204,28 @@ void Fortran::lower::DumpEvaluateExpr::show(
203204 outdent ();
204205}
205206
206- void Fortran::lower ::DumpEvaluateExpr::show (
207+ void Fortran::semantics ::DumpEvaluateExpr::show (
207208 const Fortran::evaluate::SpecificIntrinsic &) {
208209 print (" specific intrinsic" );
209210}
210211
211- void Fortran::lower ::DumpEvaluateExpr::show (
212+ void Fortran::semantics ::DumpEvaluateExpr::show (
212213 const Fortran::evaluate::DescriptorInquiry &x) {
213214 indent (" descriptor inquiry" );
214215 show (x.base ());
215216 outdent ();
216217}
217218
218- void Fortran::lower ::DumpEvaluateExpr::print (llvm::Twine twine) {
219+ void Fortran::semantics ::DumpEvaluateExpr::print (llvm::Twine twine) {
219220 outs << getIndentString () << twine << ' \n ' ;
220221}
221222
222- void Fortran::lower ::DumpEvaluateExpr::indent (llvm::StringRef s) {
223+ void Fortran::semantics ::DumpEvaluateExpr::indent (llvm::StringRef s) {
223224 print (s + " {" );
224225 level++;
225226}
226227
227- void Fortran::lower ::DumpEvaluateExpr::outdent () {
228+ void Fortran::semantics ::DumpEvaluateExpr::outdent () {
228229 if (level)
229230 level--;
230231 print (" }" );
@@ -234,37 +235,37 @@ void Fortran::lower::DumpEvaluateExpr::outdent() {
234235// Boilerplate entry points that the debugger can find.
235236// ===----------------------------------------------------------------------===//
236237
237- void Fortran::lower ::dumpEvExpr (const Fortran::semantics::SomeExpr &x) {
238+ void Fortran::semantics ::dumpEvExpr (const Fortran::semantics::SomeExpr &x) {
238239 DumpEvaluateExpr::dump (x);
239240}
240241
241- void Fortran::lower ::dumpEvExpr (
242+ void Fortran::semantics ::dumpEvExpr (
242243 const Fortran::evaluate::Expr<
243244 Fortran::evaluate::Type<Fortran::common::TypeCategory::Integer, 4 >>
244245 &x) {
245246 DumpEvaluateExpr::dump (x);
246247}
247248
248- void Fortran::lower ::dumpEvExpr (
249+ void Fortran::semantics ::dumpEvExpr (
249250 const Fortran::evaluate::Expr<
250251 Fortran::evaluate::Type<Fortran::common::TypeCategory::Integer, 8 >>
251252 &x) {
252253 DumpEvaluateExpr::dump (x);
253254}
254255
255- void Fortran::lower ::dumpEvExpr (const Fortran::evaluate::ArrayRef &x) {
256+ void Fortran::semantics ::dumpEvExpr (const Fortran::evaluate::ArrayRef &x) {
256257 DumpEvaluateExpr::dump (x);
257258}
258259
259- void Fortran::lower ::dumpEvExpr (const Fortran::evaluate::DataRef &x) {
260+ void Fortran::semantics ::dumpEvExpr (const Fortran::evaluate::DataRef &x) {
260261 DumpEvaluateExpr::dump (x);
261262}
262263
263- void Fortran::lower ::dumpEvExpr (const Fortran::evaluate::Substring &x) {
264+ void Fortran::semantics ::dumpEvExpr (const Fortran::evaluate::Substring &x) {
264265 DumpEvaluateExpr::dump (x);
265266}
266267
267- void Fortran::lower ::dumpEvExpr (
268+ void Fortran::semantics ::dumpEvExpr (
268269 const Fortran::evaluate::Designator<
269270 Fortran::evaluate::Type<Fortran::common::TypeCategory::Integer, 4 >>
270271 &x) {
0 commit comments