diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/PredicateInfo.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Utils/PredicateInfo.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Utils/PredicateInfo.cpp b/llvm/lib/Transforms/Utils/PredicateInfo.cpp index 53334bc2a369..1f16ba78bdb0 100644 --- a/llvm/lib/Transforms/Utils/PredicateInfo.cpp +++ b/llvm/lib/Transforms/Utils/PredicateInfo.cpp @@ -509,7 +509,7 @@ void PredicateInfoBuilder::buildPredicateInfo() { // Collect operands to rename from all conditional branch terminators, as well // as assume statements. SmallVector<Value *, 8> OpsToRename; - for (auto DTN : depth_first(DT.getRootNode())) { + for (auto *DTN : depth_first(DT.getRootNode())) { BasicBlock *BranchBB = DTN->getBlock(); if (auto *BI = dyn_cast<BranchInst>(BranchBB->getTerminator())) { if (!BI->isConditional()) @@ -626,7 +626,7 @@ void PredicateInfoBuilder::renameUses(SmallVectorImpl<Value *> &OpsToRename) { // Insert the possible copies into the def/use list. // They will become real copies if we find a real use for them, and never // created otherwise. - for (auto &PossibleCopy : ValueInfo.Infos) { + for (const auto &PossibleCopy : ValueInfo.Infos) { ValueDFS VD; // Determine where we are going to place the copy by the copy type. // The predicate info for branches always come first, they will get @@ -772,7 +772,7 @@ PredicateInfo::~PredicateInfo() { // Collect function pointers in set first, as SmallSet uses a SmallVector // internally and we have to remove the asserting value handles first. SmallPtrSet<Function *, 20> FunctionPtrs; - for (auto &F : CreatedDeclarations) + for (const auto &F : CreatedDeclarations) FunctionPtrs.insert(&*F); CreatedDeclarations.clear(); @@ -783,7 +783,7 @@ PredicateInfo::~PredicateInfo() { } } -Optional<PredicateConstraint> PredicateBase::getConstraint() const { +std::optional<PredicateConstraint> PredicateBase::getConstraint() const { switch (Type) { case PT_Assume: case PT_Branch: { @@ -800,7 +800,7 @@ Optional<PredicateConstraint> PredicateBase::getConstraint() const { CmpInst *Cmp = dyn_cast<CmpInst>(Condition); if (!Cmp) { // TODO: Make this an assertion once RenamedOp is fully accurate. - return None; + return std::nullopt; } CmpInst::Predicate Pred; @@ -813,7 +813,7 @@ Optional<PredicateConstraint> PredicateBase::getConstraint() const { OtherOp = Cmp->getOperand(0); } else { // TODO: Make this an assertion once RenamedOp is fully accurate. - return None; + return std::nullopt; } // Invert predicate along false edge. @@ -825,7 +825,7 @@ Optional<PredicateConstraint> PredicateBase::getConstraint() const { case PT_Switch: if (Condition != RenamedOp) { // TODO: Make this an assertion once RenamedOp is fully accurate. - return None; + return std::nullopt; } return {{CmpInst::ICMP_EQ, cast<PredicateSwitch>(this)->CaseValue}}; |
