Skip to content

Commit

Permalink
[flang] [LLVMify F18] Compiler module folders should have capitalised…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
CarolineConcatto committed Feb 25, 2020
1 parent 456a61d commit 64ab330
Show file tree
Hide file tree
Showing 655 changed files with 905 additions and 905 deletions.
2 changes: 1 addition & 1 deletion flang/documentation/C++style.md
Expand Up @@ -219,7 +219,7 @@ or assignments should exist for a class, explicitly `=delete` all of them.
There are many -- perhaps too many -- means of indirect addressing
data in this project.
Some of these are standard C++ language and library features,
while others are local inventions in `lib/common`:
while others are local inventions in `lib/Common`:
* Bare pointers (`Foo *p`): these are obviously nullable, non-owning,
undefined when uninitialized, shallowly copyable, reassignable, and often
not the right abstraction to use in this project.
Expand Down
46 changes: 23 additions & 23 deletions flang/documentation/ImplementingASemanticCheck.md
Expand Up @@ -111,9 +111,9 @@ checking had already taken place.
Most semantic checks for statements are implemented by walking the parse tree
and performing analysis on the nodes they visit. My plan was to use this
method. The infrastructure for walking the parse tree for statement semantic
checking is implemented in the files `lib/semantics/semantics.cpp`.
checking is implemented in the files `lib/Semantics/semantics.cpp`.
Here's a fragment of the declaration of the framework's parse tree visitor from
`lib/semantics/semantics.cpp`:
`lib/Semantics/semantics.cpp`:

```C++
// A parse tree visitor that calls Enter/Leave functions from each checker
Expand All @@ -136,7 +136,7 @@ Here's a fragment of the declaration of the framework's parse tree visitor from
Since FUNCTION calls are a kind of expression, I was planning to base my
implementation on the contents of `parser::Expr` nodes. I would need to define
either an `Enter()` or `Leave()` function whose parameter was a `parser::Expr`
node. Here's the declaration I put into `lib/semantics/check-do.h`:
node. Here's the declaration I put into `lib/Semantics/check-do.h`:
```C++
void Leave(const parser::Expr &);
Expand All @@ -148,12 +148,12 @@ arbitrarily chose to implement the `Leave()` function to visit the parse tree
node.

Since my semantic check was focused on DO CONCURRENT statements, I added it to
the file `lib/semantics/check-do.cpp` where most of the semantic checking for
the file `lib/Semantics/check-do.cpp` where most of the semantic checking for
DO statements already lived.

## Taking advantage of prior work
When implementing a similar check for SUBROUTINE calls, I created a utility
functions in `lib/semantics/semantics.cpp` to emit messages if
functions in `lib/Semantics/semantics.cpp` to emit messages if
a symbol corresponding to an active DO variable was being potentially modified:

```C++
Expand All @@ -176,15 +176,15 @@ functions. The second is needed to determine whether to call them.
## Finding the source location
The source code location information that I'd need for the error message must
come from the parse tree. I looked in the file
`include/flang/parser/parse-tree.h` and determined that a `struct Expr`
`include/flang/Parser/parse-tree.h` and determined that a `struct Expr`
contained source location information since it had the field `CharBlock
source`. Thus, if I visited a `parser::Expr` node, I could get the source
location information for the associated expression.
## Determining the `INTENT`
I knew that I could find the `INTENT` of the dummy argument associated with the
actual argument from the function called `dummyIntent()` in the class
`evaluate::ActualArgument` in the file `include/flang/evaluate/call.h`. So
`evaluate::ActualArgument` in the file `include/flang/Evaluate/call.h`. So
if I could find an `evaluate::ActualArgument` in an expression, I could
determine the `INTENT` of the associated dummy argument. I knew that it was
valid to call `dummyIntent()` because the data on which `dummyIntent()`
Expand Down Expand Up @@ -216,12 +216,12 @@ find all of the `evaluate::ActualArgument` nodes.

Note that the compiler has multiple types called `Expr`. One is in the
`parser` namespace. `parser::Expr` is defined in the file
`include/flang/parser/parse-tree.h`. It represents a parsed expression that
`include/flang/Parser/parse-tree.h`. It represents a parsed expression that
maps directly to the source code and has fields that specify any operators in
the expression, the operands, and the source position of the expression.

Additionally, in the namespace `evaluate`, there are `evaluate::Expr<T>`
template classes defined in the file `include/flang/evaluate/expression.h`.
template classes defined in the file `include/flang/Evaluate/expression.h`.
These are parameterized over the various types of Fortran and constitute a
suite of strongly-typed representations of valid Fortran expressions of type
`T` that have been fully elaborated with conversion operations and subjected to
Expand All @@ -231,7 +231,7 @@ owns an instance of `evaluate::Expr<SomeType>`, the most general representation
of an analyzed expression.

All of the declarations associated with both FUNCTION and SUBROUTINE calls are
in `include/flang/evaluate/call.h`. An `evaluate::FunctionRef` inherits from
in `include/flang/Evaluate/call.h`. An `evaluate::FunctionRef` inherits from
an `evaluate::ProcedureRef` which contains the list of
`evaluate::ActualArgument` nodes. But the relationship between an
`evaluate::FunctionRef` node and its associated arguments is not relevant. I
Expand Down Expand Up @@ -269,16 +269,16 @@ argument was an active DO variable.
## Adding a parse tree visitor
I started my implementation by adding a visitor for `parser::Expr` nodes.
Since this analysis is part of DO construct checking, I did this in
`lib/semantics/check-do.cpp`. I added a print statement to the visitor to
`lib/Semantics/check-do.cpp`. I added a print statement to the visitor to
verify that my new code was actually getting executed.
In `lib/semantics/check-do.h`, I added the declaration for the visitor:
In `lib/Semantics/check-do.h`, I added the declaration for the visitor:
```C++
void Leave(const parser::Expr &);
```

In `lib/semantics/check-do.cpp`, I added an (almost empty) implementation:
In `lib/Semantics/check-do.cpp`, I added an (almost empty) implementation:

```C++
void DoChecker::Leave(const parser::Expr &) {
Expand Down Expand Up @@ -316,7 +316,7 @@ framework to walk the `evaluate::Expr` to gather all of the
`evaluate::ActualArgument` nodes. The code that I planned to model it on
was the existing infrastructure that collected all of the `semantics::Symbol` nodes from an
`evaluate::Expr`. I found this implementation in
`lib/evaluate/tools.cpp`:
`lib/Evaluate/tools.cpp`:

```C++
struct CollectSymbolsHelper
Expand All @@ -334,7 +334,7 @@ was the existing infrastructure that collected all of the `semantics::Symbol` no
```
Note that the `CollectSymbols()` function returns a `semantics::Symbolset`,
which is declared in `include/flang/semantics/symbol.h`:
which is declared in `include/flang/Semantics/symbol.h`:
```C++
using SymbolSet = std::set<SymbolRef>;
Expand All @@ -356,11 +356,11 @@ full `semantics::Symbol` objects into the set. Ideally, we would be able to cre
`std::set<Symbol &>` (a set of C++ references to symbols). But C++ doesn't
support sets that contain references. This limitation is part of the rationale
for the f18 implementation of type `common::Reference`, which is defined in
`include/flang/common/reference.h`.
`include/flang/Common/reference.h`.
`SymbolRef`, the specialization of the template `common::Reference` for
`semantics::Symbol`, is declared in the file
`include/flang/semantics/symbol.h`:
`include/flang/Semantics/symbol.h`:
```C++
using SymbolRef = common::Reference<const Symbol>;
Expand All @@ -370,7 +370,7 @@ So to implement something that would collect `evaluate::ActualArgument`
nodes from an `evaluate::Expr`, I first defined the required types
`ActualArgumentRef` and `ActualArgumentSet`. Since these are being
used exclusively for DO construct semantic checking (currently), I put their
definitions into `lib/semantics/check-do.cpp`:
definitions into `lib/Semantics/check-do.cpp`:


```C++
Expand All @@ -386,7 +386,7 @@ Since `ActualArgument` is in the namespace `evaluate`, I put the
definition for `ActualArgumentRef` in that namespace, too.
I then modeled the code to create an `ActualArgumentSet` after the code to
collect a `SymbolSet` and put it into `lib/semantics/check-do.cpp`:
collect a `SymbolSet` and put it into `lib/Semantics/check-do.cpp`:
```C++
Expand Down Expand Up @@ -525,8 +525,8 @@ symbol table node (`semantics::Symbol`) for the variable. My starting point was
`evaluate::ActualArgument` node.

I was unsure of how to do this, so I browsed through existing code to look for
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
uses of `ActualArgument`. One of the first hits I got was in `lib/evaluate/call.cpp` in the definition of `ActualArgument::GetType()`:
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
uses of `ActualArgument`. One of the first hits I got was in `lib/Evaluate/call.cpp` in the definition of `ActualArgument::GetType()`:

```C++
std::optional<DynamicType> ActualArgument::GetType() const {
Expand All @@ -544,7 +544,7 @@ I noted the call to `UnwrapExpr()` that yielded a value of
`Expr<SomeType>`. So I guessed that I could use this member function to
get an `evaluate::Expr<SomeType>` on which I could perform further analysis.

I also knew that the header file `include/flang/evaluate/tools.h` held many
I also knew that the header file `include/flang/Evaluate/tools.h` held many
utility functions for dealing with `evaluate::Expr` objects. I was hoping to
find something that would determine if an `evaluate::Expr` was a variable. So
I searched for `IsVariable` and got a hit immediately.
Expand All @@ -560,7 +560,7 @@ I searched for `IsVariable` and got a hit immediately.
But I actually needed more than just the knowledge that an `evaluate::Expr` was
a variable. I needed the `semantics::Symbol` associated with the variable. So
I searched in `include/flang/evaluate/tools.h` for functions that returned a
I searched in `include/flang/Evaluate/tools.h` for functions that returned a
`semantics::Symbol`. I found the following:
```C++
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/Fortran-features.h -----------------*- C++ -*-===//
//===-- include/flang/Common/Fortran-features.h -----------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -9,9 +9,9 @@
#ifndef FORTRAN_COMMON_FORTRAN_FEATURES_H_
#define FORTRAN_COMMON_FORTRAN_FEATURES_H_

#include "flang/common/Fortran.h"
#include "flang/common/enum-set.h"
#include "flang/common/idioms.h"
#include "flang/Common/Fortran.h"
#include "flang/Common/enum-set.h"
#include "flang/Common/idioms.h"

namespace Fortran::common {

Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/Fortran.h --------------------------*- C++ -*-===//
//===-- include/flang/Common/Fortran.h --------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/bit-population-count.h -------------*- C++ -*-===//
//===-- include/flang/Common/bit-population-count.h -------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/constexpr-bitset.h -----------------*- C++ -*-===//
//===-- include/flang/Common/constexpr-bitset.h -----------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/default-kinds.h --------------------*- C++ -*-===//
//===-- include/flang/Common/default-kinds.h --------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -9,7 +9,7 @@
#ifndef FORTRAN_COMMON_DEFAULT_KINDS_H_
#define FORTRAN_COMMON_DEFAULT_KINDS_H_

#include "flang/common/Fortran.h"
#include "flang/Common/Fortran.h"
#include <cstdint>

namespace Fortran::common {
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/enum-set.h -------------------------*- C++ -*-===//
//===-- include/flang/Common/enum-set.h -------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/format.h ---------------------------*- C++ -*-===//
//===-- include/flang/Common/format.h ---------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -10,7 +10,7 @@
#define FORTRAN_COMMON_FORMAT_H_

#include "enum-set.h"
#include "flang/common/Fortran.h"
#include "flang/Common/Fortran.h"
#include <cstring>

// Define a FormatValidator class template to validate a format expression
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/idioms.h ---------------------------*- C++ -*-===//
//===-- include/flang/Common/idioms.h ---------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/indirection.h ----------------------*- C++ -*-===//
//===-- include/flang/Common/indirection.h ----------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/interval.h -------------------------*- C++ -*-===//
//===-- include/flang/Common/interval.h -------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/leading-zero-bit-count.h -----------*- C++ -*-===//
//===-- include/flang/Common/leading-zero-bit-count.h -----------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/real.h -----------------------------*- C++ -*-===//
//===-- include/flang/Common/real.h -----------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/reference-counted.h ----------------*- C++ -*-===//
//===-- include/flang/Common/reference-counted.h ----------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/reference.h ------------------------*- C++ -*-===//
//===-- include/flang/Common/reference.h ------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/restorer.h -------------------------*- C++ -*-===//
//===-- include/flang/Common/restorer.h -------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/template.h -------------------------*- C++ -*-===//
//===-- include/flang/Common/template.h -------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -9,7 +9,7 @@
#ifndef FORTRAN_COMMON_TEMPLATE_H_
#define FORTRAN_COMMON_TEMPLATE_H_

#include "flang/common/idioms.h"
#include "flang/Common/idioms.h"
#include <functional>
#include <optional>
#include <tuple>
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/uint128.h --------------------------*- C++ -*-===//
//===-- include/flang/Common/uint128.h --------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/unsigned-const-division.h ----------*- C++ -*-===//
//===-- include/flang/Common/unsigned-const-division.h ----------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/common/unwrap.h ---------------------------*- C++ -*-===//
//===-- include/flang/Common/unwrap.h ---------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/decimal/binary-floating-point.h -----------*- C++ -*-===//
//===-- include/flang/Decimal/binary-floating-point.h -----------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -12,8 +12,8 @@
// Access and manipulate the fields of an IEEE-754 binary
// floating-point value via a generalized template.

#include "flang/common/real.h"
#include "flang/common/uint128.h"
#include "flang/Common/real.h"
#include "flang/Common/uint128.h"
#include <cinttypes>
#include <climits>
#include <cstring>
Expand Down
@@ -1,4 +1,4 @@
/*===-- include/flang/decimal/decimal.h ---------------------------*- C++ -*-===
/*===-- include/flang/Decimal/decimal.h ---------------------------*- C++ -*-===
*
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
* See https://llvm.org/LICENSE.txt for license information.
Expand Down
@@ -1,4 +1,4 @@
//===-- include/flang/evaluate/call.h ---------------------------*- C++ -*-===//
//===-- include/flang/Evaluate/call.h ---------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -13,10 +13,10 @@
#include "constant.h"
#include "formatting.h"
#include "type.h"
#include "flang/common/indirection.h"
#include "flang/common/reference.h"
#include "flang/parser/char-block.h"
#include "flang/semantics/attr.h"
#include "flang/Common/indirection.h"
#include "flang/Common/reference.h"
#include "flang/Parser/char-block.h"
#include "flang/Semantics/attr.h"
#include <optional>
#include <ostream>
#include <vector>
Expand Down

0 comments on commit 64ab330

Please sign in to comment.