Skip to content

TargetRegionVariableShape

Describes the shape, i.e. More...

#include <TargetRegionVariable.h>

Public Types

Name
enum ShapeKind

Public Functions

Name
ShapeKind getKind() const
bool isVariableArray() const
bool isConstantArray() const
bool isArray() const
bool isPointer() const
unsigned int getVariableDimensionIndex() const
If the shape is a variable array, return the array dimension index, (used for generating __sotoc_vla_dimX_ parameters in which the host signals the array's size).
llvm::StringRef getConstantDimensionExpr() const
If the shape is a constant array, it returns the rendered expression for the constant size.
TargetRegionVariableShape()
Construct a pointer shape by default.
TargetRegionVariableShape(const clang::ParenType * Paren)
Construct a parentheses shape.
TargetRegionVariableShape(const clang::VariableArrayType * Array, unsigned int DimIndex)
Construct a shape for a variable array dimension.
TargetRegionVariableShape(const clang::ConstantArrayType * Array)
Construct a shape for a constant array dimension.

Private Attributes

Name
unsigned int VariableDimensionIndex
std::string ConstantDimensionExpr
ShapeKind Kind

Detailed Description

1
class TargetRegionVariableShape;

Describes the shape, i.e.

a variable dimension of constant or variable size, or a pointer. We collect this information for every parameter of a target region function because the pretty printer does not support the output format for variable and types (e.g. it prints 'int ()[SIZE] a' instead of 'int () a[SIZE]'), so we print this manually in TargetCode.cpp. For this we need every pointer indirection and array dimension which each is saved as shapes for that variable.

Public Types Documentation

enum ShapeKind

Enumerator Value Description
Pointer
Paren
ConstantArray
VariableArray

Public Functions Documentation

function getKind

1
inline ShapeKind getKind() const

function isVariableArray

1
inline bool isVariableArray() const

function isConstantArray

1
inline bool isConstantArray() const

function isArray

1
inline bool isArray() const

function isPointer

1
inline bool isPointer() const

function getVariableDimensionIndex

1
inline unsigned int getVariableDimensionIndex() const

If the shape is a variable array, return the array dimension index, (used for generating __sotoc_vla_dimX_ parameters in which the host signals the array's size).

function getConstantDimensionExpr

1
inline llvm::StringRef getConstantDimensionExpr() const

If the shape is a constant array, it returns the rendered expression for the constant size.

function TargetRegionVariableShape

1
inline TargetRegionVariableShape()

Construct a pointer shape by default.

function TargetRegionVariableShape

1
2
3
inline TargetRegionVariableShape(
    const clang::ParenType * Paren
)

Construct a parentheses shape.

function TargetRegionVariableShape

1
2
3
4
inline TargetRegionVariableShape(
    const clang::VariableArrayType * Array,
    unsigned int DimIndex
)

Construct a shape for a variable array dimension.

function TargetRegionVariableShape

1
2
3
inline TargetRegionVariableShape(
    const clang::ConstantArrayType * Array
)

Construct a shape for a constant array dimension.

Private Attributes Documentation

variable VariableDimensionIndex

1
unsigned int VariableDimensionIndex;

variable ConstantDimensionExpr

1
std::string ConstantDimensionExpr;

variable Kind

1
ShapeKind Kind;

Last update: 2021-11-24
Back to top