FLANG
Public Types | Public Member Functions | Friends | List of all members
Fortran::lower::SymbolBox Struct Reference

#include <flang/Lower/SymbolMap.h>

Inheritance diagram for Fortran::lower::SymbolBox:
fir::details::matcher< SymbolBox >

Public Types

using None = std::monostate
 
using Intrinsic = fir::AbstractBox
 
using FullDim = fir::ArrayBoxValue
 
using Char = fir::CharBoxValue
 
using CharFullDim = fir::CharArrayBoxValue
 
using PointerOrAllocatable = fir::MutableBoxValue
 
using Box = fir::BoxValue
 
using VT = std::variant< Intrinsic, FullDim, Char, CharFullDim, PointerOrAllocatable, Box, fir::FortranVariableOpInterface, None >
 

Public Member Functions

template<typename A >
 SymbolBox (const A &x)
 
 operator bool () const
 
mlir::Value getAddr () const
 
std::optional< fir::FortranVariableOpInterface > getIfFortranVariableOpInterface ()
 
template<typename ON , typename RT >
constexpr RT apply (RT(&&func)(const ON &)) const
 Apply the lambda func to this box value.
 
const VT & matchee () const
 
LLVM_DUMP_METHOD void dump () const
 Dump the map. For debugging.
 
- Public Member Functions inherited from fir::details::matcher< SymbolBox >
auto match (Ts... ts)
 
auto match (Ts... ts) const
 

Friends

llvm::raw_ostream & operator<< (llvm::raw_ostream &os, const SymbolBox &symBox)
 

Detailed Description

A dictionary entry of ssa-values that together compose a variable referenced by a Symbol. For example, the declaration

CHARACTER(LEN=i) :: c(j1,j2)

is a single variable c. This variable is a two-dimensional array of CHARACTER. It has a starting address and three dynamic properties: the LEN parameter i a runtime value describing the length of the CHARACTER, and the j1 and j2 runtime values, which describe the shape of the array.

The lowering bridge needs to be able to record all four of these ssa-values in the lookup table to be able to correctly lower Fortran to FIR.

Member Function Documentation

◆ getAddr()

mlir::Value Fortran::lower::SymbolBox::getAddr ( ) const
inline

Get address of the boxed value. For a scalar, this is the address of the scalar. For an array, this is the address of the first element in the array, etc.


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