Nearly CC
An educational compiler skeleton
Classes | Enumerations
cfg.h File Reference

ControlFlowGraph and associated types. More...

#include <cassert>
#include <vector>
#include <map>
#include <deque>
#include <string>
#include <memory>
#include "instruction.h"
#include "instruction_seq.h"
#include "operand.h"
Include dependency graph for cfg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Edge
 Control-flow graph edge data type. More...
 
class  ControlFlowGraph
 ControlFlowGraph: graph of basic blocks connected by control edges. More...
 

Enumerations

enum  EdgeKind { EDGE_FALLTHROUGH , EDGE_BRANCH }
 Control-flow graph edge kinds. More...
 

Detailed Description

ControlFlowGraph and associated types.

A control-flow graph is a graph of basic blocks. Each basic block is an InstructionSequence containing the instructions of that basic block.

Enumeration Type Documentation

◆ EdgeKind

enum EdgeKind

Control-flow graph edge kinds.

Edges can be

  • "fall through", meaning the target block's first instruction follows the source block's last instruction in the original InstructionSequence
  • "branch", meaning that the target block's first instruction is not the immediate successor of the source block's last instruction