C-Breeze
C Compiler Infrastructure

[ Project home page]
Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

c_breeze.h File Reference

#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
#include <assert.h>
#include <stdio.h>
#include "cbz_util.h"
#include "hash_set_ex.h"
#include "coord.h"
#include "operators.h"
#include "basic_type.h"
#include "constant.h"
#include "annote.h"
#include "ast.h"
#include "visitor.h"
#include "walker.h"
#include "changer.h"
#include "dataflow.h"
#include "symbol.h"
#include "phase.h"
#include "output_context.h"
#include "arch_info.h"
#include "instruction.h"

Go to the source code of this file.

Compounds

struct  _TQ
struct  _TYPE
class  CBZ

Defines

#define CBZFAIL(errfmt)   CBZ::Fail( __FILE__, __LINE__, cbz_util::string_format errfmt );

Typedefs

typedef list< Node * > node_list
typedef node_list::iterator node_list_p
typedef list< exprNode * > expr_list
typedef expr_list::iterator expr_list_p
typedef list< declNode * > decl_list
typedef decl_list::iterator decl_list_p
typedef list< targetNode * > target_list
typedef target_list::iterator target_list_p
typedef list< attribNode * > attrib_list
typedef attrib_list::iterator attrib_list_p
typedef list< indexNode * > index_list
typedef index_list::iterator index_list_p
typedef list< idNode * > id_list
typedef id_list::iterator id_list_p
typedef list< stmtNode * > stmt_list
typedef stmt_list::iterator stmt_list_p
typedef list< gotoNode * > goto_list
typedef goto_list::iterator goto_list_p
typedef list< defNode * > def_list
typedef def_list::iterator def_list_p
typedef list< Annote * > annote_list
typedef annote_list::iterator annote_list_p
typedef list< unitNode * > unit_list
typedef unit_list::iterator unit_list_p
typedef vector< string > str_vec
typedef str_vec::iterator str_vec_p
typedef list< string > str_list
typedef str_list::iterator str_list_p
typedef list< textNode * > text_list
typedef text_list::iterator text_list_p
typedef list< suespecNode * > suespec_list
typedef suespec_list::iterator suespec_list_p
typedef list< blockNode * > block_list
typedef block_list::iterator block_list_p
typedef list< basicblockNode * > basicblock_list
typedef basicblock_list::iterator basicblock_list_p
typedef list< operandNode * > operand_list
typedef operand_list::iterator operand_list_p
typedef list< LirInst * > instruction_list
typedef instruction_list::iterator instruction_list_p
typedef hash_set_ex< LirInst * > instruction_set
typedef instruction_set::iterator instruction_set_p
typedef list< LirBlock * > LirBlockList
typedef LirBlockList::iterator LirBlockList_p
typedef hash_set_ex< LirBlock * > LirBlockSet
typedef LirBlockSet::iterator LirBlockSet_p
typedef map< Node *, unsigned
int, less< Node * > > 
numbering_map

Enumerations

enum  NodeType {
  Const, Id, Binary, Unary,
  Cast, Comma, Ternary, Call,
  Initializer, Label, Switch, Case,
  If, While, Do, For,
  Goto, Continue, Break, Return,
  Block, Prim, Tdef, Ptr,
  Array, Func, Struct, Union,
  Enum, sueSpec, Decl, Attrib,
  Proc, Text, Expr, Undeclared,
  Unit, Meta, Operand, Condition,
  ThreeAddr
}
enum  ScopeState { Redecl, NoRedecl, SU, Formal }
enum  Assoc { Right, Left }


Define Documentation

#define CBZFAIL errfmt       CBZ::Fail( __FILE__, __LINE__, cbz_util::string_format errfmt );
 

Definition at line 404 of file c_breeze.h.

Referenced by procNode::alloc_stack_local(), dummy_reg_alloc::allocate_real_for_virtual(), lir_gen_walker::at_proc(), lir_gen_walker::at_threeAddr(), LIR::Call(), asm_gen_walker::emit(), lir_gen_walker::gen_assignment(), lir_gen_walker::gen_call_assignment(), lir_gen_walker::gen_load(), lir_gen_walker::gen_simple_assignment(), lir_gen_walker::gen_store(), Register::getRegRetVal(), lir_gen_walker::load_stack_var(), and Register::setType().


Typedef Documentation

typedef list< Annote * > annote_list
 

Definition at line 173 of file c_breeze.h.

Referenced by Node::annotations().

typedef annote_list::iterator annote_list_p
 

Definition at line 174 of file c_breeze.h.

typedef list< attribNode * > attrib_list
 

Definition at line 155 of file c_breeze.h.

Referenced by declNode::attribs(), and subdeclNode::subdeclNode().

typedef attrib_list::iterator attrib_list_p
 

Definition at line 156 of file c_breeze.h.

typedef list< basicblockNode * > basicblock_list
 

Definition at line 194 of file c_breeze.h.

Referenced by procedureInfo::add_reachable_blocks_rec(), constantFoldingChanger::at_conditiongoto(), cfg_changer::at_proc(), basicblockNode::children(), DominanceFrontiers::compute_dominance_frontiers(), DFPreds::compute_dominance_frontiers(), Dominators::depth_first_search(), DominanceFrontiers::depth_first_search(), DFPreds::depth_first_search(), procedureInfo::dfs_dominators(), Dominators::dominator_tree(), loopTree::findBody(), loopTree::loopTree(), orderedUses::make_merge_uses_at(), memoryBlock::merge_uses_at(), SSA::place_phi_functions(), basicblockNode::preds(), procedureInfo::procedureInfo(), Unreachable::remove_unreachable(), procedureInfo::reverse_post_order(), SSA::search(), basicblockNode::succs(), and SSA::which_pred().

typedef basicblock_list::iterator basicblock_list_p
 

Definition at line 195 of file c_breeze.h.

Referenced by procedureInfo::add_reachable_blocks_rec(), constantFoldingChanger::at_conditiongoto(), reachingDefinitionsWalker::at_proc(), LivenessWalker::at_proc(), cfg_changer::at_proc(), DominanceFrontiers::compute_dominance_frontiers(), DFPreds::compute_dominance_frontiers(), Dominators::depth_first_search(), DominanceFrontiers::depth_first_search(), DFPreds::depth_first_search(), loopTree::depthFirstSearch(), unreachableCodeRemover::dfs(), procedureInfo::dfs_dominators(), fixPointerWalker::dfs_used(), Dominators::dominator_tree(), loopTree::findBody(), unreachableCodeRemover::fixup_preds(), loopTree::loopTree(), orderedUses::make_merge_uses_at(), SSA::place_phi_functions(), Dominators::print(), procedureInfo::procedureInfo(), Unreachable::remove_unreachable(), SSA::search(), copyPropChanger::solve_global_dataflow(), SSA::SSA(), procedureInfo::update_conditional_worklist(), and SSA::which_pred().

typedef list< blockNode * > block_list
 

Definition at line 191 of file c_breeze.h.

typedef block_list::iterator block_list_p
 

Definition at line 192 of file c_breeze.h.

Referenced by StaticToGlobalDismantle::at_decl().

typedef list< declNode * > decl_list
 

Definition at line 149 of file c_breeze.h.

Referenced by funcNode::add_parameter_types(), Unify_ECR::all_decls(), funcNode::args(), UnificationBasedPtr::at_call(), UnificationBasedPtr::at_decl(), enum_value_walker::at_enum(), UnificationBasedPtr::at_initializer(), UnificationBasedPtr::at_proc(), reachingGenKillWalker::at_proc(), name_mangle_walker::at_proc(), id_lookup_walker::at_proc(), FlattenDismantle::at_proc(), UnificationBasedPtr::at_suespec(), semcheck_walker::at_suespec(), funcNode::check_conversions(), ProcWalker::decls(), blockNode::decls(), suespecNode::fields(), memoryModel::initialize_struct(), function_inline::inliner(), funcNode::is_compatible_with(), funcNode::is_void_args(), UnificationBasedPtr::make_compatible(), Pointers::pass_parameters(), procNode::procNode(), funcNode::qualified_equal_to(), NodeInfo::readProc(), Pointers::setup_va_list_variables(), Unify_Size::sizeOf(), Pointers::struct_union_assignment(), unitNode::undef_funcs(), Unify_Structure::Unify_Structure(), and NodeInfo::writeProc().

typedef decl_list::iterator decl_list_p
 

Definition at line 150 of file c_breeze.h.

Referenced by funcNode::add_parameter_types(), StaticToGlobalDismantle::at_decl(), enum_value_walker::at_enum(), UnificationBasedPtr::at_initializer(), UnificationBasedPtr::at_proc(), reachingGenKillWalker::at_proc(), name_mangle_walker::at_proc(), LivenessWalker::at_proc(), lir_gen_walker::at_proc(), id_lookup_walker::at_proc(), StaticToGlobalDismantle::at_proc(), FlattenDismantle::at_proc(), UnusedDeclarationCleanupChanger::at_proc(), AllocSizeChanger::at_struct(), UnificationBasedPtr::at_suespec(), semcheck_walker::at_suespec(), AllocSizeChanger::at_union(), gcWalker::at_unit(), funcNode::check_conversions(), lir_gen_walker::field_offset(), suespecNode::find_field(), InitializerDismantle::init_struct(), memoryModel::initialize_struct(), funcNode::is_compatible_with(), UnificationBasedPtr::make_compatible(), NodeInfo::match_args(), funcNode::output_type(), Pointers::pass_parameters(), UnificationBasedPtr::print_ecr(), procNode::procNode(), funcNode::qualified_equal_to(), Pointers::setup_va_list_variables(), Unify_Size::sizeOf(), Pointers::struct_union_assignment(), Unify_Structure::Unify_Structure(), and NodeInfo::writeProc().

typedef list< defNode * > def_list
 

Definition at line 170 of file c_breeze.h.

Referenced by dummy_reg_alloc_walker::at_unit(), asm_gen_walker::at_unit(), unitNode::defs(), goto_label_walker::fixup(), Linker::link(), and unitNode::output().

typedef def_list::iterator def_list_p
 

Definition at line 171 of file c_breeze.h.

Referenced by StaticToGlobalDismantle::at_proc(), lir_gen_walker::at_unit(), copyPropChanger::change(), constantFoldingChanger::change(), constantPropChanger::change(), findmain(), goto_label_walker::fixup(), NodeInfo::getType(), Linker::link(), unitNode::output(), NodeInfo::readProc(), NodeInfo::readsuef(), Unreachable::remove(), dfpreds_phase::run(), ssa_phase::run(), and pointers_phase::run().

typedef list< exprNode * > expr_list
 

Definition at line 146 of file c_breeze.h.

Referenced by callNode::args(), UnificationBasedPtr::at_initializer(), commaNode::base_type(), initializerNode::exprs(), commaNode::exprs(), lir_gen_walker::flatten_init(), lir_gen_walker::gen_global_decl(), memoryModel::generate_array_elements_for(), memoryModel::initialize_struct(), memoryModel::lookup_variable(), and udduChains::uses().

typedef expr_list::iterator expr_list_p
 

Definition at line 147 of file c_breeze.h.

Referenced by ExpressionDismantle::at_call(), InitializerDismantle::at_decl(), UnificationBasedPtr::at_initializer(), initializerNode::eval(), commaNode::eval(), callNode::eval(), lir_gen_walker::flatten_init(), lir_gen_walker::gen_global_decl(), memoryModel::generate_array_elements_for(), DefUseWalker::get_uses(), InitializerDismantle::init_array(), InitializerDismantle::init_struct(), memoryModel::initialize_struct(), LocalCopyPropChanger::prop_expr(), and SSA::search().

typedef list< gotoNode * > goto_list
 

Definition at line 167 of file c_breeze.h.

Referenced by print_walker::at_label(), print_tree_visitor::at_label(), ProcWalker::gotos(), and labelNode::references().

typedef goto_list::iterator goto_list_p
 

Definition at line 168 of file c_breeze.h.

Referenced by print_walker::at_label(), print_tree_visitor::at_label(), FlattenDismantle::at_label(), and FlattenDismantle::at_proc().

typedef list< idNode * > id_list
 

Definition at line 161 of file c_breeze.h.

Referenced by print_walker::at_decl(), deadCodeEliminationChanger::at_threeAddr(), UnificationBasedPtr::ecr(), operandNode::fields(), and declNode::ref_list().

typedef id_list::iterator id_list_p
 

Definition at line 162 of file c_breeze.h.

Referenced by print_walker::at_decl(), FlattenDismantle::at_decl(), UnificationBasedPtr::ecr(), Pointers::eval(), lir_gen_walker::field_offset(), operandNode::output_expr(), and StaticToGlobalDismantle::rename_decl().

typedef list< indexNode *> index_list
 

Definition at line 158 of file c_breeze.h.

typedef index_list::iterator index_list_p
 

Definition at line 159 of file c_breeze.h.

typedef list<LirInst*> instruction_list
 

Definition at line 210 of file c_breeze.h.

Referenced by dummy_reg_alloc::allocate(), asm_gen_walker::at_proc(), lir_flow_walker::build_lir_blocks(), briggs_reg_alloc::coalesceRegisters(), lir_flow_walker::computeRegisterLiveness(), briggs_reg_alloc::computeSpillCosts(), asm_gen_walker::computeStackFrameSize(), asm_gen_walker::doCalleeSave(), asm_gen_walker::doCallerSave(), briggs_reg_alloc::genSpillCode(), procNode::instructions(), unitNode::instructions(), briggs_reg_alloc::interfere(), briggs_reg_alloc::makeDuChains(), and briggs_reg_alloc::nonStore().

typedef instruction_list::iterator instruction_list_p
 

Definition at line 211 of file c_breeze.h.

Referenced by LirBlock::add_inst_after(), LirBlock::add_inst_before(), dummy_reg_alloc::allocate(), asm_gen_walker::at_proc(), briggs_reg_alloc::coalesceRegisters(), lir_flow_walker::computeRegisterLiveness(), briggs_reg_alloc::computeSpillCosts(), asm_gen_walker::computeStackFrameSize(), asm_gen_walker::doCalleeSave(), asm_gen_walker::doCallerSave(), lir_flow_walker::findInstruction(), briggs_reg_alloc::genSpillCode(), lir_flow_walker::getInstructionFlowInfo(), lir_flow_walker::getInstructionsPostorder(), briggs_reg_alloc::interfere(), briggs_reg_alloc::makeDuChains(), and LirBlock::remove_inst().

typedef hash_set_ex<LirInst*> instruction_set
 

Definition at line 214 of file c_breeze.h.

typedef instruction_set::iterator instruction_set_p
 

Definition at line 215 of file c_breeze.h.

Referenced by lir_flow_walker::computeRegisterLiveness(), and briggs_reg_alloc::makeDuChains().

typedef list<LirBlock*> LirBlockList
 

Definition at line 218 of file c_breeze.h.

Referenced by lir_flow_walker::build_lir_blocks(), lir_flow_walker::debug_print_block_info(), lir_flow_walker::find_block_doms(), lir_flow_walker::find_loops(), and procNode::lir_blocks().

typedef LirBlockList::iterator LirBlockList_p
 

Definition at line 219 of file c_breeze.h.

Referenced by lir_flow_walker::build_lir_blocks(), lir_flow_walker::debug_print_block_info(), lir_flow_walker::find_block_doms(), and lir_flow_walker::find_loops().

typedef hash_set_ex<LirBlock*> LirBlockSet
 

Definition at line 220 of file c_breeze.h.

typedef LirBlockSet::iterator LirBlockSet_p
 

Definition at line 221 of file c_breeze.h.

Referenced by lir_flow_walker::debug_print_block_info(), lir_flow_walker::find_block_doms(), lir_flow_walker::find_loops(), lir_flow_walker::get_block_dfo(), and LirBlock::reset_visited().

typedef list< Node * > node_list
 

Definition at line 143 of file c_breeze.h.

Referenced by vcgCCGWalker::print_edge().

typedef node_list::iterator node_list_p
 

Definition at line 144 of file c_breeze.h.

Referenced by gcWalker::gcWalker(), and vcgCCGWalker::print_node().

typedef map<Node *, unsigned int, less< Node * > > numbering_map
 

Definition at line 312 of file c_breeze.h.

Referenced by df_number_walker::df_number_walker(), df_number_walker::number(), print_walker::print(), print_tree_visitor::print(), and df_number_walker::result().

typedef list< operandNode * > operand_list
 

Definition at line 197 of file c_breeze.h.

Referenced by threeAddrNode::arg_list(), UnificationBasedPtr::at_call(), ExpressionDismantle::at_call(), lir_gen_walker::gen_call(), and function_inline::inliner().

typedef operand_list::iterator operand_list_p
 

Definition at line 198 of file c_breeze.h.

Referenced by UnificationBasedPtr::at_call(), findVarAssign::at_threeAddr(), LivenessWalker::at_threeAddr(), constantPropChanger::at_threeAddr(), Pointers::call_operator(), lir_gen_walker::gen_call(), copyPropChanger::local_copy_prop(), and reachingDefinitionsWalker::make_ud_chains().

typedef list< stmtNode * > stmt_list
 

Definition at line 164 of file c_breeze.h.

Referenced by Pointers::analyze_procedure(), TreeChecker::at_label(), reachingGenKillWalker::at_proc(), copyPropChanger::at_proc(), basicblockLocation::basicblockLocation(), loopTree::classifyEdges(), procLocation::procLocation(), Unreachable::remove_unreachable(), copyPropChanger::solve_global_dataflow(), SSA::SSA(), blockNode::stmts(), blockNode::toBlock(), and udduChains::useSites().

typedef stmt_list::iterator stmt_list_p
 

Definition at line 165 of file c_breeze.h.

Referenced by SSA::add_phi_function(), Pointers::analyze_procedure(), reachingDefinitionsWalker::at_basicblock(), reachingGenKillWalker::at_basicblock(), DefUseWalker::at_basicblock(), LabelDismantle::at_label(), reachingDefinitionsWalker::at_proc(), reachingGenKillWalker::at_proc(), LocalCopyPropChanger::at_proc(), LivenessWalker::at_proc(), FlattenDismantle::at_proc(), copyPropChanger::at_proc(), cfg_changer::at_proc(), unreachableCodeRemover::at_proc(), basicblockLocation::basicblockLocation(), loopTree::classifyEdges(), copyPropChanger::create_copy_set(), copyPropChanger::create_kill_set(), LocalCopyPropChanger::local_copy_prop(), copyPropChanger::local_copy_prop(), set_container_walker::nearest_loop(), set_container_walker::nearest_switch(), SSA::place_one_phi(), procedureInfo::procedure_size(), procedureInfo::procedureInfo(), procLocation::procLocation(), Unreachable::remove_unreachable(), SSA::search(), copyPropChanger::solve_global_dataflow(), and SSA::SSA().

typedef list< string > str_list
 

Definition at line 182 of file c_breeze.h.

Referenced by process_flags().

typedef str_list::iterator str_list_p
 

Definition at line 183 of file c_breeze.h.

Referenced by unitNode::_open_input_file(), Phases::phase_flag(), and process_flags().

typedef vector< string > str_vec
 

Definition at line 179 of file c_breeze.h.

typedef str_vec::iterator str_vec_p
 

Definition at line 180 of file c_breeze.h.

typedef list< suespecNode * > suespec_list
 

Definition at line 188 of file c_breeze.h.

Referenced by unitNode::suespecs().

typedef suespec_list::iterator suespec_list_p
 

Definition at line 189 of file c_breeze.h.

Referenced by gcWalker::at_unit(), blockNode::output_stmt(), and NodeInfo::readsuef().

typedef list< targetNode * > target_list
 

Definition at line 152 of file c_breeze.h.

Referenced by print_walker::at_switch(), print_tree_visitor::at_switch(), and switchNode::cases().

typedef target_list::iterator target_list_p
 

Definition at line 153 of file c_breeze.h.

Referenced by print_walker::at_switch(), print_tree_visitor::at_switch(), and SelectionDismantle::at_switch().

typedef list< textNode * > text_list
 

Definition at line 185 of file c_breeze.h.

Referenced by stmtNode::pragmas(), and defNode::pragmas().

typedef text_list::iterator text_list_p
 

Definition at line 186 of file c_breeze.h.

Referenced by gcWalker::collect(), and declNode::output().

typedef list< unitNode * > unit_list
 

Definition at line 176 of file c_breeze.h.

typedef unit_list::iterator unit_list_p
 

Definition at line 177 of file c_breeze.h.

Referenced by UnificationBasedPtr::analyze_all(), reachingDefinitionsWalker::analyze_all(), NodeLocator::at_stmt(), copyPropChanger::change(), constantFoldingChanger::change(), constantPropChanger::change(), TreeChecker::check(), gcWalker::collect(), findmain(), NodeInfo::getCoord(), function_inline::inline_functions(), Linker::link(), main(), name_mangle_walker::mangle(), NodeInfo::readCall(), NodeInfo::readProc(), NodeInfo::readsuef(), vcgCCGPhase::run(), vcgASTPhase::run(), P::run(), dfpreds_phase::run(), ssa_phase::run(), pointers_phase::run(), TreeCheckerPhase::run(), DeadPhase::run(), asmGenWalkerPhase::run(), regAllocPhase::run(), lirFlowWalkerPhase::run(), lirGenWalkerPhase::run(), CfgPhase::run(), DismantleChangerPhase::run(), DismantleControlChangerPhase::run(), output_c_phase::run(), print_ast_phase::run(), LiveTest::run(), and fi::run().


Enumeration Type Documentation

enum Assoc
 

Enumeration values:
Right 
Left 

Definition at line 288 of file c_breeze.h.

Referenced by ternaryNode::output_expr(), commaNode::output_expr(), castNode::output_expr(), callNode::output_expr(), and exprNode::parens().

enum NodeType
 

Enumeration values:
Const 
Id 
Binary 
Unary 
Cast 
Comma 
Ternary 
Call 
Initializer 
Label 
Switch 
Case 
If 
While 
Do 
For 
Goto 
Continue 
Break 
Return 
Block 
Prim 
Tdef 
Ptr 
Array 
Func 
Struct 
Union 
Enum 
sueSpec 
Decl 
Attrib 
Proc 
Text 
Expr 
Undeclared 
Unit 
Meta 
Operand 
Condition 
ThreeAddr 

Definition at line 228 of file c_breeze.h.

Referenced by constantPropChanger::at_expr(), UnificationBasedPtr::at_initializer(), scope_walker::at_suespec(), NodeInfo::getNode(), set_container_walker::nearest_loop(), blockNode::output_stmt(), suespecNode::owner(), NodeInfo::readsuef(), and Node::typ().

enum ScopeState
 

Enumeration values:
Redecl 
NoRedecl 
SU 
Formal 

Definition at line 277 of file c_breeze.h.


Generated on August 27, 2003
Back to the C-Breeze home page