Skip to content

SageInterface::get_C_array_dimensions

returns the array dimensions in an array as defined for arrtype

Synopses

Declared in <SageIII/sageInterface/sageInterface.h>

returns the array dimensions in an array as defined for arrtype

std::vector<SgExpression*>
get_C_array_dimensions(SgArrayType const& arrtype);
std::vector<SgExpression*>
get_C_array_dimensions(
    SgArrayType const& arrtype,
    SgInitializedName& initname);

returns the array dimensions in an array as defined for arrtype

std::vector<SgExpression*>
get_C_array_dimensions(
    SgArrayType const& arrtype,
    SgVarRefExp const& varref);

Return Value

  • an array that contains an expression indicating each dimension's size. OWNERSHIP of the expressions is TRANSFERED TO the CALLER (which becomes responsible for freeing the expressions). Note, the first entry of the array is a SgNullExpression, iff the first array dimension was not specified.

  • an array that contains an expression indicating each dimension's size. OWNERSHIP of the expressions is TRANSFERED TO the CALLER (which becomes responsible for freeing the expressions). If the first array dimension was not specified an expression that indicates that size is generated.

Parameters

Name

Description

arrtype

the type of a C/C++ array

varref

a reference to an array variable (the variable of type arrtype)

Preconditions

  • arrtype is the array‐type of varref

Postconditions

  • return‐value.empty() == false

  • return‐value[]!= NULL (no nullptr in the returned vector)

  • !isSgNullExpression(return‐value[])

Created with MrDocs