Structuring unstructured regions in a control flow graph
AssigneeThe MathWorks, Inc.
InventorsSrinath Avadhanula, Vijay Raghavan
Life of this patent
Estimating the term…
Abstract
A control flow graph may be generated from a model. The control flow graph may be restructured by converting at least one unstructured region of a control flow graph into a structured region. The restructuring may include locating at least one block between two merge nodes in the control flow graph, moving the located block to a different section of the control flow graph, and creating the structured region by surrounding the moved code block with a test of a guard variable.
Claims27
A computer-implemented method of generating a structured control flow graph from a model, said method comprising:
- generating, using a computing device, a control flow graph from the model;
- identifying at least one unstructured region by locating at least one code block between two merge nodes in the control flow graph;
- and
- creating a structured region of the control flow graph by removing the functionality of the at least one code block from between the two merge nodes using a guard variable, the guard variable preventing execution of the at least one code block when a condition is satisfied.
A computer-implemented system, said system comprising:
- a processor for executing:
- a modeling environment including a model;
- a first control flow graph created from the model, said control flow graph comprising at least one unstructured region including at least one code block between two merge nodes;
- and
- a control flow graph analyzer capable of converting the first control flow graph into a second control flow graph using a guard variable, the guard variable preventing execution of the at least one code block when a condition is satisfied.
A computer-readable medium storing instructions for generating a structured control flow graph from a model, said instructions comprising:
- instructions for generating a control flow graph from the model;
- instructions for identifying at least one unstructured region by locating at least one code block between two merge nodes in the control flow graph;
- and
- instructions for creating a structured region of the control flow graph by removing the functionality of the at least one code block from between the two merge nodes using a guard variable, the guard variable preventing execution of the at least one code block when a condition is satisfied.
A computer-implemented system for generating a structured control flow graph from a model, said system comprising:
- a processor for:
- generating a control flow graph from the model;
- identifying at least one unstructured region by locating at least one code block between two merge nodes in the control flow graph;
- and
- creating a structured region of the control flow graph by removing the functionality of the at least one code block from between the two merge nodes using a guard variable, the guard variable preventing execution of the at least one unstructured region when a condition is satisfied.
Dependencies are inferred from the claim text.