FLANG

PFTBuilder.h
1 //===-- Lower/PFTBuilder.h -- PFT builder -----------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // PFT (Pre-FIR Tree) interface.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef FORTRAN_LOWER_PFTBUILDER_H
14 #define FORTRAN_LOWER_PFTBUILDER_H
15
16 #include "flang/Common/reference.h"
17 #include "flang/Common/template.h"
18 #include "flang/Parser/parse-tree.h"
19 #include "llvm/ADT/DenseMap.h"
20 #include "llvm/ADT/SmallSet.h"
21 #include "llvm/Support/raw_ostream.h"
22
23 namespace mlir {
24 class Block;
25 }
26
27 namespace Fortran {
28 namespace semantics {
29 class SemanticsContext;
30 class Scope;
31 } // namespace semantics
32 namespace lower {
33 namespace pft {
34
35 struct Evaluation;
36 struct Program;
37 struct ModuleLikeUnit;
38 struct FunctionLikeUnit;
39
40 // TODO: A collection of Evaluations can obviously be any of the container
41 // types; leaving this as a std::list _for now_ because we reserve the right to
42 // insert PFT nodes in any order in O(1) time.
43 using EvaluationList = std::list<Evaluation>;
44 using LabelEvalMap = llvm::DenseMap<Fortran::parser::Label, Evaluation *>;
45
49 template <bool isConst, typename... A>
50 class ReferenceVariantBase {
51 public:
52 template <typename B>
53 using BaseType = std::conditional_t<isConst, const B, B>;
54 template <typename B>
55 using Ref = common::Reference<BaseType<B>>;
56
57 ReferenceVariantBase() = delete;
58 template <typename B>
59 ReferenceVariantBase(B &b) : u{Ref<B>{b}} {}
60
61 template <typename B>
62 constexpr BaseType<B> &get() const {
63 return std::get<Ref<B>> > (u).get();
64 }
65 template <typename B>
66 constexpr BaseType<B> *getIf() const {
67 auto *ptr = std::get_if<Ref<B>>(&u);
68 return ptr ? &ptr->get() : nullptr;
69 }
70 template <typename B>
71 constexpr bool isA() const {
72 return std::holds_alternative<Ref<B>>(u);
73 }
74 template <typename VISITOR>
75 constexpr auto visit(VISITOR &&visitor) const {
76 return std::visit(
77 common::visitors{[&visitor](auto ref) { return visitor(ref.get()); }},
78 u);
79 }
80
81 private:
82 std::variant<Ref<A>...> u;
83 };
84 template <typename... A>
85 using ReferenceVariant = ReferenceVariantBase<true, A...>;
86 template <typename... A>
87 using MutableReferenceVariant = ReferenceVariantBase<false, A...>;
88
91 using ParentVariant = MutableReferenceVariant<Program, ModuleLikeUnit,
92 FunctionLikeUnit, Evaluation>;
93
95
96 using ActionStmts = std::tuple<
97 parser::AllocateStmt, parser::AssignmentStmt, parser::BackspaceStmt,
98 parser::CallStmt, parser::CloseStmt, parser::ContinueStmt,
99 parser::CycleStmt, parser::DeallocateStmt, parser::EndfileStmt,
100 parser::EventPostStmt, parser::EventWaitStmt, parser::ExitStmt,
101 parser::FailImageStmt, parser::FlushStmt, parser::FormTeamStmt,
102 parser::GotoStmt, parser::IfStmt, parser::InquireStmt, parser::LockStmt,
103 parser::NullifyStmt, parser::OpenStmt, parser::PointerAssignmentStmt,
104 parser::PrintStmt, parser::ReadStmt, parser::ReturnStmt, parser::RewindStmt,
105 parser::StopStmt, parser::SyncAllStmt, parser::SyncImagesStmt,
106 parser::SyncMemoryStmt, parser::SyncTeamStmt, parser::UnlockStmt,
107 parser::WaitStmt, parser::WhereStmt, parser::WriteStmt,
108 parser::ComputedGotoStmt, parser::ForallStmt, parser::ArithmeticIfStmt,
109 parser::AssignStmt, parser::AssignedGotoStmt, parser::PauseStmt>;
110
111 using OtherStmts = std::tuple<parser::FormatStmt, parser::EntryStmt,
112 parser::DataStmt, parser::NamelistStmt>;
113
114 using ConstructStmts = std::tuple<
115 parser::AssociateStmt, parser::EndAssociateStmt, parser::BlockStmt,
116 parser::EndBlockStmt, parser::SelectCaseStmt, parser::CaseStmt,
117 parser::EndSelectStmt, parser::ChangeTeamStmt, parser::EndChangeTeamStmt,
118 parser::CriticalStmt, parser::EndCriticalStmt, parser::NonLabelDoStmt,
119 parser::EndDoStmt, parser::IfThenStmt, parser::ElseIfStmt, parser::ElseStmt,
120 parser::EndIfStmt, parser::SelectRankStmt, parser::SelectRankCaseStmt,
121 parser::SelectTypeStmt, parser::TypeGuardStmt, parser::WhereConstructStmt,
122 parser::MaskedElsewhereStmt, parser::ElsewhereStmt, parser::EndWhereStmt,
123 parser::ForallConstructStmt, parser::EndForallStmt>;
124
125 using Constructs =
126 std::tuple<parser::AssociateConstruct, parser::BlockConstruct,
127 parser::CaseConstruct, parser::ChangeTeamConstruct,
128 parser::CriticalConstruct, parser::DoConstruct,
129 parser::IfConstruct, parser::SelectRankConstruct,
130 parser::SelectTypeConstruct, parser::WhereConstruct,
131 parser::ForallConstruct>;
132
133 using Directives =
134 std::tuple<parser::CompilerDirective, parser::OpenMPConstruct,
135 parser::OmpEndLoopDirective>;
136
137 template <typename A>
138 static constexpr bool isActionStmt{common::HasMember<A, ActionStmts>};
139
140 template <typename A>
141 static constexpr bool isOtherStmt{common::HasMember<A, OtherStmts>};
142
143 template <typename A>
144 static constexpr bool isConstructStmt{common::HasMember<A, ConstructStmts>};
145
146 template <typename A>
147 static constexpr bool isConstruct{common::HasMember<A, Constructs>};
148
149 template <typename A>
150 static constexpr bool isDirective{common::HasMember<A, Directives>};
151
152 template <typename A>
153 static constexpr bool isIntermediateConstructStmt{common::HasMember<
154 A, std::tuple<parser::CaseStmt, parser::ElseIfStmt, parser::ElseStmt,
155 parser::SelectRankCaseStmt, parser::TypeGuardStmt>>};
156
157 template <typename A>
158 static constexpr bool isNopConstructStmt{common::HasMember<
159 A, std::tuple<parser::EndAssociateStmt, parser::CaseStmt,
160 parser::EndSelectStmt, parser::ElseIfStmt, parser::ElseStmt,
161 parser::EndIfStmt, parser::SelectRankCaseStmt,
162 parser::TypeGuardStmt>>};
163
164 template <typename A>
165 static constexpr bool isFunctionLike{common::HasMember<
166 A, std::tuple<parser::MainProgram, parser::FunctionSubprogram,
167 parser::SubroutineSubprogram,
168 parser::SeparateModuleSubprogram>>};
169
170 using LabelSet = llvm::SmallSet<parser::Label, 5>;
171 using SymbolRef = common::Reference<const semantics::Symbol>;
172 using SymbolLabelMap = llvm::DenseMap<SymbolRef, LabelSet>;
173
174 template <typename A>
175 struct MakeReferenceVariantHelper {};
176 template <typename... A>
177 struct MakeReferenceVariantHelper<std::variant<A...>> {
178 using type = ReferenceVariant<A...>;
179 };
180 template <typename... A>
181 struct MakeReferenceVariantHelper<std::tuple<A...>> {
182 using type = ReferenceVariant<A...>;
183 };
184 template <typename A>
185 using MakeReferenceVariant = typename MakeReferenceVariantHelper<A>::type;
186
187 using EvaluationTuple =
188 common::CombineTuples<ActionStmts, OtherStmts, ConstructStmts, Constructs,
189 Directives>;
193 using EvaluationVariant = MakeReferenceVariant<EvaluationTuple>;
194
197 struct Evaluation : EvaluationVariant {
198
200 template <typename A>
201 Evaluation(const A &a, const ParentVariant &parentVariant,
202 const parser::CharBlock &position,
203 const std::optional<parser::Label> &label)
204 : EvaluationVariant{a},
205 parentVariant{parentVariant}, position{position}, label{label} {}
206
208 template <typename A>
209 Evaluation(const A &a, const ParentVariant &parentVariant)
210 : EvaluationVariant{a}, parentVariant{parentVariant} {
211 static_assert(pft::isConstruct<A> || pft::isDirective<A>,
212 "must be a construct or directive");
213 }
214
216 constexpr bool isActionStmt() const {
217 return visit(common::visitors{
218 [](auto &r) { return pft::isActionStmt<std::decay_t<decltype(r)>>; }});
219 }
220 constexpr bool isOtherStmt() const {
221 return visit(common::visitors{
222 [](auto &r) { return pft::isOtherStmt<std::decay_t<decltype(r)>>; }});
223 }
224 constexpr bool isConstructStmt() const {
225 return visit(common::visitors{[](auto &r) {
226 return pft::isConstructStmt<std::decay_t<decltype(r)>>;
227 }});
228 }
229 constexpr bool isConstruct() const {
230 return visit(common::visitors{
231 [](auto &r) { return pft::isConstruct<std::decay_t<decltype(r)>>; }});
232 }
233 constexpr bool isDirective() const {
234 return visit(common::visitors{
235 [](auto &r) { return pft::isDirective<std::decay_t<decltype(r)>>; }});
236 }
237 constexpr bool isNopConstructStmt() const {
238 return visit(common::visitors{[](auto &r) {
239 return pft::isNopConstructStmt<std::decay_t<decltype(r)>>;
240 }});
241 }
242
245 constexpr bool isIntermediateConstructStmt() const {
246 return visit(common::visitors{[](auto &r) {
247 return pft::isIntermediateConstructStmt<std::decay_t<decltype(r)>>;
248 }});
249 }
250
253 Evaluation &nonNopSuccessor() const {
254 Evaluation *successor = lexicalSuccessor;
255 if (successor && successor->isNopConstructStmt()) {
256 successor = successor->parentConstruct->constructExit;
257 }
258 assert(successor && "missing successor");
259 return *successor;
260 }
261
263 bool hasNestedEvaluations() const {
264 return evaluationList && !evaluationList->empty();
265 }
266
268 EvaluationList &getNestedEvaluations() {
269 assert(evaluationList && "no nested evaluations");
270 return *evaluationList;
271 }
272
273 Evaluation &getFirstNestedEvaluation() {
274 assert(hasNestedEvaluations() && "no nested evaluations");
275 return evaluationList->front();
276 }
277
278 Evaluation &getLastNestedEvaluation() {
279 assert(hasNestedEvaluations() && "no nested evaluations");
280 return evaluationList->back();
281 }
282
284 FunctionLikeUnit *getOwningProcedure() const;
285
286 bool lowerAsStructured() const;
287 bool lowerAsUnstructured() const;
288
289 // FIR generation looks primarily at PFT statement (leaf) nodes. So members
290 // such as lexicalSuccessor and the various block fields are only applicable
291 // to statement nodes. One exception is that an internal construct node is
292 // a convenient place for a constructExit link that applies to exits from any
293 // statement within the construct. The controlSuccessor member is used for
294 // nonlexical successors, such as linking to a GOTO target. For multiway
295 // branches, controlSuccessor is set to one of the targets (might as well be
296 // the first target). Successor and exit links always target statements.
297 //
298 // An unstructured construct is one that contains some form of goto. This
299 // is indicated by the isUnstructured member flag, which may be set on a
300 // statement and propagated to enclosing constructs. This distinction allows
301 // a structured IF or DO statement to be materialized with custom structured
302 // FIR operations. An unstructured statement is materialized as mlir
303 // operation sequences that include explicit branches.
304 //
305 // There are two mlir::Block members. The block member is set for statements
306 // that begin a new block. If a statement may have more than one associated
307 // block, this member must be the block that would be the target of a branch
308 // to the statement. The prime example of a statement that may have multiple
309 // associated blocks is NonLabelDoStmt, which may have a loop preheader block
310 // for loop initialization code, and always has a header block that is the
311 // target of the loop back edge. If the NonLabelDoStmt is a concurrent loop,
312 // there may be an arbitrary number of nested preheader, header, and mask
313 // blocks. Any such additional blocks in the localBlocks member are local
314 // to a construct and cannot be the target of an unstructured branch. For
315 // NonLabelDoStmt, the block member designates the preheader block, which may
316 // be absent if loop initialization code may be appended to a predecessor
317 // block. The primary loop header block is localBlocks[0], with additional
318 // DO CONCURRENT blocks at localBlocks[1], etc.
319 //
320 // The printIndex member is only set for statements. It is used for dumps
321 // and does not affect FIR generation. It may also be helpful for debugging.
322
323 ParentVariant parentVariant;
324 parser::CharBlock position{};
325 std::optional<parser::Label> label{};
326 std::unique_ptr<EvaluationList> evaluationList; // nested evaluations
327 Evaluation *parentConstruct{nullptr}; // set for nodes below the top level
328 Evaluation *lexicalSuccessor{nullptr}; // set for ActionStmt, ConstructStmt
329 Evaluation *controlSuccessor{nullptr}; // set for some statements
330 Evaluation *constructExit{nullptr}; // set for constructs
331 bool isNewBlock{false}; // evaluation begins a new basic block
332 bool isUnstructured{false}; // evaluation has unstructured control flow
333 bool skip{false}; // evaluation has been processed in advance
334 mlir::Block *block{nullptr}; // isNewBlock block
335 llvm::SmallVector<mlir::Block *, 1> localBlocks{}; // construct local blocks
336 int printIndex{0}; // (ActionStmt, ConstructStmt) evaluation index for dumps
337 };
338
339 using ProgramVariant =
340 ReferenceVariant<parser::MainProgram, parser::FunctionSubprogram,
341 parser::SubroutineSubprogram, parser::Module,
342 parser::Submodule, parser::SeparateModuleSubprogram,
343 parser::BlockData>;
346 struct ProgramUnit : ProgramVariant {
347 template <typename A>
348 ProgramUnit(const A &p, const ParentVariant &parentVariant)
349 : ProgramVariant{p}, parentVariant{parentVariant} {}
350 ProgramUnit(ProgramUnit &&) = default;
351 ProgramUnit(const ProgramUnit &) = delete;
352
353 ParentVariant parentVariant;
354 };
355
362 struct Variable {
363 explicit Variable(const Fortran::semantics::Symbol &sym, bool global = false,
364 int depth = 0)
365 : sym{&sym}, depth{depth}, global{global} {}
366
367 const Fortran::semantics::Symbol &getSymbol() const { return *sym; }
368
369 bool isGlobal() const { return global; }
370 bool isHeapAlloc() const { return heapAlloc; }
371 bool isPointer() const { return pointer; }
372 bool isTarget() const { return target; }
373 int getDepth() const { return depth; }
374
375 void setHeapAlloc(bool to = true) { heapAlloc = to; }
376 void setPointer(bool to = true) { pointer = to; }
377 void setTarget(bool to = true) { target = to; }
378
379 private:
380 const Fortran::semantics::Symbol *sym;
381 int depth;
382 bool global;
383 bool heapAlloc{false}; // variable needs deallocation on exit
384 bool pointer{false};
385 bool target{false};
386 };
387
390 struct FunctionLikeUnit : public ProgramUnit {
391 // wrapper statements for function-like syntactic structures
392 using FunctionStatement =
393 ReferenceVariant<parser::Statement<parser::ProgramStmt>,
394 parser::Statement<parser::EndProgramStmt>,
395 parser::Statement<parser::FunctionStmt>,
396 parser::Statement<parser::EndFunctionStmt>,
397 parser::Statement<parser::SubroutineStmt>,
398 parser::Statement<parser::EndSubroutineStmt>,
399 parser::Statement<parser::MpSubprogramStmt>,
400 parser::Statement<parser::EndMpSubprogramStmt>>;
401
402 FunctionLikeUnit(
403 const parser::MainProgram &f, const ParentVariant &parentVariant,
404 const Fortran::semantics::SemanticsContext &semanticsContext);
405 FunctionLikeUnit(
406 const parser::FunctionSubprogram &f, const ParentVariant &parentVariant,
407 const Fortran::semantics::SemanticsContext &semanticsContext);
408 FunctionLikeUnit(
409 const parser::SubroutineSubprogram &f, const ParentVariant &parentVariant,
410 const Fortran::semantics::SemanticsContext &semanticsContext);
411 FunctionLikeUnit(
412 const parser::SeparateModuleSubprogram &f,
413 const ParentVariant &parentVariant,
414 const Fortran::semantics::SemanticsContext &semanticsContext);
415 FunctionLikeUnit(FunctionLikeUnit &&) = default;
416 FunctionLikeUnit(const FunctionLikeUnit &) = delete;
417
418 void processSymbolTable(const Fortran::semantics::Scope &);
419
420 std::vector<Variable> getOrderedSymbolTable() { return varList[0]; }
421
422 bool isMainProgram() const {
423 return endStmt.isA<parser::Statement<parser::EndProgramStmt>>();
424 }
425
427 parser::CharBlock getStartingSourceLoc() {
428 if (beginStmt)
429 return stmtSourceLoc(*beginStmt);
430 if (!evaluationList.empty())
431 return evaluationList.front().position;
432 return stmtSourceLoc(endStmt);
433 }
434
437 const semantics::Symbol &getSubprogramSymbol() const {
438 assert(symbol && "not inside a procedure");
439 return *symbol;
440 }
441
443 static parser::CharBlock stmtSourceLoc(const FunctionStatement &stmt) {
444 return stmt.visit(common::visitors{[](const auto &x) { return x.source; }});
445 }
446
448 std::optional<FunctionStatement> beginStmt;
449 FunctionStatement endStmt;
450 EvaluationList evaluationList;
451 LabelEvalMap labelEvaluationMap;
452 SymbolLabelMap assignSymbolLabelMap;
453 std::list<FunctionLikeUnit> nestedFunctions;
458 const semantics::Symbol *symbol{nullptr};
460 mlir::Block *finalBlock{};
461 std::vector<std::vector<Variable>> varList;
462 };
463
465 struct ModuleLikeUnit : public ProgramUnit {
466 // wrapper statements for module-like syntactic structures
467 using ModuleStatement =
468 ReferenceVariant<parser::Statement<parser::ModuleStmt>,
469 parser::Statement<parser::EndModuleStmt>,
470 parser::Statement<parser::SubmoduleStmt>,
471 parser::Statement<parser::EndSubmoduleStmt>>;
472
473 ModuleLikeUnit(const parser::Module &m, const ParentVariant &parentVariant);
474 ModuleLikeUnit(const parser::Submodule &m,
475 const ParentVariant &parentVariant);
476 ~ModuleLikeUnit() = default;
477 ModuleLikeUnit(ModuleLikeUnit &&) = default;
478 ModuleLikeUnit(const ModuleLikeUnit &) = delete;
479
480 ModuleStatement beginStmt;
481 ModuleStatement endStmt;
482 std::list<FunctionLikeUnit> nestedFunctions;
483 };
484
485 struct BlockDataUnit : public ProgramUnit {
486 BlockDataUnit(const parser::BlockData &bd,
487 const ParentVariant &parentVariant);
488 BlockDataUnit(BlockDataUnit &&) = default;
489 BlockDataUnit(const BlockDataUnit &) = delete;
490 };
491
493 struct Program {
494 using Units = std::variant<FunctionLikeUnit, ModuleLikeUnit, BlockDataUnit>;
495
496 Program() = default;
497 Program(Program &&) = default;
498 Program(const Program &) = delete;
499
500 std::list<Units> &getUnits() { return units; }
501
503 void dump();
504
505 private:
506 std::list<Units> units;
507 };
508
509 } // namespace pft
510
519 std::unique_ptr<pft::Program>
520 createPFT(const parser::Program &root,
521 const Fortran::semantics::SemanticsContext &semanticsContext);
522
524 void dumpPFT(llvm::raw_ostream &outputStream, pft::Program &pft);
525
526 } // namespace lower
527 } // namespace Fortran
528
529 #endif // FORTRAN_LOWER_PFTBUILDER_H
Fortran::lower::pft::Evaluation
Definition: PFTBuilder.h:197
Fortran::parser::DoConstruct
Definition: parse-tree.h:2228
Fortran::parser::BlockConstruct
Definition: parse-tree.h:2107
Fortran::parser::CriticalStmt
Definition: parse-tree.h:2145
Fortran::parser::Statement
Definition: parse-tree.h:344
Fortran::parser::EndChangeTeamStmt
Definition: parse-tree.h:2132
mlir
Definition: ConvertType.h:25
Fortran::parser::IfStmt
Definition: parse-tree.h:2278
Fortran::semantics::SemanticsContext
Definition: semantics.h:60
Fortran::parser::BlockData
Definition: parse-tree.h:2906
Fortran::lower::pft::ProgramUnit
Definition: PFTBuilder.h:346
Fortran::parser::EntryStmt
Definition: parse-tree.h:3189
Fortran::parser::CriticalConstruct
Definition: parse-tree.h:2154
Fortran::semantics::Symbol
Definition: symbol.h:479
Fortran::parser::WhereStmt
Definition: parse-tree.h:1962
Fortran::parser::ForallConstructStmt
Definition: parse-tree.h:2017
Fortran::lower::pft::Program
A Program is the top-level root of the PFT.
Definition: PFTBuilder.h:493
Fortran::parser::FormTeamStmt
Definition: parse-tree.h:2486
Fortran::parser::SubroutineSubprogram
Definition: parse-tree.h:3165
Fortran::lower::pft::Evaluation::getOwningProcedure
FunctionLikeUnit * getOwningProcedure() const
Return the FunctionLikeUnit containing this evaluation (or nullptr).
Definition: PFTBuilder.cpp:950
Fortran::parser::DeallocateStmt
Definition: parse-tree.h:1919
Fortran::parser::EventWaitStmt
Definition: parse-tree.h:2470
Fortran::parser::SelectRankStmt
Definition: parse-tree.h:2341
Fortran::parser::IfThenStmt
Definition: parse-tree.h:2241
Fortran::parser::SyncImagesStmt
Definition: parse-tree.h:2439
Fortran::parser::CaseStmt
Definition: parse-tree.h:2315
Fortran::lower::pft::Variable
Definition: PFTBuilder.h:362
Fortran::parser::FunctionSubprogram
Definition: parse-tree.h:3155
Fortran::lower::pft::FunctionLikeUnit::beginStmt
std::optional< FunctionStatement > beginStmt
Anonymous programs do not have a begin statement.
Definition: PFTBuilder.h:448
Fortran::parser::AssignStmt
Definition: parse-tree.h:3274
Fortran::parser::IfConstruct
Definition: parse-tree.h:2262
Fortran::lower::pft::Evaluation::nonNopSuccessor
Evaluation & nonNopSuccessor() const
Definition: PFTBuilder.h:253
Fortran::parser::AssignedGotoStmt
Definition: parse-tree.h:3279
Fortran::parser::ComputedGotoStmt
Definition: parse-tree.h:2414
Fortran::parser::WhereConstruct
Definition: parse-tree.h:1999
Fortran::common::Reference
Definition: reference.h:18
Fortran::parser::OpenMPConstruct
Definition: parse-tree.h:3791
Fortran::lower::pft::FunctionLikeUnit
Definition: PFTBuilder.h:390
Fortran::parser::WriteStmt
Definition: parse-tree.h:2657
Fortran::lower::pft::Evaluation::Evaluation
Evaluation(const A &a, const ParentVariant &parentVariant, const parser::CharBlock &position, const std::optional< parser::Label > &label)
General ctor.
Definition: PFTBuilder.h:201
Fortran::parser::SelectRankConstruct
Definition: parse-tree.h:2362
Fortran::lower::pft::Evaluation::isActionStmt
constexpr bool isActionStmt() const
Evaluation classification predicates.
Definition: PFTBuilder.h:216
Fortran::parser::StopStmt
Definition: parse-tree.h:2428
Fortran::parser::SyncTeamStmt
Definition: parse-tree.h:2452
Fortran::parser::NamelistStmt
Definition: parse-tree.h:606
Fortran::parser::PrintStmt
Definition: parse-tree.h:2672
Fortran::parser::SelectCaseStmt
Definition: parse-tree.h:2285
Fortran::parser::ArithmeticIfStmt
Definition: parse-tree.h:3269
Fortran::parser::Module
Definition: parse-tree.h:2850
Fortran::parser::ForallConstruct
Definition: parse-tree.h:2052
Fortran::parser::ChangeTeamConstruct
Definition: parse-tree.h:2138
Fortran::parser::CompilerDirective
Definition: parse-tree.h:3208
Fortran::lower::pft::FunctionLikeUnit::symbol
const semantics::Symbol * symbol
Definition: PFTBuilder.h:458
Fortran::lower::pft::BlockDataUnit
Definition: PFTBuilder.h:485
Fortran::parser::MaskedElsewhereStmt
Definition: parse-tree.h:1984
Fortran::parser::SeparateModuleSubprogram
Definition: parse-tree.h:3181
Fortran::parser::NonLabelDoStmt
Definition: parse-tree.h:2214
Fortran::parser::SelectRankCaseStmt
Definition: parse-tree.h:2350
Fortran::parser::EventPostStmt
Definition: parse-tree.h:2461
Fortran::lower::pft::MakeReferenceVariantHelper
Definition: PFTBuilder.h:175
Fortran::parser::CharBlock
Definition: char-block.h:28
Fortran::parser::AssociateStmt
Definition: parse-tree.h:2076
Fortran::parser::LockStmt
Definition: parse-tree.h:2500
Fortran::parser::TypeGuardStmt
Definition: parse-tree.h:2385
Fortran::lower::pft::Evaluation::Evaluation
Evaluation(const A &a, const ParentVariant &parentVariant)
Construct ctor.
Definition: PFTBuilder.h:209
Fortran::lower::pft::ModuleLikeUnit
Module-like units contain a list of function-like units.
Definition: PFTBuilder.h:465
Fortran::lower::pft::FunctionLikeUnit::finalBlock
mlir::Block * finalBlock
Terminal basic block (if any)
Definition: PFTBuilder.h:460
Fortran::lower::pft::FunctionLikeUnit::getStartingSourceLoc
parser::CharBlock getStartingSourceLoc()
Get the starting source location for this function like unit.
Definition: PFTBuilder.h:427
Fortran::lower::pft::Evaluation::hasNestedEvaluations
bool hasNestedEvaluations() const
Return true if this Evaluation has at least one nested evaluation.
Definition: PFTBuilder.h:263
Fortran::parser::ElseIfStmt
Definition: parse-tree.h:2248
Fortran::parser::ReadStmt
Definition: parse-tree.h:2635
Fortran::lower::pft::Evaluation::isIntermediateConstructStmt
constexpr bool isIntermediateConstructStmt() const
Definition: PFTBuilder.h:245
Fortran::lower::pft::Program::dump
void dump()
LLVM dump method on a Program.
Definition: PFTBuilder.cpp:1151
Fortran::parser::OmpEndLoopDirective
Definition: parse-tree.h:3758
Fortran::parser::CallStmt
Definition: parse-tree.h:3146
Fortran::parser::CaseConstruct
Definition: parse-tree.h:2327
Fortran::parser::MainProgram
Definition: parse-tree.h:2816
Fortran::parser::Submodule
Definition: parse-tree.h:2892
Fortran::lower::pft::Evaluation::getNestedEvaluations
EvaluationList & getNestedEvaluations()
Return nested evaluation list.
Definition: PFTBuilder.h:268
Fortran::parser::AllocateStmt
Definition: parse-tree.h:1900
Fortran::semantics::Scope
Definition: scope.h:56
Fortran::parser::SelectTypeStmt
Definition: parse-tree.h:2376
Fortran::common::visitors
Definition: idioms.h:58
Fortran::parser::AssociateConstruct
Definition: parse-tree.h:2085
Fortran::parser::WhereConstructStmt
Definition: parse-tree.h:1968
Fortran::parser::CloseStmt
Definition: parse-tree.h:2576
Fortran::lower::pft::FunctionLikeUnit::stmtSourceLoc
static parser::CharBlock stmtSourceLoc(const FunctionStatement &stmt)
Helper to get location from FunctionLikeUnit begin/end statements.
Definition: PFTBuilder.h:443
Fortran::lower::pft::FunctionLikeUnit::getSubprogramSymbol
const semantics::Symbol & getSubprogramSymbol() const
Definition: PFTBuilder.h:437
Fortran::parser::SelectTypeConstruct
Definition: parse-tree.h:2396
Fortran::parser::UnlockStmt
Definition: parse-tree.h:2510
Fortran::parser::AssignmentStmt
Definition: parse-tree.h:1925
Fortran::lower::pft::ReferenceVariantBase
Definition: PFTBuilder.h:50
Fortran::parser::ForallStmt
Definition: parse-tree.h:2029
Fortran::parser::ChangeTeamStmt
Definition: parse-tree.h:2123
Fortran::parser::PointerAssignmentStmt
Definition: parse-tree.h:1949
Fortran::parser::InquireStmt
Definition: parse-tree.h:2795