Skip to content
Snippets Groups Projects
Commit 7eb4e7f5 authored by jdh8d's avatar jdh8d
Browse files

fixed assert with unreachable code in function

Former-commit-id: 31070873c97a637e3ba94ce7af3ad5013fd4a9a8
parent c43a59b4
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,8 @@ class DominatorGraph_t
const BasicBlockSet_t& GetDominators(const BasicBlock_t* node) const { return dom_graph.at(node); }
const BasicBlockSet_t& GetPostDominators(const BasicBlock_t* node) const { return post_dom_graph.at(node); }
bool HasWarnings() const { return warn; }
// get the immeidate (post) dominators for a node
const BasicBlock_t* GetImmediateDominator(const BasicBlock_t* node) const
......@@ -41,6 +43,8 @@ class DominatorGraph_t
const ControlFlowGraph_t& cfg; // a reference to our cfg.
bool warn;
friend std::ostream& operator<<(std::ostream& os, const DominatorGraph_t& cfg);
};
......
......@@ -11,7 +11,7 @@ using namespace libIRDB;
// constructor
DominatorGraph_t::DominatorGraph_t(const ControlFlowGraph_t* p_cfg, bool needs_postdoms, bool needs_idoms)
: cfg(*p_cfg)
: cfg(*p_cfg), warn(false)
{
......@@ -273,7 +273,8 @@ BlockToBlockMap_t DominatorGraph_t::Idom_Comp(const BasicBlockSet_t& N, const Do
{
//IDom(n) = <only element in>Tmp(n)
IDom[n]= *(Tmp[n].begin());
assert(Tmp[n].size()<=1); // should only be one idominator.
if(Tmp[n].size()!=1) // should only be one idominator.
warn=true;
});
return IDom;
} // IDom_Comp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment