Outliner::Preprocess::transformNonLocalControlFlow
Preprocess non‐local control flow for outlining.
Synopsis
Declared in <src/midend/programTransformation/astOutlining/Preprocess.hh>
SgBasicBlock*
transformNonLocalControlFlow(SgBasicBlock* b_orig);
Description
Let 'B' be an input code block (i.e., an SgBasicBlock node). We define a non‐local jump to be any break, continue, return, or goto statement that cedes control to some point outside 'B'.
Given 'B', of the form,
// Start of input block, 'B' { ... // bunch of code JUMP_1; // First non‐local "jump" statement ... JUMP_2; // Second non‐local "jump" ... JUMP_k; // k‐th non‐local "jump" ... }
where each JUMP_i is a non‐local jump statement, this routine transforms 'B' into
// Start of the transformed 'B' { int EXIT_TAKEN__ = 0; // A new block, 'G', transformed to use a local 'goto'. { ... { EXIT_TAKEN__ = 1; goto NON_LOCAL_EXIT__; } ... { EXIT_TAKEN__ = 2; goto NON_LOCAL_EXIT__; } ... { EXIT_TAKEN__ = k; goto NON_LOCAL_EXIT__; } ... NON_LOCAL_EXIT__: ; } if (EXIT_TAKEN__ == 1) JUMP_1; else if (EXIT_TAKEN__ == 2) JUMP_2; ... else if (EXIT_TAKEN__ == k) JUMP_k; }
and returns 'T'.
Return Value
This class represents the concept of a block (not a basic block from control flow analysis).
Parameters
Name |
Description |
b_orig |
This class represents the concept of a block (not a basic block from control flow analysis). |
Created with MrDocs