Skip to content

SageBuilder::buildVariableDeclaration

Build a fresh, structurally detached variable declaration in an exact semantic scope. A same-scope declaration with the same name is a hard error; use buildVariableRedeclaration() when the prior declaration is known. An explicit C/C++ written type must be distinct and semantically equivalent; it is attached before the declaration's variable symbol is published.

Synopses

Declared in <SageIII/sageInterface/sageBuilder.h>

Build a fresh, structurally detached variable declaration in an exact semantic scope. A same-scope declaration with the same name is a hard error; use buildVariableRedeclaration() when the prior declaration is known. An explicit C/C++ written type must be distinct and semantically equivalent; it is attached before the declaration's variable symbol is published.

[[visibility("default")]]
SgVariableDeclaration*
buildVariableDeclaration(
    SgName const& name,
    SgType* type,
    SgInitializer* varInit,
    SgScopeStatement* scope,
    SgType* cxxSourceType = nullptr);

» more...

[[visibility("default")]]
SgVariableDeclaration*
buildVariableDeclaration(
    std::string const& name,
    SgType* type,
    SgInitializer* varInit,
    SgScopeStatement* scope,
    SgType* cxxSourceType = nullptr);

» more...

[[visibility("default")]]
SgVariableDeclaration*
buildVariableDeclaration(
    char const* name,
    SgType* type,
    SgInitializer* varInit,
    SgScopeStatement* scope,
    SgType* cxxSourceType = nullptr);

» more...


Created with MrDocs