Skip to content

Commit 2b8d53b

Browse files
authored
Merge branch 'main' into hlsl-firstbitlow
2 parents 242a3c9 + 17912f3 commit 2b8d53b

File tree

332 files changed

+41713
-35678
lines changed

Some content is hidden

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

332 files changed

+41713
-35678
lines changed

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ RUN apt-get update && \
5757
nodejs \
5858
perl-modules \
5959
python3-psutil \
60+
sudo \
6061

6162
# These are needed by the premerge pipeline. Pip is used to install
6263
# dependent python packages and ccache is used for build caching. File and
@@ -66,12 +67,28 @@ RUN apt-get update && \
6667
file \
6768
tzdata
6869

70+
# Install sccache as it is needed by most of the project test workflows and
71+
# cannot be installed by the ccache action when executing as a non-root user.
72+
# TODO(boomanaiden154): This should be switched to being installed with apt
73+
# once we bump to Ubuntu 24.04.
74+
RUN curl -L 'https://github.com/mozilla/sccache/releases/download/v0.7.6/sccache-v0.7.6-x86_64-unknown-linux-musl.tar.gz' > /tmp/sccache.tar.gz && \
75+
echo "2902a5e44c3342132f07b62e70cca75d9b23252922faf3b924f449808cc1ae58 /tmp/sccache.tar.gz" | sha256sum -c && \
76+
tar xzf /tmp/sccache.tar.gz -O --wildcards '*/sccache' > '/usr/local/bin/sccache' && \
77+
rm /tmp/sccache.tar.gz && \
78+
chmod +x /usr/local/bin/sccache
79+
6980
ENV LLVM_SYSROOT=$LLVM_SYSROOT
7081
ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
7182

7283
# Create a new user to avoid test failures related to a lack of expected
7384
# permissions issues in some tests. Set the user id to 1001 as that is the
7485
# user id that Github Actions uses to perform the checkout action.
7586
RUN useradd gha -u 1001 -m -s /bin/bash
87+
88+
# Also add the user to passwordless sudoers so that we can install software
89+
# later on without having to rebuild the container.
90+
RUN adduser gha sudo
91+
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
92+
7693
USER gha
7794

.github/workflows/libclang-python-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ jobs:
3737
projects: clang
3838
# There is an issue running on "windows-2019".
3939
# See https://github.com/llvm/llvm-project/issues/76601#issuecomment-1873049082.
40-
os_list: '["ubuntu-latest"]'
40+
os_list: '["ubuntu-22.04"]'
4141
python_version: ${{ matrix.python-version }}

.github/workflows/llvm-project-tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ on:
3939
type: string
4040
# Use windows-2019 due to:
4141
# https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
42-
default: '["ubuntu-latest", "windows-2019", "macOS-13"]'
42+
# Use ubuntu-22.04 rather than ubuntu-latest to match the ubuntu
43+
# version in the CI container. Without this, setup-python tries
44+
# to install a python version linked against a newer version of glibc.
45+
# TODO(boomanaiden154): Bump the Ubuntu version once the version in the
46+
# container is bumped.
47+
default: '["ubuntu-22.04", "windows-2019", "macOS-13"]'
4348

4449
python_version:
4550
required: false
@@ -113,7 +118,8 @@ jobs:
113118
run: |
114119
if [ "${{ runner.os }}" == "Linux" ]; then
115120
builddir="/mnt/build/"
116-
mkdir -p $builddir
121+
sudo mkdir -p $builddir
122+
sudo chown gha $builddir
117123
extra_cmake_args="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
118124
else
119125
builddir="$(pwd)"/build

.github/workflows/premerge.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ jobs:
3131
- name: Setup ccache
3232
uses: hendrikmuhs/[email protected]
3333
- name: Build and Test
34+
# Mark the job as a success even if the step fails so that people do
35+
# not get notified while the new premerge pipeline is in an
36+
# experimental state.
37+
# TODO(boomanaiden154): Remove this once the pipeline is stable and we
38+
# are ready for people to start recieving notifications.
39+
continue-on-error: true
3440
run: |
3541
git config --global --add safe.directory '*'
3642

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "clang/ASTMatchers/ASTMatchFinder.h"
1616
#include "clang/ASTMatchers/ASTMatchers.h"
1717
#include "clang/ASTMatchers/ASTMatchersMacros.h"
18+
#include "clang/Basic/LangOptions.h"
1819

1920
using namespace clang::ast_matchers;
2021
using namespace clang::tidy::matchers;
@@ -29,9 +30,10 @@ static constexpr StringRef DefaultIncludeTypeRegex =
2930

3031
AST_MATCHER(VarDecl, isLocalVarDecl) { return Node.isLocalVarDecl(); }
3132
AST_MATCHER(VarDecl, isReferenced) { return Node.isReferenced(); }
32-
AST_MATCHER_P(VarDecl, explicitMarkUnused, LangOptions, LangOpts) {
33+
AST_MATCHER(VarDecl, explicitMarkUnused) {
3334
// Implementations should not emit a warning that a name-independent
3435
// declaration is used or unused.
36+
LangOptions const &LangOpts = Finder->getASTContext().getLangOpts();
3537
return Node.hasAttr<UnusedAttr>() ||
3638
(LangOpts.CPlusPlus26 && Node.isPlaceholderVar(LangOpts));
3739
}
@@ -66,7 +68,7 @@ void UnusedLocalNonTrivialVariableCheck::registerMatchers(MatchFinder *Finder) {
6668
varDecl(isLocalVarDecl(), unless(isReferenced()),
6769
unless(isExceptionVariable()), hasLocalStorage(), isDefinition(),
6870
unless(hasType(isReferenceType())), unless(hasType(isTrivial())),
69-
unless(explicitMarkUnused(getLangOpts())),
71+
unless(explicitMarkUnused()),
7072
hasType(hasUnqualifiedDesugaredType(
7173
anyOf(recordType(hasDeclaration(namedDecl(
7274
matchesAnyListedName(IncludeTypes),

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,10 @@ Changes in existing checks
350350
file path for anonymous enums in the diagnostic, and by fixing a typo in the
351351
diagnostic.
352352

353+
- Improved :doc:`readability-identifier-naming
354+
<clang-tidy/checks/readability/identifier-naming>` check to
355+
validate ``namespace`` aliases.
356+
353357
- Improved :doc:`readability-implicit-bool-conversion
354358
<clang-tidy/checks/readability/implicit-bool-conversion>` check
355359
by adding the option `UseUpperCaseLiteralSuffix` to select the
@@ -360,10 +364,6 @@ Changes in existing checks
360364
<clang-tidy/checks/readability/redundant-smartptr-get>` check to
361365
remove `->`, when redundant `get()` is removed.
362366

363-
- Improved :doc:`readability-identifier-naming
364-
<clang-tidy/checks/readability/identifier-naming>` check to
365-
validate ``namespace`` aliases.
366-
367367
Removed checks
368368
^^^^^^^^^^^^^^
369369

clang/docs/LibASTMatchersReference.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3462,6 +3462,21 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
34623462
</pre></td></tr>
34633463

34643464

3465+
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1DependentNameType.html">DependentNameType</a>&gt;</td><td class="name" onclick="toggle('hasDependentName1')"><a name="hasDependentName1Anchor">hasDependentName</a></td><td>std::string N</td></tr>
3466+
<tr><td colspan="4" class="doc" id="hasDependentName1"><pre>Matches the dependent name of a DependentNameType.
3467+
3468+
Matches the dependent name of a DependentNameType
3469+
3470+
Given:
3471+
3472+
template &lt;typename T&lt; struct declToImport {
3473+
typedef typename T::type dependent_name;
3474+
};
3475+
3476+
dependentNameType(hasDependentName("type")) matches `T::type`
3477+
</pre></td></tr>
3478+
3479+
34653480
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1CXXDependentScopeMemberExpr.html">CXXDependentScopeMemberExpr</a>&gt;</td><td class="name" onclick="toggle('memberHasSameNameAsBoundNode0')"><a name="memberHasSameNameAsBoundNode0Anchor">memberHasSameNameAsBoundNode</a></td><td>std::string BindingID</td></tr>
34663481
<tr><td colspan="4" class="doc" id="memberHasSameNameAsBoundNode0"><pre>Matches template-dependent, but known, member names against an already-bound
34673482
node

0 commit comments

Comments
 (0)