Lines Matching refs:CB
44 static inline const Stmt *getUnreachableStmt(const CFGBlock *CB);
45 static void FindUnreachableEntryPoints(const CFGBlock *CB,
48 static bool isInvalidPath(const CFGBlock *CB, const ParentMap &PM);
49 static inline bool isEmptyCFGBlock(const CFGBlock *CB);
80 const CFGBlock *CB = BE->getBlock();
81 reachable.insert(CB->getBlockID());
98 const CFGBlock *CB = *I;
100 if (reachable.count(CB->getBlockID()))
104 if (isEmptyCFGBlock(CB))
108 if (!visited.count(CB->getBlockID()))
109 FindUnreachableEntryPoints(CB, reachable, visited);
112 if (reachable.count(CB->getBlockID()))
116 if (CB->size() > 0 && isInvalidPath(CB, *PM))
123 if (const Stmt *label = CB->getLabel())
130 if (!CB->empty()) {
132 for (CFGBlock::const_iterator ci = CB->begin(), ce = CB->end();
150 if (const Stmt *S = getUnreachableStmt(CB)) {
171 void UnreachableCodeChecker::FindUnreachableEntryPoints(const CFGBlock *CB,
174 visited.insert(CB->getBlockID());
176 for (CFGBlock::const_pred_iterator I = CB->pred_begin(), E = CB->pred_end();
181 reachable.insert(CB->getBlockID());
190 const Stmt *UnreachableCodeChecker::getUnreachableStmt(const CFGBlock *CB) {
191 for (CFGBlock::const_iterator I = CB->begin(), E = CB->end(); I != E; ++I) {
195 if (const Stmt *S = CB->getTerminator())
206 bool UnreachableCodeChecker::isInvalidPath(const CFGBlock *CB,
211 if (CB->pred_size() > 1)
215 if (CB->pred_size() == 0)
218 const CFGBlock *pred = *CB->pred_begin();
239 bool UnreachableCodeChecker::isEmptyCFGBlock(const CFGBlock *CB) {
240 return CB->getLabel() == 0 // No labels
241 && CB->size() == 0 // No statements
242 && CB->getTerminator() == 0; // No terminator