Skip to content

Conversation

@vitalybuka
Copy link
Collaborator

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Oct 21, 2025

@llvm/pr-subscribers-llvm-support

Author: Vitaly Buka (vitalybuka)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/164514.diff

1 Files Affected:

  • (modified) llvm/include/llvm/Support/GlobPattern.h (+5)
diff --git a/llvm/include/llvm/Support/GlobPattern.h b/llvm/include/llvm/Support/GlobPattern.h
index 09be8343a6ef2..230898edf1881 100644
--- a/llvm/include/llvm/Support/GlobPattern.h
+++ b/llvm/include/llvm/Support/GlobPattern.h
@@ -72,7 +72,12 @@ class GlobPattern {
     return SubGlobs[0].getPat() == "*";
   }
 
+  // The followind functions are just shortcuts for faster matching. They are
+  // conservative to simplify implementations.
+
+  // Returns plain prefix of the pattern.
   StringRef prefix() const { return Pattern.take_front(PrefixSize); }
+  // Returns plain suffix of the pattern.
   StringRef suffix() const { return Pattern.take_back(SuffixSize); }
 
 private:

Created using spr 1.3.6
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds documentation strings to the prefix() and suffix() methods in the GlobPattern class to clarify their purpose as optimization shortcuts for pattern matching.

Key Changes

  • Added a general comment explaining that the following functions are shortcuts for faster matching with conservative implementations
  • Added individual doc comments for the prefix() and suffix() methods

@vitalybuka vitalybuka changed the title [NFC][GlobPattern] Add doc strings to preffix/suffux methods. [NFC][GlobPattern] Add doc strings to prefix/suffux methods. Oct 21, 2025
@vitalybuka vitalybuka requested a review from qinkunbao October 21, 2025 23:54
@vitalybuka vitalybuka changed the title [NFC][GlobPattern] Add doc strings to prefix/suffux methods. [NFC][GlobPattern] Add doc strings to prefix/suffux methods Oct 22, 2025
Created using spr 1.3.7

[skip ci]
Created using spr 1.3.7
@fmayer fmayer changed the title [NFC][GlobPattern] Add doc strings to prefix/suffux methods [NFC][GlobPattern] Add doc strings to prefix/suffix methods Oct 22, 2025
Created using spr 1.3.7

[skip ci]
Created using spr 1.3.7
@vitalybuka vitalybuka changed the base branch from users/vitalybuka/spr/main.nfcglobpattern-add-doc-strings-to-preffixsuffux-methods to main October 23, 2025 00:40
@vitalybuka vitalybuka enabled auto-merge (squash) October 23, 2025 00:40
@vitalybuka vitalybuka merged commit 6df1276 into main Oct 23, 2025
15 of 17 checks passed
@vitalybuka vitalybuka deleted the users/vitalybuka/spr/nfcglobpattern-add-doc-strings-to-preffixsuffux-methods branch October 23, 2025 02:03
@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 23, 2025

LLVM Buildbot has detected a new failure on builder lldb-arm-ubuntu running on linaro-lldb-arm-ubuntu while building llvm at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/22173

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)
...
PASS: lldb-unit :: Core/./LLDBCoreTests/94/470 (2466 of 3737)
PASS: lldb-unit :: Core/./LLDBCoreTests/96/470 (2467 of 3737)
PASS: lldb-unit :: Core/./LLDBCoreTests/95/470 (2468 of 3737)
PASS: lldb-unit :: Core/./LLDBCoreTests/97/470 (2469 of 3737)
PASS: lldb-unit :: Core/./LLDBCoreTests/98/470 (2470 of 3737)
PASS: lldb-unit :: Core/./LLDBCoreTests/99/470 (2471 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/0/77 (2472 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/1/77 (2473 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/12/77 (2474 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/13/77 (2475 of 3737)
FAIL: lldb-unit :: DAP/./DAPTests/10/77 (2476 of 3737)
******************** TEST 'lldb-unit :: DAP/./DAPTests/10/77' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/unittests/DAP/./DAPTests-lldb-unit-1339446-10-77.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=77 GTEST_SHARD_INDEX=10 /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/unittests/DAP/./DAPTests
--

Script:
--
/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/unittests/DAP/./DAPTests --gtest_filter=DisconnectRequestHandlerTest.DisconnectTriggersTerminateCommands
--
../llvm-project/lldb/unittests/DAP/Handler/DisconnectTest.cpp:52: Failure
Actual function call count doesn't match EXPECT_CALL(client, Received(Output("2\n")))...
         Expected: to be called twice
           Actual: called once - unsatisfied and active


../llvm-project/lldb/unittests/DAP/Handler/DisconnectTest.cpp:52
Actual function call count doesn't match EXPECT_CALL(client, Received(Output("2\n")))...
         Expected: to be called twice
           Actual: called once - unsatisfied and active



********************
PASS: lldb-unit :: DAP/./DAPTests/11/77 (2477 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/14/77 (2478 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/15/77 (2479 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/17/77 (2480 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/16/77 (2481 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/18/77 (2482 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/19/77 (2483 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/20/77 (2484 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/22/77 (2485 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/21/77 (2486 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/2/77 (2487 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/25/77 (2488 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/23/77 (2489 of 3737)
PASS: lldb-unit :: DAP/./DAPTests/26/77 (2490 of 3737)

mikolaj-pirog pushed a commit to mikolaj-pirog/llvm-project that referenced this pull request Oct 23, 2025
dvbuka pushed a commit to dvbuka/llvm-project that referenced this pull request Oct 27, 2025
Lukacma pushed a commit to Lukacma/llvm-project that referenced this pull request Oct 29, 2025
aokblast pushed a commit to aokblast/llvm-project that referenced this pull request Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants