From 40c3e03e27c3c88b809ff1709fe3ebf571e93b4a Mon Sep 17 00:00:00 2001 From: Ramkumar Ramachandra Date: Tue, 13 Jan 2015 03:46:47 +0000 Subject: 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. llvm-svn: 225760 --- llvm/lib/Analysis/CFG.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Analysis/CFG.cpp') diff --git a/llvm/lib/Analysis/CFG.cpp b/llvm/lib/Analysis/CFG.cpp index 25e7bc0fc40..8ecd70b5d71 100644 --- a/llvm/lib/Analysis/CFG.cpp +++ b/llvm/lib/Analysis/CFG.cpp @@ -27,7 +27,7 @@ using namespace llvm; void llvm::FindFunctionBackedges(const Function &F, SmallVectorImpl > &Result) { const BasicBlock *BB = &F.getEntryBlock(); - if (succ_begin(BB) == succ_end(BB)) + if (succ_empty(BB)) return; SmallPtrSet Visited; -- cgit v1.2.3