Lesson 8--Control Flow Graphs Flashcards

1
Q

Basic Blocks rules

A

Rule 1: The first statement in the program is the leader
Rule 2: Any statement that is the target of a branch statement is a leader
Rule 3: Any statement that immediately follows a branch or return statement is a leader.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Control Flow Graph (CFG)

A

A directed multigraph in which the nodes are basic blocks and the edges represent the flow of control

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

CFG Rule A

A

There is a directed edge from basic block B1 to B2 in the CFG if there is a branch from the last statement of B1 to the first statement of B2.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

CFG Rule B

A

Control flow can fall through from B1 to B2 if B2 immediately follows B1 and B1 does not end with an unconditional branch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly