From 90bc71dd906935def78048e13e7c9f214af0486c Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 29 Dec 2014 03:11:50 +0100 Subject: dict/pool changes in ast --- frontends/ast/simplify.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'frontends/ast/simplify.cc') diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index b76701943..2ce2d57dc 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -67,12 +67,12 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, if (!flag_nomem2reg && !get_bool_attribute("\\nomem2reg")) { - std::map> mem2reg_places; - std::map mem2reg_candidates, dummy_proc_flags; + dict> mem2reg_places; + dict mem2reg_candidates, dummy_proc_flags; uint32_t flags = flag_mem2reg ? AstNode::MEM2REG_FL_ALL : 0; mem2reg_as_needed_pass1(mem2reg_places, mem2reg_candidates, dummy_proc_flags, flags); - std::set mem2reg_set; + pool mem2reg_set; for (auto &it : mem2reg_candidates) { AstNode *mem = it.first; @@ -2184,8 +2184,8 @@ void AstNode::replace_ids(const std::string &prefix, const std::map> &mem2reg_places, - std::map &mem2reg_candidates, AstNode *that) +static void mark_memories_assign_lhs_complex(dict> &mem2reg_places, + dict &mem2reg_candidates, AstNode *that) { for (auto &child : that->children) mark_memories_assign_lhs_complex(mem2reg_places, mem2reg_candidates, child); @@ -2199,8 +2199,8 @@ static void mark_memories_assign_lhs_complex(std::map> &mem2reg_places, - std::map &mem2reg_candidates, std::map &proc_flags, uint32_t &flags) +void AstNode::mem2reg_as_needed_pass1(dict> &mem2reg_places, + dict &mem2reg_candidates, dict &proc_flags, uint32_t &flags) { uint32_t children_flags = 0; int ignore_children_counter = 0; @@ -2262,7 +2262,7 @@ void AstNode::mem2reg_as_needed_pass1(std::map> if (type == AST_MODULE && get_bool_attribute("\\mem2reg")) children_flags |= AstNode::MEM2REG_FL_ALL; - std::map *proc_flags_p = NULL; + dict *proc_flags_p = NULL; if (type == AST_ALWAYS) { int count_edge_events = 0; @@ -2271,12 +2271,12 @@ void AstNode::mem2reg_as_needed_pass1(std::map> count_edge_events++; if (count_edge_events != 1) children_flags |= AstNode::MEM2REG_FL_ASYNC; - proc_flags_p = new std::map; + proc_flags_p = new dict; } if (type == AST_INITIAL) { children_flags |= AstNode::MEM2REG_FL_INIT; - proc_flags_p = new std::map; + proc_flags_p = new dict; } uint32_t backup_flags = flags; @@ -2300,7 +2300,7 @@ void AstNode::mem2reg_as_needed_pass1(std::map> } } -bool AstNode::mem2reg_check(std::set &mem2reg_set) +bool AstNode::mem2reg_check(pool &mem2reg_set) { if (type != AST_IDENTIFIER || !id2ast || !mem2reg_set.count(id2ast)) return false; @@ -2312,7 +2312,7 @@ bool AstNode::mem2reg_check(std::set &mem2reg_set) } // actually replace memories with registers -void AstNode::mem2reg_as_needed_pass2(std::set &mem2reg_set, AstNode *mod, AstNode *block) +void AstNode::mem2reg_as_needed_pass2(pool &mem2reg_set, AstNode *mod, AstNode *block) { if (type == AST_BLOCK) block = this; -- cgit v1.2.3