Skip to content

Commit

Permalink
[AMDGPU] Use StringRef::consume_front (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata committed Jan 31, 2024
1 parent 2699c1d commit 292b508
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6396,14 +6396,11 @@ ParseStatus AMDGPUAsmParser::parseTH(OperandVector &Operands, int64_t &TH) {
else if (Value == "TH_STORE_LU" || Value == "TH_LOAD_RT_WB" ||
Value == "TH_LOAD_NT_WB") {
return Error(StringLoc, "invalid th value");
} else if (Value.starts_with("TH_ATOMIC_")) {
Value = Value.drop_front(10);
} else if (Value.consume_front("TH_ATOMIC_")) {
TH = AMDGPU::CPol::TH_TYPE_ATOMIC;
} else if (Value.starts_with("TH_LOAD_")) {
Value = Value.drop_front(8);
} else if (Value.consume_front("TH_LOAD_")) {
TH = AMDGPU::CPol::TH_TYPE_LOAD;
} else if (Value.starts_with("TH_STORE_")) {
Value = Value.drop_front(9);
} else if (Value.consume_front("TH_STORE_")) {
TH = AMDGPU::CPol::TH_TYPE_STORE;
} else {
return Error(StringLoc, "invalid th value");
Expand Down

0 comments on commit 292b508

Please sign in to comment.