Skip to content

Commit 5a54a04

Browse files
authored
Merge branch 'main' into typed-value
2 parents be2c031 + 6806349 commit 5a54a04

File tree

810 files changed

+28996
-15562
lines changed

Some content is hidden

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

810 files changed

+28996
-15562
lines changed

.github/workflows/bazel-checks.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ jobs:
3333
3434
bazel-build:
3535
name: "Bazel Build/Test"
36-
runs-on: llvm-premerge-linux-runners
36+
# Only run on US Central workers so we only have to keep one cache warm as
37+
# the cache buckets are per cluster.
38+
runs-on:
39+
group: llvm-premerge-cluster-us-central
40+
labels: llvm-premerge-linux-runners
3741
if: github.repository == 'llvm/llvm-project'
3842
steps:
3943
- name: Fetch LLVM sources
@@ -44,7 +48,7 @@ jobs:
4448
- name: Setup System Dependencies
4549
run: |
4650
sudo apt-get update
47-
sudo apt-get install -y libmpfr-dev libpfm4-dev
51+
sudo apt-get install -y libmpfr-dev libpfm4-dev m4 libedit-dev
4852
sudo curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-amd64.deb > /tmp/bazelisk.deb
4953
sudo apt-get install -y /tmp/bazelisk.deb
5054
rm /tmp/bazelisk.deb
@@ -54,4 +58,4 @@ jobs:
5458
bazelisk test --config=ci --sandbox_base="" \
5559
--remote_cache=https://storage.googleapis.com/$CACHE_GCS_BUCKET-bazel \
5660
--google_default_credentials \
57-
@llvm-project//llvm/unittests:adt_tests
61+
@llvm-project//... //...

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

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ jobs:
8484
if: github.repository_owner == 'llvm'
8585
needs: abi-dump-setup
8686
runs-on: ubuntu-24.04
87+
container:
88+
image: "ghcr.io/llvm/ci-ubuntu-24.04-abi-tests@sha256:f80125c0f767e29b8616210c0fd5cea2cd1f4fb6f2ca86d89f6016b6329b8d7f" #ghcr.io/llvm/ci-ubuntu-24.04-abi-tests:9524b37c503f
8789
strategy:
8890
matrix:
8991
name:
@@ -101,17 +103,6 @@ jobs:
101103
steps:
102104
- name: Install Ninja
103105
uses: llvm/actions/install-ninja@42d80571b13f4599bbefbc7189728b64723c7f78 # main
104-
- name: Install abi-compliance-checker
105-
run: |
106-
sudo apt-get update
107-
sudo apt-get install -y abi-dumper autoconf pkg-config
108-
- name: Install universal-ctags
109-
run: |
110-
git clone https://github.com/universal-ctags/ctags.git
111-
cd ctags
112-
./autogen.sh
113-
./configure
114-
sudo make install
115106
- name: Download source code
116107
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
117108
with:
@@ -139,6 +130,8 @@ jobs:
139130
abi-compare:
140131
if: github.repository_owner == 'llvm'
141132
runs-on: ubuntu-24.04
133+
container:
134+
image: "ghcr.io/llvm/ci-ubuntu-24.04-abi-tests@sha256:f80125c0f767e29b8616210c0fd5cea2cd1f4fb6f2ca86d89f6016b6329b8d7f" #ghcr.io/llvm/ci-ubuntu-24.04-abi-tests:9524b37c503f
142135
needs:
143136
- abi-dump-setup
144137
- abi-dump
@@ -154,10 +147,6 @@ jobs:
154147
name: build-latest
155148
path: build-latest
156149

157-
- name: Install abi-compliance-checker
158-
run: |
159-
sudo apt-get update
160-
sudo apt-get install -y abi-compliance-checker
161150
- name: Compare ABI
162151
run: |
163152
for lib in ${{ needs.abi-dump-setup.outputs.ABI_LIBS }}; do

.github/workflows/release-binaries.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,6 @@ jobs:
191191
- name: Install Ninja
192192
uses: llvm/actions/install-ninja@42d80571b13f4599bbefbc7189728b64723c7f78 # main
193193

194-
- name: Setup Windows
195-
if: startsWith(runner.os, 'Windows')
196-
uses: llvm/actions/setup-windows@42d80571b13f4599bbefbc7189728b64723c7f78 # main
197-
with:
198-
arch: amd64
199-
200194
- name: Set Build Prefix
201195
id: setup-stage
202196
shell: bash

clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ void AvoidCStyleCastsCheck::check(const MatchFinder::MatchResult &Result) {
269269
return;
270270
}
271271
break;
272+
case CK_BaseToDerived:
273+
if (!needsConstCast(SourceType, DestType)) {
274+
ReplaceWithNamedCast("static_cast");
275+
return;
276+
}
277+
break;
272278
default:
273279
break;
274280
}

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,10 @@ Changes in existing checks
402402
adding an option to allow pointer arithmetic via prefix/postfix increment or
403403
decrement operators.
404404

405+
- Improved :doc:`google-readability-casting
406+
<clang-tidy/checks/google/readability-casting>` check by adding fix-it
407+
notes for downcasts.
408+
405409
- Improved :doc:`llvm-prefer-isa-or-dyn-cast-in-conditionals
406410
<clang-tidy/checks/llvm/prefer-isa-or-dyn-cast-in-conditionals>` check:
407411

clang-tools-extra/test/clang-tidy/checkers/google/readability-casting.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ void f(int a, double b, const char *cpc, const void *cpv, X *pX) {
102102
// CHECK-FIXES: b1 = static_cast<int>(b);
103103

104104
Y *pB = (Y*)pX;
105-
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: {{.*}}; use static_cast/const_cast/reinterpret_cast [
105+
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: {{.*}}; use static_cast {{.*}}
106+
// CHECK-FIXES: Y *pB = static_cast<Y*>(pX);
106107
Y &rB = (Y&)*pX;
107-
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: {{.*}}; use static_cast/const_cast/reinterpret_cast [
108+
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: {{.*}}; use static_cast {{.*}}
109+
// CHECK-FIXES: Y &rB = static_cast<Y&>(*pX);
108110

109111
const char *pc3 = (const char*)cpv;
110112
// CHECK-MESSAGES: :[[@LINE-1]]:21: warning: {{.*}}; use static_cast [

clang/include/clang/AST/Attr.h

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -233,44 +233,19 @@ class HLSLAnnotationAttr : public InheritableAttr {
233233
}
234234
};
235235

236-
class HLSLSemanticAttr : public HLSLAnnotationAttr {
237-
unsigned SemanticIndex = 0;
238-
LLVM_PREFERRED_TYPE(bool)
239-
unsigned SemanticIndexable : 1;
240-
LLVM_PREFERRED_TYPE(bool)
241-
unsigned SemanticExplicitIndex : 1;
242-
243-
Decl *TargetDecl = nullptr;
244-
236+
class HLSLSemanticBaseAttr : public HLSLAnnotationAttr {
245237
protected:
246-
HLSLSemanticAttr(ASTContext &Context, const AttributeCommonInfo &CommonInfo,
247-
attr::Kind AK, bool IsLateParsed,
248-
bool InheritEvenIfAlreadyPresent, bool SemanticIndexable)
238+
HLSLSemanticBaseAttr(ASTContext &Context,
239+
const AttributeCommonInfo &CommonInfo, attr::Kind AK,
240+
bool IsLateParsed, bool InheritEvenIfAlreadyPresent)
249241
: HLSLAnnotationAttr(Context, CommonInfo, AK, IsLateParsed,
250-
InheritEvenIfAlreadyPresent) {
251-
this->SemanticIndexable = SemanticIndexable;
252-
this->SemanticExplicitIndex = false;
253-
}
242+
InheritEvenIfAlreadyPresent) {}
254243

255244
public:
256-
bool isSemanticIndexable() const { return SemanticIndexable; }
257-
258-
void setSemanticIndex(unsigned SemanticIndex) {
259-
this->SemanticIndex = SemanticIndex;
260-
this->SemanticExplicitIndex = true;
261-
}
262-
263-
unsigned getSemanticIndex() const { return SemanticIndex; }
264-
265-
bool isSemanticIndexExplicit() const { return SemanticExplicitIndex; }
266-
267-
void setTargetDecl(Decl *D) { TargetDecl = D; }
268-
Decl *getTargetDecl() const { return TargetDecl; }
269-
270245
// Implement isa/cast/dyncast/etc.
271246
static bool classof(const Attr *A) {
272-
return A->getKind() >= attr::FirstHLSLSemanticAttr &&
273-
A->getKind() <= attr::LastHLSLSemanticAttr;
247+
return A->getKind() >= attr::FirstHLSLSemanticBaseAttr &&
248+
A->getKind() <= attr::LastHLSLSemanticBaseAttr;
274249
}
275250
};
276251

clang/include/clang/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2335,7 +2335,7 @@ class FunctionDecl : public DeclaratorDecl,
23352335
}
23362336

23372337
void setDefaultedOrDeletedInfo(DefaultedOrDeletedFunctionInfo *Info);
2338-
DefaultedOrDeletedFunctionInfo *getDefalutedOrDeletedInfo() const;
2338+
DefaultedOrDeletedFunctionInfo *getDefaultedOrDeletedInfo() const;
23392339

23402340
/// Whether this function is variadic.
23412341
bool isVariadic() const;

clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class FactsGenerator : public ConstStmtVisitor<FactsGenerator> {
4343
void VisitUnaryOperator(const UnaryOperator *UO);
4444
void VisitReturnStmt(const ReturnStmt *RS);
4545
void VisitBinaryOperator(const BinaryOperator *BO);
46+
void VisitConditionalOperator(const ConditionalOperator *CO);
4647
void VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *OCE);
4748
void VisitCXXFunctionalCastExpr(const CXXFunctionalCastExpr *FCE);
4849
void VisitInitListExpr(const InitListExpr *ILE);

clang/include/clang/Basic/Attr.td

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -783,18 +783,6 @@ class DeclOrStmtAttr : InheritableAttr;
783783
/// An attribute class for HLSL Annotations.
784784
class HLSLAnnotationAttr : InheritableAttr;
785785

786-
class HLSLSemanticAttr<bit Indexable> : HLSLAnnotationAttr {
787-
bit SemanticIndexable = Indexable;
788-
int SemanticIndex = 0;
789-
bit SemanticExplicitIndex = 0;
790-
791-
let Spellings = [];
792-
let Subjects = SubjectList<[ParmVar, Field, Function]>;
793-
let LangOpts = [HLSL];
794-
let Args = [DeclArgument<Named, "Target">, IntArgument<"SemanticIndex">,
795-
BoolArgument<"SemanticExplicitIndex">];
796-
}
797-
798786
/// A target-specific attribute. This class is meant to be used as a mixin
799787
/// with InheritableAttr or Attr depending on the attribute's needs.
800788
class TargetSpecificAttr<TargetSpec target> {
@@ -5021,28 +5009,28 @@ def HLSLUnparsedSemantic : HLSLAnnotationAttr {
50215009
let Documentation = [InternalOnly];
50225010
}
50235011

5024-
def HLSLUserSemantic : HLSLSemanticAttr</* Indexable= */ 1> {
5025-
let Documentation = [InternalOnly];
5026-
}
5027-
5028-
def HLSLSV_Position : HLSLSemanticAttr</* Indexable= */ 1> {
5029-
let Documentation = [HLSLSV_PositionDocs];
5030-
}
5012+
class HLSLSemanticBaseAttr : HLSLAnnotationAttr {
5013+
int SemanticIndex = 0;
50315014

5032-
def HLSLSV_GroupThreadID : HLSLSemanticAttr</* Indexable= */ 0> {
5033-
let Documentation = [HLSLSV_GroupThreadIDDocs];
5034-
}
5015+
let Spellings = [];
5016+
let Subjects = SubjectList<[ParmVar, Field, Function]>;
5017+
let LangOpts = [HLSL];
50355018

5036-
def HLSLSV_GroupID : HLSLSemanticAttr</* Indexable= */ 0> {
5037-
let Documentation = [HLSLSV_GroupIDDocs];
5019+
let Args = [StringArgument<"SemanticName">, IntArgument<"SemanticIndex">];
50385020
}
50395021

5040-
def HLSLSV_GroupIndex : HLSLSemanticAttr</* Indexable= */ 0> {
5041-
let Documentation = [HLSLSV_GroupIndexDocs];
5022+
def HLSLParsedSemantic : HLSLSemanticBaseAttr {
5023+
let Spellings = [];
5024+
let Subjects = SubjectList<[ParmVar, Field, Function]>;
5025+
let LangOpts = [HLSL];
5026+
let Documentation = [InternalOnly];
50425027
}
50435028

5044-
def HLSLSV_DispatchThreadID : HLSLSemanticAttr</* Indexable= */ 0> {
5045-
let Documentation = [HLSLSV_DispatchThreadIDDocs];
5029+
def HLSLAppliedSemantic : HLSLSemanticBaseAttr {
5030+
let Spellings = [];
5031+
let Subjects = SubjectList<[ParmVar, Field, Function]>;
5032+
let LangOpts = [HLSL];
5033+
let Documentation = [InternalOnly];
50465034
}
50475035

50485036
def HLSLPackOffset: HLSLAnnotationAttr {

0 commit comments

Comments
 (0)