You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[flang] [LLVMify F18] Compiler module folders should have capitalised names (flang-compiler/f18#980)
This patch renames the modules in f18 to use a capital letter in the
module name
Signed-off-by: Caroline Concatto <caroline.concatto@arm.com>
Original-commit: flang-compiler/f18@d2eb7a1
Reviewed-on: flang-compiler/f18#980
Copy file name to clipboardExpand all lines: flang/documentation/ImplementingASemanticCheck.md
+23-23Lines changed: 23 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -111,9 +111,9 @@ checking had already taken place.
111
111
Most semantic checks for statements are implemented by walking the parse tree
112
112
and performing analysis on the nodes they visit. My plan was to use this
113
113
method. The infrastructure for walking the parse tree for statement semantic
114
-
checking is implemented in the files `lib/semantics/semantics.cpp`.
114
+
checking is implemented in the files `lib/Semantics/semantics.cpp`.
115
115
Here's a fragment of the declaration of the framework's parse tree visitor from
116
-
`lib/semantics/semantics.cpp`:
116
+
`lib/Semantics/semantics.cpp`:
117
117
118
118
```C++
119
119
// A parse tree visitor that calls Enter/Leave functions from each checker
@@ -136,7 +136,7 @@ Here's a fragment of the declaration of the framework's parse tree visitor from
136
136
Since FUNCTION calls are a kind of expression, I was planning to base my
137
137
implementation on the contents of `parser::Expr` nodes. I would need to define
138
138
either an `Enter()` or `Leave()` function whose parameter was a `parser::Expr`
139
-
node. Here's the declaration I put into `lib/semantics/check-do.h`:
139
+
node. Here's the declaration I put into `lib/Semantics/check-do.h`:
140
140
141
141
```C++
142
142
void Leave(const parser::Expr &);
@@ -148,12 +148,12 @@ arbitrarily chose to implement the `Leave()` function to visit the parse tree
148
148
node.
149
149
150
150
Since my semantic check was focused on DO CONCURRENT statements, I added it to
151
-
the file `lib/semantics/check-do.cpp` where most of the semantic checking for
151
+
the file `lib/Semantics/check-do.cpp` where most of the semantic checking for
152
152
DO statements already lived.
153
153
154
154
## Taking advantage of prior work
155
155
When implementing a similar check for SUBROUTINE calls, I created a utility
156
-
functions in `lib/semantics/semantics.cpp` to emit messages if
156
+
functions in `lib/Semantics/semantics.cpp` to emit messages if
157
157
a symbol corresponding to an active DO variable was being potentially modified:
158
158
159
159
```C++
@@ -176,15 +176,15 @@ functions. The second is needed to determine whether to call them.
176
176
## Finding the source location
177
177
The source code location information that I'd need for the error message must
178
178
come from the parse tree. I looked in the file
179
-
`include/flang/parser/parse-tree.h` and determined that a `struct Expr`
179
+
`include/flang/Parser/parse-tree.h` and determined that a `struct Expr`
180
180
contained source location information since it had the field `CharBlock
181
181
source`. Thus, if I visited a `parser::Expr` node, I could get the source
182
182
location information for the associated expression.
183
183
184
184
## Determining the `INTENT`
185
185
I knew that I could find the `INTENT` of the dummy argument associated with the
186
186
actual argument from the function called `dummyIntent()` in the class
187
-
`evaluate::ActualArgument` in the file `include/flang/evaluate/call.h`. So
187
+
`evaluate::ActualArgument` in the file `include/flang/Evaluate/call.h`. So
188
188
if I could find an `evaluate::ActualArgument` in an expression, I could
189
189
determine the `INTENT` of the associated dummy argument. I knew that it was
190
190
valid to call `dummyIntent()` because the data on which `dummyIntent()`
@@ -216,12 +216,12 @@ find all of the `evaluate::ActualArgument` nodes.
216
216
217
217
Note that the compiler has multiple types called `Expr`. One is in the
218
218
`parser` namespace. `parser::Expr` is defined in the file
219
-
`include/flang/parser/parse-tree.h`. It represents a parsed expression that
219
+
`include/flang/Parser/parse-tree.h`. It represents a parsed expression that
220
220
maps directly to the source code and has fields that specify any operators in
221
221
the expression, the operands, and the source position of the expression.
222
222
223
223
Additionally, in the namespace `evaluate`, there are `evaluate::Expr<T>`
224
-
template classes defined in the file `include/flang/evaluate/expression.h`.
224
+
template classes defined in the file `include/flang/Evaluate/expression.h`.
225
225
These are parameterized over the various types of Fortran and constitute a
226
226
suite of strongly-typed representations of valid Fortran expressions of type
227
227
`T` that have been fully elaborated with conversion operations and subjected to
@@ -231,7 +231,7 @@ owns an instance of `evaluate::Expr<SomeType>`, the most general representation
231
231
of an analyzed expression.
232
232
233
233
All of the declarations associated with both FUNCTION and SUBROUTINE calls are
234
-
in `include/flang/evaluate/call.h`. An `evaluate::FunctionRef` inherits from
234
+
in `include/flang/Evaluate/call.h`. An `evaluate::FunctionRef` inherits from
235
235
an `evaluate::ProcedureRef` which contains the list of
236
236
`evaluate::ActualArgument` nodes. But the relationship between an
237
237
`evaluate::FunctionRef` node and its associated arguments is not relevant. I
@@ -269,16 +269,16 @@ argument was an active DO variable.
269
269
## Adding a parse tree visitor
270
270
I started my implementation by adding a visitor for `parser::Expr` nodes.
271
271
Since this analysis is part of DO construct checking, I did this in
272
-
`lib/semantics/check-do.cpp`. I added a print statement to the visitor to
272
+
`lib/Semantics/check-do.cpp`. I added a print statement to the visitor to
273
273
verify that my new code was actually getting executed.
274
274
275
-
In `lib/semantics/check-do.h`, I added the declaration for the visitor:
275
+
In `lib/Semantics/check-do.h`, I added the declaration for the visitor:
276
276
277
277
```C++
278
278
void Leave(const parser::Expr &);
279
279
```
280
280
281
-
In `lib/semantics/check-do.cpp`, I added an (almost empty) implementation:
281
+
In `lib/Semantics/check-do.cpp`, I added an (almost empty) implementation:
282
282
283
283
```C++
284
284
voidDoChecker::Leave(const parser::Expr &) {
@@ -316,7 +316,7 @@ framework to walk the `evaluate::Expr` to gather all of the
316
316
`evaluate::ActualArgument` nodes. The code that I planned to model it on
317
317
was the existing infrastructure that collected all of the `semantics::Symbol` nodes from an
318
318
`evaluate::Expr`. I found this implementation in
319
-
`lib/evaluate/tools.cpp`:
319
+
`lib/Evaluate/tools.cpp`:
320
320
321
321
```C++
322
322
structCollectSymbolsHelper
@@ -334,7 +334,7 @@ was the existing infrastructure that collected all of the `semantics::Symbol` no
334
334
```
335
335
336
336
Note that the `CollectSymbols()` function returns a `semantics::Symbolset`,
337
-
which is declared in `include/flang/semantics/symbol.h`:
337
+
which is declared in `include/flang/Semantics/symbol.h`:
338
338
339
339
```C++
340
340
using SymbolSet = std::set<SymbolRef>;
@@ -356,11 +356,11 @@ full `semantics::Symbol` objects into the set. Ideally, we would be able to cre
356
356
`std::set<Symbol &>` (a set of C++ references to symbols). But C++ doesn't
357
357
support sets that contain references. This limitation is part of the rationale
358
358
for the f18 implementation of type `common::Reference`, which is defined in
359
-
`include/flang/common/reference.h`.
359
+
`include/flang/Common/reference.h`.
360
360
361
361
`SymbolRef`, the specialization of the template `common::Reference` for
362
362
`semantics::Symbol`, is declared in the file
363
-
`include/flang/semantics/symbol.h`:
363
+
`include/flang/Semantics/symbol.h`:
364
364
365
365
```C++
366
366
using SymbolRef = common::Reference<const Symbol>;
@@ -370,7 +370,7 @@ So to implement something that would collect `evaluate::ActualArgument`
370
370
nodes from an `evaluate::Expr`, I first defined the required types
371
371
`ActualArgumentRef` and `ActualArgumentSet`. Since these are being
372
372
used exclusively for DO construct semantic checking (currently), I put their
373
-
definitions into `lib/semantics/check-do.cpp`:
373
+
definitions into `lib/Semantics/check-do.cpp`:
374
374
375
375
376
376
```C++
@@ -386,7 +386,7 @@ Since `ActualArgument` is in the namespace `evaluate`, I put the
386
386
definition for `ActualArgumentRef` in that namespace, too.
387
387
388
388
I then modeled the code to create an `ActualArgumentSet` after the code to
389
-
collect a `SymbolSet` and put it into `lib/semantics/check-do.cpp`:
389
+
collect a `SymbolSet` and put it into `lib/Semantics/check-do.cpp`:
390
390
391
391
392
392
```C++
@@ -525,8 +525,8 @@ symbol table node (`semantics::Symbol`) for the variable. My starting point was
525
525
`evaluate::ActualArgument` node.
526
526
527
527
I was unsure of how to do this, so I browsed through existing code to look for
528
-
how it treated `evaluate::ActualArgument` objects. Since most of the code that deals with the `evaluate` namespace is in the lib/evaluate directory, I looked there. I ran `grep` on all of the `.cpp` files looking for
529
-
uses of `ActualArgument`. One of the first hits I got was in `lib/evaluate/call.cpp` in the definition of `ActualArgument::GetType()`:
528
+
how it treated `evaluate::ActualArgument` objects. Since most of the code that deals with the `evaluate` namespace is in the lib/Evaluate directory, I looked there. I ran `grep` on all of the `.cpp` files looking for
529
+
uses of `ActualArgument`. One of the first hits I got was in `lib/Evaluate/call.cpp` in the definition of `ActualArgument::GetType()`:
0 commit comments