diff options
| author | Kazu Hirata <kazu@google.com> | 2025-05-11 15:38:22 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-11 15:38:22 -0700 |
| commit | 64f53db79ce69768aab2caa828e1e0157f3d23b6 (patch) | |
| tree | 8d1b789e10dcd38ee98f86639545dc0e9846db67 /clang/lib/CodeGen/CodeGenModule.cpp | |
| parent | 18549aa1ccb6621ee856465d5e68982c3cc90f5f (diff) | |
[clang] Use StringRef::consume_front (NFC) (#139472)
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 3469676b74bc..428a4b833552 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -4061,11 +4061,7 @@ namespace { return false; std::string BuiltinNameStr = BI.getName(BuiltinID); StringRef BuiltinName = BuiltinNameStr; - if (BuiltinName.starts_with("__builtin_") && - Name == BuiltinName.slice(strlen("__builtin_"), StringRef::npos)) { - return true; - } - return false; + return BuiltinName.consume_front("__builtin_") && Name == BuiltinName; } bool VisitStmt(const Stmt *S) { |
