forked from OSchip/llvm-project
IR: Avoid duplication of SwitchInst::findCaseValue(), NFC
Change the non-const version of findCaseValue() to forward to the const version.
This commit is contained in:
parent
de2fed6152
commit
8b3e1adf2b
|
@ -3515,12 +3515,9 @@ public:
|
|||
/// default case iterator to indicate that it is handled by the default
|
||||
/// handler.
|
||||
CaseIt findCaseValue(const ConstantInt *C) {
|
||||
CaseIt I = llvm::find_if(
|
||||
cases(), [C](CaseHandle &Case) { return Case.getCaseValue() == C; });
|
||||
if (I != case_end())
|
||||
return I;
|
||||
|
||||
return case_default();
|
||||
return CaseIt(
|
||||
this,
|
||||
const_cast<const SwitchInst *>(this)->findCaseValue(C)->getCaseIndex());
|
||||
}
|
||||
ConstCaseIt findCaseValue(const ConstantInt *C) const {
|
||||
ConstCaseIt I = llvm::find_if(cases(), [C](ConstCaseHandle &Case) {
|
||||
|
|
Loading…
Reference in New Issue