Standardize {pred,succ,use,user}_empty()

The functions {pred,succ,use,user}_{begin,end} exist, but many users
have to check *_begin() with *_end() by hand to determine if the
BasicBlock or User is empty. Fix this with a standard *_empty(),
demonstrating a few usecases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225760 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ramkumar Ramachandra
2015-01-13 03:46:47 +00:00
parent 3423a7b24f
commit 2bcc808cf9
8 changed files with 18 additions and 10 deletions

View File

@ -27,7 +27,7 @@ using namespace llvm;
void llvm::FindFunctionBackedges(const Function &F,
SmallVectorImpl<std::pair<const BasicBlock*,const BasicBlock*> > &Result) {
const BasicBlock *BB = &F.getEntryBlock();
if (succ_begin(BB) == succ_end(BB))
if (succ_empty(BB))
return;
SmallPtrSet<const BasicBlock*, 8> Visited;