FLANG

Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
fir::NameUniquer Struct Reference

`#include <flang/Optimizer/Support/InternalNames.h>`

## Classes
struct | DeconstructedName
| Components of an unparsed unique name. More...

## Public Types
enum | IntrinsicType { CHARACTER, COMPLEX, INTEGER, LOGICAL, REAL }
enum | NameKind { NOT_UNIQUED, COMMON, CONSTANT, DERIVED_TYPE, DISPATCH_TABLE, GENERATED, INTRINSIC_TYPE_DESC, PROCEDURE, TYPE_DESC, VARIABLE }
| The sort of the unique name.

## Public Member Functions
std::string | doCommonBlock (llvm::StringRef name)
| Unique a common block name.
std::string | doConstant (llvm::ArrayRef< llvm::StringRef > modules, llvm::Optional< llvm::StringRef > host, llvm::StringRef name)
| Unique a (global) constant name.
std::string | doDispatchTable (llvm::ArrayRef< llvm::StringRef > modules, llvm::Optional< llvm::StringRef > host, llvm::StringRef name, llvm::ArrayRef< std::int64_t > kinds)
| Unique a dispatch table name.
std::string | doGenerated (llvm::StringRef name)
| Unique a compiler generated name.
std::string | doIntrinsicTypeDescriptor (llvm::ArrayRef< llvm::StringRef > modules, llvm::Optional< llvm::StringRef > host, IntrinsicType type, std::int64_t kind)
| Unique an intrinsic type descriptor.
std::string | doProcedure (llvm::ArrayRef< llvm::StringRef > modules, llvm::Optional< llvm::StringRef > host, llvm::StringRef name)
| Unique a procedure name.
std::string | doType (llvm::ArrayRef< llvm::StringRef > modules, llvm::Optional< llvm::StringRef > host, llvm::StringRef name, llvm::ArrayRef< std::int64_t > kinds)
| Unique a derived type name.
std::string | doTypeDescriptor (llvm::ArrayRef< llvm::StringRef > modules, llvm::Optional< llvm::StringRef > host, llvm::StringRef name, llvm::ArrayRef< std::int64_t > kinds)
| Unique a (derived) type descriptor name.
std::string | doTypeDescriptor (llvm::ArrayRef< std::string > modules, llvm::Optional< std::string > host, llvm::StringRef name, llvm::ArrayRef< std::int64_t > kinds)
std::string | doVariable (llvm::ArrayRef< llvm::StringRef > modules, llvm::Optional< llvm::StringRef > host, llvm::StringRef name)

## Static Public Member Functions
static llvm::StringRef | doProgramEntry ()
static std::pair< NameKind, DeconstructedName > | deconstruct (llvm::StringRef uniquedName)
| Decompose `uniquedName` into the parse name, symbol type, and scope info.

## Detailed Description

Internal name mangling of identifiers

In order to generate symbolically referencable artifacts in a ModuleOp, it is required that those symbols be uniqued. This is a simple interface for converting Fortran symbols into unique names.

This is intentionally bijective. Given a symbol's parse name, type, and scope-like information, we can generate a uniqued (mangled) name. Given a uniqued name, we can return the symbol parse name, type of the symbol, and any scope-like information for that symbol.

## Member Function Documentation

## ◆ doProgramEntry()

llvm::StringRef fir::NameUniquer::doProgramEntry | ( |  | ) |
| static

Entry point for the PROGRAM (called by the runtime) Can be overridden with the `--main-entry-name=<name>` option.

## ◆ doVariable()

std::string fir::NameUniquer::doVariable | ( | llvm::ArrayRef< llvm::StringRef > | modules,
|  | llvm::Optional< llvm::StringRef > | host,
|  | llvm::StringRef | name
| ) |  |

Unique a (global) variable name. A variable with save attribute defined inside a subprogram also needs to be handled here

The documentation for this struct was generated from the following files:

- include/flang/Optimizer/Support/InternalNames.h
- lib/Optimizer/Support/InternalNames.cpp