Skip to content

Outliner::generateFunction

Returns a new outlined function containing a deep-copy of s.

Synopsis

Declared in <src/midend/programTransformation/astOutlining/Outliner.hh>

[[visibility("default")]]
SgFunctionDeclaration*
generateFunction(
    SgBasicBlock* s,
    std::string const& func_name_str,
    ASTtools::VarSymSet_t const& syms,
    ASTtools::VarSymSet_t const& pdSyms,
    std::set<SgInitializedName*> const& restoreVars,
    SgClassDeclaration* struct_decl,
    SgScopeStatement* scope,
    OutlinedLocalTypeTemplatePlan& local_type_template_plan,
    OutlinedFunctionParameterBindings& parameter_bindings,
    SgFunctionParameterList* leading_parameters = nullptr);

Description

This function only creates and returns an outlined function definition, f. Although it sets the scope of 'f' to be the first scope surrounding 's' that may contain a function (or member function) definition, it does not insert 'f' into that scope.

This function is an "inner" outlining routine which does not properly handle non-local control flow. To outline statements containing non-local flow, a caller should instead call Outliner::outline(), which preprocesses non-local control flow appropriately. See Outliner::transformNonLocalControlFlow() for more details.

pdSyms is used to store symbols which must be replaced with their corresponding pointer dereferencing if replaced during outlining. Used to support -rose:outline:temp_variable It is also used to support struct wrapper parameter to indicate if a variable is stored by its address (not value) in the wrapper.

// pSyms are OpenMP private variables, or dead variables (neither livein nor liveout)

Note: private, firstprivate, reduction variables are handled by OmpSupport::transOmpVariables() They are not in actual use anymore.

Consumes an optional detached leading parameter list before publication.

Parameters

Name Description
s This class represents the concept of a block (not a basic block from control flow analysis).
syms Stores a collection of SgVariableSymbols (var syms).
pdSyms Stores a collection of SgVariableSymbols (var syms).
struct_decl This class represents the concept of a class declaration statement. It includes the
scope This class represents the concept of a scope in C++ (e.g. global scope, fuction scope, etc.).
leading_parameters The ordered parameter declarations of a function.

Preconditions

  • The statement does not contain non-local control flow.

Created with MrDocs