mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 01:58:44 +08:00
[TableGen] Replace StringRef::slice with substr. NFC
This commit is contained in:
@@ -1001,7 +1001,7 @@ void MatchableInfo::tokenizeAsmString(const AsmMatcherInfo &Info,
|
||||
char Char = String[i];
|
||||
if (Variant.BreakCharacters.contains(Char)) {
|
||||
if (InTok) {
|
||||
addAsmOperand(String.slice(Prev, i), false);
|
||||
addAsmOperand(String.substr(Prev, i - Prev), false);
|
||||
Prev = i;
|
||||
IsIsolatedToken = false;
|
||||
}
|
||||
@@ -1010,7 +1010,7 @@ void MatchableInfo::tokenizeAsmString(const AsmMatcherInfo &Info,
|
||||
}
|
||||
if (Variant.TokenizingCharacters.contains(Char)) {
|
||||
if (InTok) {
|
||||
addAsmOperand(String.slice(Prev, i), IsIsolatedToken);
|
||||
addAsmOperand(String.substr(Prev, i - Prev), IsIsolatedToken);
|
||||
InTok = false;
|
||||
IsIsolatedToken = false;
|
||||
}
|
||||
@@ -1021,7 +1021,7 @@ void MatchableInfo::tokenizeAsmString(const AsmMatcherInfo &Info,
|
||||
}
|
||||
if (Variant.SeparatorCharacters.contains(Char)) {
|
||||
if (InTok) {
|
||||
addAsmOperand(String.slice(Prev, i), IsIsolatedToken);
|
||||
addAsmOperand(String.substr(Prev, i - Prev), IsIsolatedToken);
|
||||
InTok = false;
|
||||
}
|
||||
Prev = i + 1;
|
||||
@@ -1032,7 +1032,7 @@ void MatchableInfo::tokenizeAsmString(const AsmMatcherInfo &Info,
|
||||
switch (Char) {
|
||||
case '\\':
|
||||
if (InTok) {
|
||||
addAsmOperand(String.slice(Prev, i), false);
|
||||
addAsmOperand(String.substr(Prev, i - Prev), false);
|
||||
InTok = false;
|
||||
IsIsolatedToken = false;
|
||||
}
|
||||
@@ -1045,7 +1045,7 @@ void MatchableInfo::tokenizeAsmString(const AsmMatcherInfo &Info,
|
||||
|
||||
case '$': {
|
||||
if (InTok) {
|
||||
addAsmOperand(String.slice(Prev, i), IsIsolatedToken);
|
||||
addAsmOperand(String.substr(Prev, i - Prev), IsIsolatedToken);
|
||||
InTok = false;
|
||||
IsIsolatedToken = false;
|
||||
}
|
||||
@@ -1059,7 +1059,7 @@ void MatchableInfo::tokenizeAsmString(const AsmMatcherInfo &Info,
|
||||
size_t EndPos = String.find('}', i);
|
||||
assert(EndPos != StringRef::npos &&
|
||||
"Missing brace in operand reference!");
|
||||
addAsmOperand(String.slice(i, EndPos + 1), IsIsolatedToken);
|
||||
addAsmOperand(String.substr(i, EndPos + 1 - i), IsIsolatedToken);
|
||||
Prev = EndPos + 1;
|
||||
i = EndPos;
|
||||
IsIsolatedToken = false;
|
||||
|
||||
@@ -566,7 +566,8 @@ std::string CodeGenInstruction::FlattenAsmStringVariants(StringRef Cur,
|
||||
}
|
||||
|
||||
// Select the Nth variant (or empty).
|
||||
StringRef Selection = Cur.slice(VariantsStart, VariantsEnd);
|
||||
StringRef Selection =
|
||||
Cur.substr(VariantsStart, VariantsEnd - VariantsStart);
|
||||
for (unsigned i = 0; i != Variant; ++i)
|
||||
Selection = Selection.split('|').second;
|
||||
Res += Selection.split('|').first;
|
||||
|
||||
Reference in New Issue
Block a user