[IR] Use StringRef::consume_front (NFC)
authorKazu Hirata <kazu@google.com>
Tue, 23 Jan 2024 05:19:13 +0000 (21:19 -0800)
committerKazu Hirata <kazu@google.com>
Tue, 23 Jan 2024 05:19:13 +0000 (21:19 -0800)
llvm/include/llvm/IR/GlobalValue.h

index e97a7f2b9636066bd7265a7c51f600f539e86089..aa8188cd99fee19652a2482d8f7baa1733f69fb7 100644 (file)
@@ -564,8 +564,7 @@ public:
   /// arbitrary GlobalValue, this is not the function you're looking for; see
   /// Mangler.h.
   static StringRef dropLLVMManglingEscape(StringRef Name) {
-    if (!Name.empty() && Name[0] == '\1')
-      return Name.substr(1);
+    Name.consume_front("\1");
     return Name;
   }