Skip to content

SageInterface::wrapFunction

wrapFunction overloads

Synopses

Declared in <SageIII/sageInterface/sageInterface.h>

moves the body of a function f to a new function f`; f's body is replaced with code that forwards the call to f`.

std::pair<SgStatement*, SgInitializedName*>
wrapFunction(
    SgFunctionDeclaration& definingDeclaration,
    SgName newName);

see wrapFunction for details

template<class NameGen>
std::pair<SgStatement*, SgInitializedName*>
wrapFunction(
    SgFunctionDeclaration& definingDeclaration,
    NameGen nameGen);

Return Value

a pair indicating the statement containing the call of f` and an initialized name refering to the temporary variable holding the result of f`. In case f returns void the initialized name is NULL.

Template Parameters

Name

Description

NameGen

functor that generates a new name based on the old name. interface: SgName nameGen(const SgName&)

Parameters

Name

Description

definingDeclaration

the defining function declaration of f

newName

the name of function f`

nameGen

name generator

Preconditions

  • definingDeclaration must be a defining declaration of a free standing function. typeid(SgFunctionDeclaration) == typeid(definingDeclaration) i.e., this function is NOT implemented for class member functions, template functions, procedures, etc.

Created with MrDocs