Skip to content

Commit ab3e81e

Browse files
committed
[flang][docs] Replace references to f18 in the docs with flang (Part 1)
Some light editing of some of the text was also done. The remaining references will be replaced in a later commit.
1 parent bfee9db commit ab3e81e

File tree

11 files changed

+101
-100
lines changed

11 files changed

+101
-100
lines changed

flang/docs/AssumedRank.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ Assumed-rank dummies are also represented in the
101101
represent assumed-rank in procedure characteristics.
102102

103103
### Runtime Representation of Assumed-Ranks
104-
Assumed-ranks are implemented as CFI_cdesc_t (18.5.3) with the addition of an
105-
f18 specific addendum when required for the type. This is the usual f18
106-
descriptor, and no changes is required to represent assumed-ranks in this data
104+
Assumed-ranks are implemented as CFI_cdesc_t (18.5.3) with the addition of a
105+
Flang specific addendum when required for the type. This is the usual Flang
106+
descriptor, and no changes are required to represent assumed-ranks in this data
107107
structure. In fact, there is no difference between the runtime descriptor
108108
created for an assumed shape and the runtime descriptor created when the
109109
corresponding entity is passed as an assumed-rank.
@@ -143,11 +143,11 @@ SSA values for assumed-rank entities have an MLIR type containing a
143143
(additionally wrapped in a `!fir.ref` type for pointers and allocatables).
144144

145145
Examples:
146-
`INTEGER :: x(..)` -> `!fir.box<!fir.array<* x i32>>`
146+
`INTEGER :: x(..)` -> `!fir.box<!fir.array<* x i32>>`
147147
`CLASS(*) :: x(..)` -> `!fir.class<!fir.array<* x none>>`
148148
`TYPE(*) :: x(..)` -> `!fir.box<!fir.array<* x none>>`
149149
`REAL, ALLOCATABLE :: x(..)` -> `!fir.ref<!fir.box<!fir.heap<!fir.array<* x f32>>>>`
150-
`TYPE(t), POINTER :: x(..)` -> `!fir.ref<!fir.box<!fir.ptr<!fir.array<* x !fir.type<t>>>>>`
150+
`TYPE(t), POINTER :: x(..)` -> `!fir.ref<!fir.box<!fir.ptr<!fir.array<* x !fir.type<t>>>>>`
151151

152152
All these FIR types are implemented as the address of a CFI_cdesc_t in code
153153
generation.
@@ -187,7 +187,7 @@ could still be relevant:
187187
support assumed-ranks, but `fir.box_tdesc` would require change since the
188188
position of the type descriptor pointer depends on the rank.
189189
- as `fir.allocmem` / `fir.global` result (assumed-ranks are never local/global
190-
entities).
190+
entities).
191191
- as `fir.embox` result (When creating descriptor for an explicit shape, the
192192
descriptor can be created with the entity rank, and then casted via
193193
`fir.convert`).
@@ -449,7 +449,7 @@ subroutine test(x)
449449
real :: x(..)
450450
end subroutine
451451
end interface
452-
452+
453453
real :: x(..)
454454
select rank (y => x)
455455
rank(*)
@@ -531,7 +531,7 @@ print *, len(x)
531531

532532
```
533533
%ele_size = fir.box_elesize %x : (!fir.box<!fir.array<*x!fir.char<?>>>) -> i64
534-
# .... divide by character KIND byte size if needed as usual
534+
# .... divide by character KIND byte size if needed as usual
535535
```
536536
#### PRESENT
537537
Implemented inline with `fir.is_present` which ends-up implemented as a check
@@ -564,7 +564,7 @@ present and is constant, `fir.box_dim` can also be used with the option to add
564564
a runtime check that RANK <= DIM. Pointers and allocatables are dereferenced,
565565
which in FIR currently creates a descriptor copy that cannot be simplified
566566
like for the previous inquiries by inserting a cast before the fir.load (the
567-
dimension info must be correctly copied).
567+
dimension info must be correctly copied).
568568

569569
#### LBOUND, SHAPE, and UBOUND
570570
When DIM is present an is present, the runtime can be used as it is currently

flang/docs/C++17.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<!--===- docs/C++17.md
2-
1+
<!--===- docs/C++17.md
2+
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
6-
6+
77
-->
88

9-
# C++14/17 features used in f18
9+
# C++14/17 features used in Flang
1010

1111
```{contents}
1212
---
@@ -27,7 +27,7 @@ out the details of how our C++ code should look and gives
2727
guidance about feature usage.
2828

2929
We have chosen to use some features of the recent C++17
30-
language standard in f18.
30+
language standard in Flang.
3131
The most important of these are:
3232
* sum types (discriminated unions) in the form of `std::variant`
3333
* `using` template parameter packs
@@ -41,7 +41,7 @@ in this list because it's not particularly well known.)
4141
## Sum types
4242

4343
First, some background information to explain the need for sum types
44-
in f18.
44+
in Flang.
4545

4646
Fortran is notoriously problematic to lex and parse, as tokenization
4747
depends on the state of the partial parse;
@@ -57,7 +57,7 @@ a unified lexer/parser.
5757
We have chosen to do so because it is simpler and should reduce
5858
both initial bugs and long-term maintenance.
5959

60-
Specifically, f18's parser uses the technique of recursive descent with
60+
Specifically, Flang's parser uses the technique of recursive descent with
6161
backtracking.
6262
It is constructed as the incremental composition of pure parsing functions
6363
that each, when given a context (location in the input stream plus some state),
@@ -73,7 +73,7 @@ of Fortran.
7373

7474
The specification of Fortran uses a form of BNF with alternatives,
7575
optional elements, sequences, and lists. Each of these constructs
76-
in the Fortran grammar maps directly in the f18 parser to both
76+
in the Fortran grammar maps directly in Flang's parser to both
7777
the means of combining other parsers as alternatives, &c., and to
7878
the declarations of the parse tree data structures that represent
7979
the results of successful parses.
@@ -87,10 +87,10 @@ The bounded polymorphism supplied by the C++17 `std::variant` fits
8787
those needs exactly.
8888
For example, production R502 in Fortran defines the top-level
8989
program unit of Fortran as being a function, subroutine, module, &c.
90-
The `struct ProgramUnit` in the f18 parse tree header file
90+
`struct ProgramUnit` in the Flang parse tree header file
9191
represents each program unit with a member that is a `std::variant`
9292
over the six possibilities.
93-
Similarly, the parser for that type in the f18 grammar has six alternatives,
93+
Similarly, the parser for that type in Flang's grammar has six alternatives,
9494
each of which constructs an instance of `ProgramUnit` upon the result of
9595
parsing a `Module`, `FunctionSubprogram`, and so on.
9696

@@ -99,7 +99,7 @@ parse is typically implemented with overloaded functions.
9999
A function instantiated on `ProgramUnit` will use `std::visit` to
100100
identify the right alternative and perform the right actions.
101101
The call to `std::visit` must pass a visitor that can handle all
102-
of the possibilities, and f18 will fail to build if one is missing.
102+
of the possibilities, and Flang will fail to build if one is missing.
103103

104104
Were we unable to use `std::variant` directly, we would likely
105105
have chosen to implement a local `SumType` replacement; in the

flang/docs/C++style.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<!--===- docs/C++style.md
2-
1+
<!--===- docs/C++style.md
2+
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
6-
6+
77
-->
88

99
# Flang C++ Style Guide
@@ -30,7 +30,7 @@ is clear on usage, follow it.
3030
is pretty good and comes with lots of justifications for its rules.
3131
* Reasonable exceptions to these guidelines can be made.
3232
* Be aware of some workarounds for known issues in older C++ compilers that should
33-
still be able to compile f18. They are listed at the end of this document.
33+
still be able to compile Flang. They are listed at the end of this document.
3434

3535
## In particular:
3636

@@ -261,7 +261,7 @@ move semantics, member access, and comparison for equality; suitable for use in
261261
`std::variant<>`.
262262
* `std::unique_ptr<>`: A nullable pointer with ownership, null by default,
263263
not copyable, reassignable.
264-
F18 has a helpful `Deleter<>` class template that makes `unique_ptr<>`
264+
Flang has a helpful `Deleter<>` class template that makes `unique_ptr<>`
265265
easier to use with forward-referenced data types.
266266
* `std::shared_ptr<>`: A nullable pointer with shared ownership via reference
267267
counting, null by default, shallowly copyable, reassignable, and slow.
@@ -312,9 +312,9 @@ Consistency is one of many aspects in the pursuit of clarity,
312312
but not an end in itself.
313313

314314
## C++ compiler bug workarounds
315-
Below is a list of workarounds for C++ compiler bugs met with f18 that, even
316-
if the bugs are fixed in latest C++ compiler versions, need to be applied so
317-
that all desired tool-chains can compile f18.
315+
Below is a list of workarounds for C++ compiler bugs encountered when building
316+
Flang. Even if the bugs are fixed in latest C++ compiler versions, these need to
317+
be applied so that all desired tool-chains can compile Flang.
318318

319319
### Explicitly move noncopyable local variable into optional results
320320

@@ -338,7 +338,7 @@ std::optional<CantBeCopied> fooOK() {
338338
}
339339
```
340340
The underlying bug is actually not specific to `std::optional` but this is the most common
341-
case in f18 where the issue may occur. The actual bug can be reproduced with any class `B`
341+
case in Flang where the issue may occur. The actual bug can be reproduced with any class `B`
342342
that has a perfect forwarding constructor taking `CantBeCopied` as argument:
343343
`template<typename CantBeCopied> B(CantBeCopied&& x) x_{std::forward<CantBeCopied>(x)} {}`.
344344
In such scenarios, Ubuntu 18.04 g++ fails to instantiate the move constructor

flang/docs/Calls.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ PGI passes host instance links in descriptors in additional arguments
529529
that are not always successfully forwarded across implicit interfaces,
530530
sometimes leading to crashes when they turn out to be needed.
531531

532-
F18 will manage a pool of trampolines in its runtime support library
532+
Flang will manage a pool of trampolines in its runtime support library
533533
that can be used to pass internal procedures as effective arguments
534534
to F77ish procedures, so that
535535
a bare code address can serve to represent the effective argument.
@@ -569,14 +569,14 @@ Fortran 2018 explicitly enables us to do this with a correction to Fortran
569569
2003 in 4.3.4(5).
570570

571571
Last, there must be reasonably permanent naming conventions used
572-
by the F18 runtime library for those unrestricted specific intrinsic
572+
by Flang's runtime library for those unrestricted specific intrinsic
573573
functions (table 16.2 in 16.8) and extensions that can be passed as
574574
arguments.
575575

576576
In these cases where external naming is at the discretion
577577
of the implementation, we should use names that are not in the C language
578578
user namespace, begin with something that identifies
579-
the current incompatible version of F18, the module, the submodule, and
579+
the current incompatible version of Flang, the module, the submodule, and
580580
elemental SIMD width, and are followed by the external name.
581581
The parts of the external name can be separated by some character that
582582
is acceptable for use in LLVM IR and assembly language but not in user

flang/docs/Character.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
-->
88

9-
# Implementation of `CHARACTER` types in f18
9+
# Implementation of `CHARACTER` types in Flang
1010

1111
```{contents}
1212
---
@@ -16,7 +16,7 @@ local:
1616

1717
## Kinds and Character Sets
1818

19-
The f18 compiler and runtime support three kinds of the intrinsic
19+
The Flang compiler and runtime support three kinds of the intrinsic
2020
`CHARACTER` type of Fortran 2018.
2121
The default (`CHARACTER(KIND=1)`) holds 8-bit character codes;
2222
`CHARACTER(KIND=2)` holds 16-bit character codes;
@@ -108,12 +108,12 @@ The result of `//` may be used
108108
* as the value of a specifier of an I/O statement,
109109
* or as the value of a statement function.
110110

111-
The f18 compiler has a general (but slow) means of implementing concatenation
111+
The Flang compiler has a general (but slow) means of implementing concatenation
112112
and a specialized (fast) option to optimize the most common case.
113113

114114
### General concatenation
115115

116-
In the most general case, the f18 compiler's generated code and
116+
In the most general case, Flang's generated code and
117117
runtime support library represent the result as a deferred-length allocatable
118118
`CHARACTER` temporary scalar or array variable that is initialized
119119
as a zero-length array by `AllocatableInitCharacter()`

flang/docs/DoConcurrent.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<!--===- docs/DoConcurrent.md
2-
1+
<!--===- docs/DoConcurrent.md
2+
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
6-
6+
77
-->
88

99
# `DO CONCURRENT` isn't necessarily concurrent
@@ -280,7 +280,8 @@ Specifically, an easy means is required that stipulates that localization
280280
should apply at most only to the obvious cases of local non-pointer
281281
non-allocatable scalars.
282282

283-
In the LLVM Fortran compiler project (a/k/a "flang", "f18") we considered
283+
In the LLVM Fortran compiler project (now known as "flang", previously also
284+
known as "f18") we considered
284285
several solutions to this problem.
285286
1. Add syntax (e.g., `DO PARALLEL` or `DO CONCURRENT() DEFAULT(PARALLEL)`)
286287
by which one can inform the compiler that it should localize only

0 commit comments

Comments
 (0)