[llvm] 292b508 - [AMDGPU] Use StringRef::consume_front (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 22:12:21 PST 2024
Author: Kazu Hirata
Date: 2024-01-30T22:12:10-08:00
New Revision: 292b508ebaa653073d9ce12156c93f5a0cf67680
URL: https://github.com/llvm/llvm-project/commit/292b508ebaa653073d9ce12156c93f5a0cf67680
DIFF: https://github.com/llvm/llvm-project/commit/292b508ebaa653073d9ce12156c93f5a0cf67680.diff
LOG: [AMDGPU] Use StringRef::consume_front (NFC)
Added:
Modified:
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
index 33377a01ceb52..11dea36819935 100644
--- a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+++ b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
@@ -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");
More information about the llvm-commits
mailing list