diff options
| author | Matthias Braun <matze@braunis.de> | 2018-10-31 00:23:23 +0000 |
|---|---|---|
| committer | Matthias Braun <matze@braunis.de> | 2018-10-31 00:23:23 +0000 |
| commit | 9fd397b423ba442808957e65e3ad25a07cd203e4 (patch) | |
| tree | 7145d100b0a62cf322449093f203eb7c9e80c3b8 /llvm/lib/Transforms/Utils | |
| parent | ac0ba8c52493012daabb73512a5739394c37a2dc (diff) | |
| download | bcm5719-llvm-9fd397b423ba442808957e65e3ad25a07cd203e4.tar.gz bcm5719-llvm-9fd397b423ba442808957e65e3ad25a07cd203e4.zip | |
ADT/STLExtras: Introduce llvm::empty; NFC
This is modeled after C++17 std::empty().
Differential Revision: https://reviews.llvm.org/D53909
llvm-svn: 345679
Diffstat (limited to 'llvm/lib/Transforms/Utils')
| -rw-r--r-- | llvm/lib/Transforms/Utils/PredicateInfo.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/PredicateInfo.cpp b/llvm/lib/Transforms/Utils/PredicateInfo.cpp index 9d9624850fb..585ce6b4c11 100644 --- a/llvm/lib/Transforms/Utils/PredicateInfo.cpp +++ b/llvm/lib/Transforms/Utils/PredicateInfo.cpp @@ -522,7 +522,7 @@ Value *PredicateInfo::materializeStack(unsigned int &Counter, if (isa<PredicateWithEdge>(ValInfo)) { IRBuilder<> B(getBranchTerminator(ValInfo)); Function *IF = getCopyDeclaration(F.getParent(), Op->getType()); - if (IF->user_begin() == IF->user_end()) + if (empty(IF->users())) CreatedDeclarations.insert(IF); CallInst *PIC = B.CreateCall(IF, Op, Op->getName() + "." + Twine(Counter++)); @@ -534,7 +534,7 @@ Value *PredicateInfo::materializeStack(unsigned int &Counter, "Should not have gotten here without it being an assume"); IRBuilder<> B(PAssume->AssumeInst); Function *IF = getCopyDeclaration(F.getParent(), Op->getType()); - if (IF->user_begin() == IF->user_end()) + if (empty(IF->users())) CreatedDeclarations.insert(IF); CallInst *PIC = B.CreateCall(IF, Op); PredicateMap.insert({PIC, ValInfo}); diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index dd0d441a4da..849f9ee1d19 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -5260,7 +5260,7 @@ static bool SwitchToLookupTable(SwitchInst *SI, IRBuilder<> &Builder, // Figure out the corresponding result for each case value and phi node in the // common destination, as well as the min and max case values. - assert(SI->case_begin() != SI->case_end()); + assert(!empty(SI->cases())); SwitchInst::CaseIt CI = SI->case_begin(); ConstantInt *MinCaseVal = CI->getCaseValue(); ConstantInt *MaxCaseVal = CI->getCaseValue(); |

