Skip to content

Commit a760af5

Browse files
author
git apple-llvm automerger
committed
Merge commit '298ace7dff4f' from llvm.org/main into next
2 parents 44c4b01 + 298ace7 commit a760af5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

llvm/lib/TableGen/Record.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,14 +1796,13 @@ const Init *TernOpInit::Fold(const Record *CurRec) const {
17961796
if (LHSs && MHSs && RHSs) {
17971797
std::string Val = RHSs->getValue().str();
17981798

1799-
StringRef::size_type found;
1800-
StringRef::size_type idx = 0;
1799+
std::string::size_type Idx = 0;
18011800
while (true) {
1802-
found = StringRef(Val).find(LHSs->getValue(), idx);
1803-
if (found == StringRef::npos)
1801+
std::string::size_type Found = Val.find(LHSs->getValue(), Idx);
1802+
if (Found == std::string::npos)
18041803
break;
1805-
Val.replace(found, LHSs->getValue().size(), MHSs->getValue().str());
1806-
idx = found + MHSs->getValue().size();
1804+
Val.replace(Found, LHSs->getValue().size(), MHSs->getValue().str());
1805+
Idx = Found + MHSs->getValue().size();
18071806
}
18081807

18091808
return StringInit::get(RK, Val);

0 commit comments

Comments
 (0)