Skip to content

Commit 4bdd647

Browse files
committed
Merge commit '178719e86043c1e830a7e24de027a84f6f8ea28f' into llvmspirv_pulldown
2 parents 99852c0 + 178719e commit 4bdd647

File tree

628 files changed

+22213
-9415
lines changed

Some content is hidden

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

628 files changed

+22213
-9415
lines changed

.git-blame-ignore-revs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,8 @@ f6d557ee34b6bbdb1dc32f29e34b4a4a8ad35e81
7373

7474
# [libc++] Format the code base (#74334)
7575
9783f28cbb155e4a8d49c12e1c60ce14dcfaf0c7
76+
77+
# [RFC] compiler-rt builtins cleanup and refactoring
78+
082b89b25faae3e45a023caf51b65ca0f02f377f
79+
0ba22f51d128bee9d69756c56c4678097270e10b
80+
84da0e1bb75f8666cf222d2f600f37bebb9ea389

.github/new-prs-labeler.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,49 @@ mc:
7575
clang:driver:
7676
- clang/*/Driver/**
7777

78+
compiler-rt:asan:
79+
- compiler-rt/lib/asan/**
80+
- compiler-rt/include/sanitizer/asan_interface.h
81+
- compiler-rt/test/asan/**
82+
- compiler-rt/lib/asan_abi/**
83+
- compiler-rt/test/asan_abi/**
84+
85+
compiler-rt:builtins:
86+
- compiler-rt/lib/builtins/**
87+
- compiler-rt/test/builtins/**
88+
89+
compiler-rt:cfi:
90+
- compiler-rt/lib/cfi/**
91+
- compiler-rt/test/cfi/**
92+
93+
compiler-rt:fuzzer:
94+
- compiler-rt/lib/fuzzer/**
95+
- compiler-rt/include/fuzzer/**
96+
- compiler-rt/test/fuzzer/**
97+
98+
compiler-rt:hwasan:
99+
- compiler-rt/lib/hwasan/**
100+
- compiler-rt/include/sanitizer/hwasan_interface.h
101+
- compiler-rt/test/hwasan/**
102+
103+
compiler-rt:lsan:
104+
- compiler-rt/lib/lsan/**
105+
- compiler-rt/include/sanitizer/lsan_interface.h
106+
- compiler-rt/test/lsan/**
107+
108+
compiler-rt:msan:
109+
- compiler-rt/lib/msan/**
110+
- compiler-rt/include/sanitizer/msan_interface.h
111+
- compiler-rt/test/msan/**
112+
78113
compiler-rt:sanitizer:
79114
- llvm/lib/Transforms/Instrumentation/*Sanitizer*
80115
- compiler-rt/lib/interception/**
81116
- compiler-rt/lib/*san*/**
117+
- compiler-rt/include/sanitizer/**
82118
- compiler-rt/test/*san*/**
83119
- compiler-rt/lib/fuzzer/**
120+
- compiler-rt/include/fuzzer/**
84121
- compiler-rt/test/fuzzer/**
85122
- compiler-rt/lib/scudo/**
86123
- compiler-rt/test/scudo/**
@@ -89,6 +126,19 @@ compiler-rt:scudo:
89126
- compiler-rt/lib/scudo/**
90127
- compiler-rt/test/scudo/**
91128

129+
compiler-rt:tsan:
130+
- compiler-rt/lib/tsan/**
131+
- compiler-rt/include/sanitizer/tsan_interface.h
132+
- compiler-rt/include/sanitizer/tsan_interface_atomic.h
133+
- compiler-rt/test/tsan/**
134+
135+
compiler-rt:ubsan:
136+
- compiler-rt/lib/ubsan/**
137+
- compiler-rt/include/sanitizer/ubsan_interface.h
138+
- compiler-rt/test/ubsan/**
139+
- compiler-rt/lib/ubsan_minimal/**
140+
- compiler-rt/test/ubsan_minimal/**
141+
92142
xray:
93143
- llvm/tools/llvm-xray/**
94144
- compiler-rt/*/xray/**

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

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,35 @@ FROM docker.io/library/ubuntu:22.04 as base
22
ENV LLVM_SYSROOT=/opt/llvm/
33

44
FROM base as toolchain
5-
ENV LLVM_MAJOR=17
6-
ENV LLVM_VERSION=${LLVM_MAJOR}.0.6
7-
ENV LLVM_DIRNAME=clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-22.04
8-
ENV LLVM_FILENAME=${LLVM_DIRNAME}.tar.xz
5+
ENV LLVM_VERSION=17.0.6
96

107
RUN apt-get update && \
118
apt-get install -y \
12-
curl \
13-
xz-utils
9+
wget \
10+
gcc \
11+
g++ \
12+
cmake \
13+
ninja-build \
14+
python3
15+
16+
RUN wget https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-$LLVM_VERSION.tar.gz && tar -xf llvmorg-$LLVM_VERSION.tar.gz
1417

15-
RUN mkdir -p $LLVM_SYSROOT/bin/ $LLVM_SYSROOT/lib/
18+
WORKDIR /llvm-project-llvmorg-$LLVM_VERSION
1619

17-
RUN curl -O -L https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/$LLVM_FILENAME
20+
RUN mkdir build
1821

19-
RUN tar -C $LLVM_SYSROOT --strip-components=1 -xJf $LLVM_FILENAME \
20-
$LLVM_DIRNAME/bin/clang \
21-
$LLVM_DIRNAME/bin/clang++ \
22-
$LLVM_DIRNAME/bin/clang-cl \
23-
$LLVM_DIRNAME/bin/clang-$LLVM_MAJOR \
24-
$LLVM_DIRNAME/bin/lld \
25-
$LLVM_DIRNAME/bin/ld.lld \
26-
$LLVM_DIRNAME/lib/clang/
22+
RUN cmake -B ./build -G Ninja ./llvm \
23+
-C ./clang/cmake/caches/BOLT-PGO.cmake \
24+
-DBOOTSTRAP_LLVM_ENABLE_LLD=ON \
25+
-DBOOTSTRAP_BOOTSTRAP_LLVM_ENABLE_LLD=ON \
26+
-DPGO_INSTRUMENT_LTO=Thin \
27+
-DLLVM_ENABLE_RUNTIMES="compiler-rt" \
28+
-DCMAKE_INSTALL_PREFIX="$LLVM_SYSROOT" \
29+
-DLLVM_ENABLE_PROJECTS="bolt;clang;lld;clang-tools-extra" \
30+
-DLLVM_DISTRIBUTION_COMPONENTS="lld;compiler-rt;clang-format" \
31+
-DCLANG_DEFAULT_LINKER="lld"
2732

33+
RUN ninja -C ./build stage2-clang-bolt stage2-install-distribution && ninja -C ./build install-distribution && rm -rf ./build
2834

2935
FROM base
3036

.github/workflows/merged-prs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Add buildbot information to first PRs from new contributors"
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
# It's safe to use pull_request_target here, because we aren't checking out
8+
# code from the pull request branch.
9+
# See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
10+
pull_request_target:
11+
types:
12+
- closed
13+
14+
jobs:
15+
buildbot_comment:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
pull-requests: write
19+
if: >-
20+
(github.repository == 'llvm/llvm-project') &&
21+
(github.event.pull_request.merged == true)
22+
steps:
23+
- name: Checkout Automation Script
24+
uses: actions/checkout@v4
25+
with:
26+
sparse-checkout: llvm/utils/git/
27+
ref: main
28+
29+
- name: Setup Automation Script
30+
working-directory: ./llvm/utils/git/
31+
run: |
32+
pip install -r requirements.txt
33+
34+
- name: Add Buildbot information comment
35+
working-directory: ./llvm/utils/git/
36+
run: |
37+
python3 ./github-automation.py \
38+
--token '${{ secrets.GITHUB_TOKEN }}' \
39+
pr-buildbot-information \
40+
--issue-number "${{ github.event.pull_request.number }}" \
41+
--author "${{ github.event.pull_request.user.login }}"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static std::optional<std::string> getUnderscoreCapitalFixup(StringRef Name) {
104104
static bool startsWithUnderscoreInGlobalNamespace(StringRef Name,
105105
bool IsInGlobalNamespace,
106106
bool IsMacro) {
107-
return !IsMacro && IsInGlobalNamespace && !Name.empty() && Name[0] == '_';
107+
return !IsMacro && IsInGlobalNamespace && Name.starts_with("_");
108108
}
109109

110110
static std::optional<std::string>

clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "LimitedRandomnessCheck.h"
3434
#include "MutatingCopyCheck.h"
3535
#include "NonTrivialTypesLibcMemoryCallsCheck.h"
36-
#include "PostfixOperatorCheck.h"
3736
#include "ProperlySeededRandomGeneratorCheck.h"
3837
#include "SetLongJmpCheck.h"
3938
#include "StaticObjectExceptionCheck.h"
@@ -239,8 +238,6 @@ class CERTModule : public ClangTidyModule {
239238
CheckFactories.registerCheck<bugprone::SpuriouslyWakeUpFunctionsCheck>(
240239
"cert-con54-cpp");
241240
// DCL
242-
CheckFactories.registerCheck<PostfixOperatorCheck>(
243-
"cert-dcl21-cpp");
244241
CheckFactories.registerCheck<VariadicFunctionDefCheck>("cert-dcl50-cpp");
245242
CheckFactories.registerCheck<bugprone::ReservedIdentifierCheck>(
246243
"cert-dcl51-cpp");

clang-tools-extra/clang-tidy/cert/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ add_clang_library(clangTidyCERTModule
1212
LimitedRandomnessCheck.cpp
1313
MutatingCopyCheck.cpp
1414
NonTrivialTypesLibcMemoryCallsCheck.cpp
15-
PostfixOperatorCheck.cpp
1615
ProperlySeededRandomGeneratorCheck.cpp
1716
SetLongJmpCheck.cpp
1817
StaticObjectExceptionCheck.cpp

clang-tools-extra/clang-tidy/cert/PostfixOperatorCheck.cpp

Lines changed: 0 additions & 80 deletions
This file was deleted.

clang-tools-extra/clang-tidy/cert/PostfixOperatorCheck.h

Lines changed: 0 additions & 34 deletions
This file was deleted.

clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
using namespace clang::ast_matchers;
1414

15+
namespace clang::tidy::modernize {
16+
1517
namespace {
1618

1719
AST_MATCHER(clang::TypeLoc, hasValidBeginLoc) {
@@ -38,16 +40,32 @@ AST_MATCHER(clang::ParmVarDecl, isArgvOfMain) {
3840

3941
} // namespace
4042

41-
namespace clang::tidy::modernize {
43+
AvoidCArraysCheck::AvoidCArraysCheck(StringRef Name, ClangTidyContext *Context)
44+
: ClangTidyCheck(Name, Context),
45+
AllowStringArrays(Options.get("AllowStringArrays", false)) {}
46+
47+
void AvoidCArraysCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
48+
Options.store(Opts, "AllowStringArrays", AllowStringArrays);
49+
}
4250

4351
void AvoidCArraysCheck::registerMatchers(MatchFinder *Finder) {
52+
ast_matchers::internal::Matcher<TypeLoc> IgnoreStringArrayIfNeededMatcher =
53+
anything();
54+
if (AllowStringArrays)
55+
IgnoreStringArrayIfNeededMatcher =
56+
unless(typeLoc(loc(hasCanonicalType(incompleteArrayType(
57+
hasElementType(isAnyCharacter())))),
58+
hasParent(varDecl(hasInitializer(stringLiteral()),
59+
unless(parmVarDecl())))));
60+
4461
Finder->addMatcher(
4562
typeLoc(hasValidBeginLoc(), hasType(arrayType()),
4663
unless(anyOf(hasParent(parmVarDecl(isArgvOfMain())),
4764
hasParent(varDecl(isExternC())),
4865
hasParent(fieldDecl(
4966
hasParent(recordDecl(isExternCContext())))),
50-
hasAncestor(functionDecl(isExternC())))))
67+
hasAncestor(functionDecl(isExternC())))),
68+
std::move(IgnoreStringArrayIfNeededMatcher))
5169
.bind("typeloc"),
5270
this);
5371
}

0 commit comments

Comments
 (0)