From 64f53db79ce69768aab2caa828e1e0157f3d23b6 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 11 May 2025 15:38:22 -0700 Subject: [clang] Use StringRef::consume_front (NFC) (#139472) --- clang/lib/CodeGen/CodeGenModule.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 3469676..428a4b8 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) { -- cgit v1.1