Skip to content

Commit cda55ad

Browse files
committed
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.4 [skip ci]
2 parents f1c4b1f + 03c6c73 commit cda55ad

File tree

640 files changed

+21634
-11297
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

640 files changed

+21634
-11297
lines changed

.github/workflows/release-binaries.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
prepare:
3636
name: Prepare to build binaries
3737
runs-on: ubuntu-22.04
38+
if: github.repository == 'llvm/llvm-project'
3839
outputs:
3940
release-version: ${{ steps.vars.outputs.release-version }}
4041
flags: ${{ steps.vars.outputs.flags }}
@@ -47,11 +48,16 @@ jobs:
4748
- name: Checkout LLVM
4849
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4950

51+
- name: Install Dependencies
52+
run: |
53+
pip install -r ./llvm/utils/git/requirements.txt
54+
5055
- name: Check Permissions
5156
env:
5257
GITHUB_TOKEN: ${{ github.token }}
58+
USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
5359
run: |
54-
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --user ${{ github.actor }} check-permissions
60+
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --user ${{ github.actor }} --user-token "$USER_TOKEN" check-permissions
5561
5662
- name: Collect Variables
5763
id: vars
@@ -85,6 +91,7 @@ jobs:
8591
name: "Fill Cache ${{ matrix.os }}"
8692
needs: prepare
8793
runs-on: ${{ matrix.os }}
94+
if: github.repository == 'llvm/llvm-project'
8895
strategy:
8996
matrix:
9097
os:
@@ -119,6 +126,7 @@ jobs:
119126
- prepare
120127
- fill-cache
121128
runs-on: ${{ matrix.target.runs-on }}
129+
if: github.repository == 'llvm/llvm-project'
122130
strategy:
123131
fail-fast: false
124132
matrix:

clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp

Lines changed: 92 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -34,102 +34,102 @@ UnusedReturnValueCheck::UnusedReturnValueCheck(llvm::StringRef Name,
3434
ClangTidyContext *Context)
3535
: ClangTidyCheck(Name, Context),
3636
CheckedFunctions(utils::options::parseStringList(
37-
Options.get("CheckedFunctions", "::std::async;"
38-
"::std::launder;"
39-
"::std::remove;"
40-
"::std::remove_if;"
41-
"::std::unique;"
42-
"::std::unique_ptr::release;"
43-
"::std::basic_string::empty;"
44-
"::std::vector::empty;"
45-
"::std::back_inserter;"
46-
"::std::distance;"
47-
"::std::find;"
48-
"::std::find_if;"
49-
"::std::inserter;"
50-
"::std::lower_bound;"
51-
"::std::make_pair;"
52-
"::std::map::count;"
53-
"::std::map::find;"
54-
"::std::map::lower_bound;"
55-
"::std::multimap::equal_range;"
56-
"::std::multimap::upper_bound;"
57-
"::std::set::count;"
58-
"::std::set::find;"
59-
"::std::setfill;"
60-
"::std::setprecision;"
61-
"::std::setw;"
62-
"::std::upper_bound;"
63-
"::std::vector::at;"
37+
Options.get("CheckedFunctions", "::std::async$;"
38+
"::std::launder$;"
39+
"::std::remove$;"
40+
"::std::remove_if$;"
41+
"::std::unique$;"
42+
"::std::unique_ptr::release$;"
43+
"::std::basic_string::empty$;"
44+
"::std::vector::empty$;"
45+
"::std::back_inserter$;"
46+
"::std::distance$;"
47+
"::std::find$;"
48+
"::std::find_if$;"
49+
"::std::inserter$;"
50+
"::std::lower_bound$;"
51+
"::std::make_pair$;"
52+
"::std::map::count$;"
53+
"::std::map::find$;"
54+
"::std::map::lower_bound$;"
55+
"::std::multimap::equal_range$;"
56+
"::std::multimap::upper_bound$;"
57+
"::std::set::count$;"
58+
"::std::set::find$;"
59+
"::std::setfill$;"
60+
"::std::setprecision$;"
61+
"::std::setw$;"
62+
"::std::upper_bound$;"
63+
"::std::vector::at$;"
6464
// C standard library
65-
"::bsearch;"
66-
"::ferror;"
67-
"::feof;"
68-
"::isalnum;"
69-
"::isalpha;"
70-
"::isblank;"
71-
"::iscntrl;"
72-
"::isdigit;"
73-
"::isgraph;"
74-
"::islower;"
75-
"::isprint;"
76-
"::ispunct;"
77-
"::isspace;"
78-
"::isupper;"
79-
"::iswalnum;"
80-
"::iswprint;"
81-
"::iswspace;"
82-
"::isxdigit;"
83-
"::memchr;"
84-
"::memcmp;"
85-
"::strcmp;"
86-
"::strcoll;"
87-
"::strncmp;"
88-
"::strpbrk;"
89-
"::strrchr;"
90-
"::strspn;"
91-
"::strstr;"
92-
"::wcscmp;"
65+
"::bsearch$;"
66+
"::ferror$;"
67+
"::feof$;"
68+
"::isalnum$;"
69+
"::isalpha$;"
70+
"::isblank$;"
71+
"::iscntrl$;"
72+
"::isdigit$;"
73+
"::isgraph$;"
74+
"::islower$;"
75+
"::isprint$;"
76+
"::ispunct$;"
77+
"::isspace$;"
78+
"::isupper$;"
79+
"::iswalnum$;"
80+
"::iswprint$;"
81+
"::iswspace$;"
82+
"::isxdigit$;"
83+
"::memchr$;"
84+
"::memcmp$;"
85+
"::strcmp$;"
86+
"::strcoll$;"
87+
"::strncmp$;"
88+
"::strpbrk$;"
89+
"::strrchr$;"
90+
"::strspn$;"
91+
"::strstr$;"
92+
"::wcscmp$;"
9393
// POSIX
94-
"::access;"
95-
"::bind;"
96-
"::connect;"
97-
"::difftime;"
98-
"::dlsym;"
99-
"::fnmatch;"
100-
"::getaddrinfo;"
101-
"::getopt;"
102-
"::htonl;"
103-
"::htons;"
104-
"::iconv_open;"
105-
"::inet_addr;"
106-
"::isascii;"
107-
"::isatty;"
108-
"::mmap;"
109-
"::newlocale;"
110-
"::openat;"
111-
"::pathconf;"
112-
"::pthread_equal;"
113-
"::pthread_getspecific;"
114-
"::pthread_mutex_trylock;"
115-
"::readdir;"
116-
"::readlink;"
117-
"::recvmsg;"
118-
"::regexec;"
119-
"::scandir;"
120-
"::semget;"
121-
"::setjmp;"
122-
"::shm_open;"
123-
"::shmget;"
124-
"::sigismember;"
125-
"::strcasecmp;"
126-
"::strsignal;"
94+
"::access$;"
95+
"::bind$;"
96+
"::connect$;"
97+
"::difftime$;"
98+
"::dlsym$;"
99+
"::fnmatch$;"
100+
"::getaddrinfo$;"
101+
"::getopt$;"
102+
"::htonl$;"
103+
"::htons$;"
104+
"::iconv_open$;"
105+
"::inet_addr$;"
106+
"::isascii$;"
107+
"::isatty$;"
108+
"::mmap$;"
109+
"::newlocale$;"
110+
"::openat$;"
111+
"::pathconf$;"
112+
"::pthread_equal$;"
113+
"::pthread_getspecific$;"
114+
"::pthread_mutex_trylock$;"
115+
"::readdir$;"
116+
"::readlink$;"
117+
"::recvmsg$;"
118+
"::regexec$;"
119+
"::scandir$;"
120+
"::semget$;"
121+
"::setjmp$;"
122+
"::shm_open$;"
123+
"::shmget$;"
124+
"::sigismember$;"
125+
"::strcasecmp$;"
126+
"::strsignal$;"
127127
"::ttyname"))),
128128
CheckedReturnTypes(utils::options::parseStringList(
129-
Options.get("CheckedReturnTypes", "::std::error_code;"
130-
"::std::error_condition;"
131-
"::std::errc;"
132-
"::std::expected;"
129+
Options.get("CheckedReturnTypes", "::std::error_code$;"
130+
"::std::error_condition$;"
131+
"::std::errc$;"
132+
"::std::expected$;"
133133
"::boost::system::error_code"))),
134134
AllowCastToVoid(Options.get("AllowCastToVoid", false)) {}
135135

clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,8 +888,14 @@ bool IdentifierNamingCheck::matchesStyle(
888888
return false;
889889
if (IdentifierNamingCheck::HungarianPrefixType::HPT_Off != Style.HPType) {
890890
std::string HNPrefix = HungarianNotation.getPrefix(Decl, HNOption);
891-
if (!Name.consume_front(HNPrefix))
892-
return false;
891+
if (!HNPrefix.empty()) {
892+
if (!Name.consume_front(HNPrefix))
893+
return false;
894+
if (Style.HPType ==
895+
IdentifierNamingCheck::HungarianPrefixType::HPT_LowerCase &&
896+
!Name.consume_front("_"))
897+
return false;
898+
}
893899
}
894900

895901
// Ensure the name doesn't have any extra underscores beyond those specified

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ Changes in existing checks
152152

153153
- Improved :doc:`bugprone-unused-return-value
154154
<clang-tidy/checks/bugprone/unused-return-value>` check by updating the
155-
parameter `CheckedFunctions` to support regexp.
155+
parameter `CheckedFunctions` to support regexp and avoiding false postive for
156+
function with the same prefix as the default argument, e.g. ``std::unique_ptr``
157+
and ``std::unique``.
156158

157159
- Improved :doc:`bugprone-use-after-move
158160
<clang-tidy/checks/bugprone/use-after-move>` check to also handle
@@ -233,7 +235,8 @@ Changes in existing checks
233235

234236
- Improved :doc:`readability-identifier-naming
235237
<clang-tidy/checks/readability/identifier-naming>` check in `GetConfigPerFile`
236-
mode by resolving symbolic links to header files.
238+
mode by resolving symbolic links to header files. Fixed handling of Hungarian
239+
Prefix when configured to `LowerCase`.
237240

238241
Removed checks
239242
^^^^^^^^^^^^^^

clang-tools-extra/docs/clang-tidy/checks/bugprone/unused-return-value.rst

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,23 @@ Options
1414
This parameter supports regexp. The function is checked if the name
1515
and scope matches, with any arguments.
1616
By default the following functions are checked:
17-
``std::async, std::launder, std::remove, std::remove_if, std::unique,
18-
std::unique_ptr::release, std::basic_string::empty, std::vector::empty,
19-
std::back_inserter, std::distance, std::find, std::find_if, std::inserter,
20-
std::lower_bound, std::make_pair, std::map::count, std::map::find,
21-
std::map::lower_bound, std::multimap::equal_range,
22-
std::multimap::upper_bound, std::set::count, std::set::find, std::setfill,
23-
std::setprecision, std::setw, std::upper_bound, std::vector::at,
24-
bsearch, ferror, feof, isalnum, isalpha, isblank, iscntrl, isdigit, isgraph,
25-
islower, isprint, ispunct, isspace, isupper, iswalnum, iswprint, iswspace,
26-
isxdigit, memchr, memcmp, strcmp, strcoll, strncmp, strpbrk, strrchr,
27-
strspn, strstr, wcscmp, access, bind, connect, difftime, dlsym, fnmatch,
28-
getaddrinfo, getopt, htonl, htons, iconv_open, inet_addr, isascii, isatty,
29-
mmap, newlocale, openat, pathconf, pthread_equal, pthread_getspecific,
30-
pthread_mutex_trylock, readdir, readlink, recvmsg, regexec, scandir,
31-
semget, setjmp, shm_open, shmget, sigismember, strcasecmp, strsignal,
32-
ttyname``
17+
``::std::async$, ::std::launder$, ::std::remove$, ::std::remove_if$, ::std::unique$,
18+
::std::unique_ptr::release$, ::std::basic_string::empty$, ::std::vector::empty$,
19+
::std::back_inserter$, ::std::distance$, ::std::find$, ::std::find_if$, ::std::inserter$,
20+
::std::lower_bound$, ::std::make_pair$, ::std::map::count$, ::std::map::find$,
21+
::std::map::lower_bound$, ::std::multimap::equal_range$, ::std::multimap::upper_bound$,
22+
::std::set::count$, ::std::set::find$, ::std::setfill$, ::std::setprecision$,
23+
::std::setw$, ::std::upper_bound$, ::std::vector::at$, ::bsearch$, ::ferror$,
24+
::feof$, ::isalnum$, ::isalpha$, ::isblank$, ::iscntrl$, ::isdigit$, ::isgraph$,
25+
::islower$, ::isprint$, ::ispunct$, ::isspace$, ::isupper$, ::iswalnum$, ::iswprint$,
26+
::iswspace$, ::isxdigit$, ::memchr$, ::memcmp$, ::strcmp$, ::strcoll$, ::strncmp$,
27+
::strpbrk$, ::strrchr$, ::strspn$, ::strstr$, ::wcscmp$, ::access$, ::bind$,
28+
::connect$, ::difftime$, ::dlsym$, ::fnmatch$, ::getaddrinfo$, ::getopt$,
29+
::htonl$, ::htons$, ::iconv_open$, ::inet_addr$, isascii$, isatty$, ::mmap$,
30+
::newlocale$, ::openat$, ::pathconf$, ::pthread_equal$, ::pthread_getspecific$,
31+
::pthread_mutex_trylock$, ::readdir$, ::readlink$, ::recvmsg$, ::regexec$, ::scandir$,
32+
::semget$, ::setjmp$, ::shm_open$, ::shmget$, ::sigismember$, ::strcasecmp$, ::strsignal$,
33+
::ttyname$``
3334

3435
- ``std::async()``. Not using the return value makes the call synchronous.
3536
- ``std::launder()``. Not using the return value usually means that the

clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ another if a mismatch is detected
1111

1212
Casing types include:
1313

14-
- ``lower_case``,
15-
- ``UPPER_CASE``,
16-
- ``camelBack``,
17-
- ``CamelCase``,
18-
- ``camel_Snake_Back``,
19-
- ``Camel_Snake_Case``,
20-
- ``aNy_CasE``,
21-
- ``Leading_upper_snake_case``.
14+
- ``lower_case``
15+
- ``UPPER_CASE``
16+
- ``camelBack``
17+
- ``CamelCase``
18+
- ``camel_Snake_Back``
19+
- ``Camel_Snake_Case``
20+
- ``aNy_CasE``
21+
- ``Leading_upper_snake_case``
2222

2323
It also supports a fixed prefix and suffix that will be prepended or appended
2424
to the identifiers, regardless of the casing.
@@ -32,8 +32,16 @@ but not where they are overridden, as it can't be fixed locally there.
3232
This also applies for pseudo-override patterns like CRTP.
3333

3434
``Leading_upper_snake_case`` is a naming convention where the first word is capitalized
35-
followed by lower case word(s) seperated by underscore(s) '_'. Examples include:
36-
Cap_snake_case, Cobra_case, Foo_bar_baz, and Master_copy_8gb.
35+
followed by lower case word(s) separated by underscore(s) '_'. Examples include:
36+
`Cap_snake_case`, `Cobra_case`, `Foo_bar_baz`, and `Master_copy_8gb`.
37+
38+
Hungarian notation can be customized using different *HungarianPrefix* settings.
39+
The options and their corresponding values are:
40+
41+
- ``Off`` - the default setting
42+
- ``On`` - example: ``int iVariable``
43+
- ``LowerCase`` - example: ``int i_Variable``
44+
- ``CamelCase`` - example: ``int IVariable``
3745

3846
Options
3947
-------

clang-tools-extra/test/clang-tidy/checkers/bugprone/unused-return-value.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ struct default_delete;
3030

3131
template <typename T, typename Deleter = std::default_delete<T>>
3232
struct unique_ptr {
33+
unique_ptr();
34+
unique_ptr(unique_ptr const&);
35+
unique_ptr(unique_ptr &&);
36+
unique_ptr& operator=(unique_ptr const&);
37+
unique_ptr& operator=(unique_ptr &&);
3338
T *release() noexcept;
3439
};
3540

@@ -254,3 +259,12 @@ void noWarning() {
254259
({ std::async(increment, 42); });
255260
auto StmtExprRetval = ({ std::async(increment, 42); });
256261
}
262+
263+
namespace gh84314 {
264+
265+
extern std::unique_ptr<int> alloc();
266+
void f1(std::unique_ptr<int> &foo) {
267+
foo = alloc();
268+
}
269+
270+
} // namespace gh84314

0 commit comments

Comments
 (0)