Author: Kazu Hirata Date: 2024-02-04T14:57:26-08:00 New Revision: ffaedc2735cfcf2595fe65a75ed910a9c661391b
URL: https://github.com/llvm/llvm-project/commit/ffaedc2735cfcf2595fe65a75ed910a9c661391b DIFF: https://github.com/llvm/llvm-project/commit/ffaedc2735cfcf2595fe65a75ed910a9c661391b.diff LOG: [Basic] Simplify uses of StringRef::consume_front (NFC) Added: Modified: clang/lib/Basic/Targets/AMDGPU.h Removed: ################################################################################ diff --git a/clang/lib/Basic/Targets/AMDGPU.h b/clang/lib/Basic/Targets/AMDGPU.h index 90a1516ecdd20..e80589dde0ecb 100644 --- a/clang/lib/Basic/Targets/AMDGPU.h +++ b/clang/lib/Basic/Targets/AMDGPU.h @@ -168,9 +168,7 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo { return true; } - bool HasLeftParen = false; - if (S.consume_front("{")) - HasLeftParen = true; + bool HasLeftParen = S.consume_front("{"); if (S.empty()) return false; if (S.front() != 'v' && S.front() != 's' && S.front() != 'a') { @@ -196,9 +194,7 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo { Name = S.data() - 1; return true; } - bool HasLeftBracket = false; - if (S.consume_front("[")) - HasLeftBracket = true; + bool HasLeftBracket = S.consume_front("["); unsigned long long N; if (S.empty() || consumeUnsignedInteger(S, 10, N)) return false; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits