Skip to content

Commit d9ad06b

Browse files
authored
Merge branch 'main' into loop-define-bitconvert
2 parents 6eb413f + 508a6b2 commit d9ad06b

File tree

603 files changed

+18082
-8547
lines changed

Some content is hidden

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

603 files changed

+18082
-8547
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
- name: Install abi-compliance-checker
105105
run: |
106106
sudo apt-get update
107-
sudo apt-get install abi-dumper autoconf pkg-config
107+
sudo apt-get install -y abi-dumper autoconf pkg-config
108108
- name: Install universal-ctags
109109
run: |
110110
git clone https://github.com/universal-ctags/ctags.git
@@ -157,7 +157,7 @@ jobs:
157157
- name: Install abi-compliance-checker
158158
run: |
159159
sudo apt-get update
160-
sudo apt-get install abi-compliance-checker
160+
sudo apt-get install -y abi-compliance-checker
161161
- name: Compare ABI
162162
run: |
163163
for lib in ${{ needs.abi-dump-setup.outputs.ABI_LIBS }}; do

.github/workflows/llvm-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
- name: Install abi-compliance-checker
9393
run: |
9494
sudo apt-get update
95-
sudo apt-get install abi-dumper autoconf pkg-config
95+
sudo apt-get -y install abi-dumper autoconf pkg-config
9696
- name: Install universal-ctags
9797
run: |
9898
git clone https://github.com/universal-ctags/ctags.git
@@ -166,7 +166,7 @@ jobs:
166166
- name: Install abi-compliance-checker
167167
run: |
168168
sudo apt-get update
169-
sudo apt-get install abi-compliance-checker
169+
sudo apt-get -y install abi-compliance-checker
170170
- name: Compare ABI
171171
run: |
172172
if [ -s symbol-list/llvm.symbols ]; then

clang/docs/ReleaseNotes.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,13 @@ Hexagon Support
413413
X86 Support
414414
^^^^^^^^^^^
415415

416-
- Disable ``-m[no-]avx10.1`` and switch ``-m[no-]avx10.2`` to alias of 512 bit
417-
options.
418-
- Change ``-mno-avx10.1-512`` to alias of ``-mno-avx10.1-256`` to disable both
419-
256 and 512 bit instructions.
416+
- The 256-bit maximum vector register size control was removed from
417+
`AVX10 whitepaper <https://cdrdv2.intel.com/v1/dl/getContent/784343>_`.
418+
* Re-target ``m[no-]avx10.1`` to enable AVX10.1 with 512-bit maximum vector register size.
419+
* Emit warning for ``mavx10.x-256``, noting AVX10/256 is not supported.
420+
* Emit warning for ``mavx10.x-512``, noting to use ``m[no-]avx10.x`` instead.
421+
* Emit warning for ``m[no-]evex512``, noting AVX10/256 is not supported.
422+
* The features avx10.x-256/512 keep unchanged and will be removed in the next release.
420423

421424
Arm and AArch64 Support
422425
^^^^^^^^^^^^^^^^^^^^^^^
@@ -434,6 +437,7 @@ Windows Support
434437
- Clang now can process the `i128` and `ui128` integeral suffixes when MSVC
435438
extensions are enabled. This allows for properly processing ``intsafe.h`` in
436439
the Windows SDK.
440+
- Clang now supports MSVC vector deleting destructors (GH19772).
437441

438442
LoongArch Support
439443
^^^^^^^^^^^^^^^^^

clang/include/clang/AST/VTableBuilder.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class VTableComponent {
150150

151151
bool isRTTIKind() const { return isRTTIKind(getKind()); }
152152

153-
GlobalDecl getGlobalDecl() const {
153+
GlobalDecl getGlobalDecl(bool HasVectorDeletingDtors) const {
154154
assert(isUsedFunctionPointerKind() &&
155155
"GlobalDecl can be created only from virtual function");
156156

@@ -161,7 +161,9 @@ class VTableComponent {
161161
case CK_CompleteDtorPointer:
162162
return GlobalDecl(DtorDecl, CXXDtorType::Dtor_Complete);
163163
case CK_DeletingDtorPointer:
164-
return GlobalDecl(DtorDecl, CXXDtorType::Dtor_Deleting);
164+
return GlobalDecl(DtorDecl, (HasVectorDeletingDtors)
165+
? CXXDtorType::Dtor_VectorDeleting
166+
: CXXDtorType::Dtor_Deleting);
165167
case CK_VCallOffset:
166168
case CK_VBaseOffset:
167169
case CK_OffsetToTop:

clang/include/clang/Basic/ABI.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ enum CXXCtorType {
3131

3232
/// C++ destructor types.
3333
enum CXXDtorType {
34-
Dtor_Deleting, ///< Deleting dtor
35-
Dtor_Complete, ///< Complete object dtor
36-
Dtor_Base, ///< Base object dtor
37-
Dtor_Comdat ///< The COMDAT used for dtors
34+
Dtor_Deleting, ///< Deleting dtor
35+
Dtor_Complete, ///< Complete object dtor
36+
Dtor_Base, ///< Base object dtor
37+
Dtor_Comdat, ///< The COMDAT used for dtors
38+
Dtor_VectorDeleting ///< Vector deleting dtor
3839
};
3940

4041
} // end namespace clang

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,13 +377,12 @@ def CXX11WarnSuggestOverride : DiagGroup<"suggest-override">;
377377
def WarnUnnecessaryVirtualSpecifier : DiagGroup<"unnecessary-virtual-specifier"> {
378378
code Documentation = [{
379379
Warns when a ``final`` class contains a virtual method (including virtual
380-
destructors). Since ``final`` classes cannot be subclassed, their methods
381-
cannot be overridden, and hence the ``virtual`` specifier is useless.
380+
destructors) that does not override anything. Since ``final`` classes cannot be
381+
subclassed, their methods cannot be overridden, so there is no point to
382+
introducing new ``virtual`` methods.
382383

383384
The warning also detects virtual methods in classes whose destructor is
384385
``final``, for the same reason.
385-
386-
The warning does not fire on virtual methods which are also marked ``override``.
387386
}];
388387
}
389388

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2733,7 +2733,7 @@ def note_final_dtor_non_final_class_silence : Note<
27332733
"mark %0 as '%select{final|sealed}1' to silence this warning">;
27342734
def warn_unnecessary_virtual_specifier : Warning<
27352735
"virtual method %0 is inside a 'final' class and can never be overridden">,
2736-
InGroup<WarnUnnecessaryVirtualSpecifier>, DefaultIgnore;
2736+
InGroup<WarnUnnecessaryVirtualSpecifier>;
27372737

27382738
// C++11 attributes
27392739
def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
@@ -7031,10 +7031,10 @@ def err_offsetof_incomplete_type : Error<
70317031
def err_offsetof_record_type : Error<
70327032
"offsetof requires struct, union, or class type, %0 invalid">;
70337033
def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
7034-
def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
7034+
def ext_offsetof_non_pod_type : ExtWarn<"'offsetof' on non-POD type %0">,
70357035
InGroup<InvalidOffsetof>;
70367036
def ext_offsetof_non_standardlayout_type : ExtWarn<
7037-
"offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
7037+
"'offsetof' on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
70387038
def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
70397039
def err_offsetof_field_of_virtual_base : Error<
70407040
"invalid application of 'offsetof' to a field of a virtual base">;

clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,30 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
6767
return create<cir::ConstantOp>(loc, attr.getType(), attr);
6868
}
6969

70+
mlir::TypedAttr getConstNullPtrAttr(mlir::Type t) {
71+
assert(mlir::isa<cir::PointerType>(t) && "expected cir.ptr");
72+
return getConstPtrAttr(t, 0);
73+
}
74+
75+
mlir::TypedAttr getZeroAttr(mlir::Type t) {
76+
return cir::ZeroAttr::get(getContext(), t);
77+
}
78+
79+
mlir::TypedAttr getZeroInitAttr(mlir::Type ty) {
80+
if (mlir::isa<cir::IntType>(ty))
81+
return cir::IntAttr::get(ty, 0);
82+
if (cir::isAnyFloatingPointType(ty))
83+
return cir::FPAttr::getZero(ty);
84+
if (auto arrTy = mlir::dyn_cast<cir::ArrayType>(ty))
85+
return getZeroAttr(arrTy);
86+
if (auto ptrTy = mlir::dyn_cast<cir::PointerType>(ty))
87+
return getConstNullPtrAttr(ptrTy);
88+
if (mlir::isa<cir::BoolType>(ty)) {
89+
return getCIRBoolAttr(false);
90+
}
91+
llvm_unreachable("Zero initializer for given type is NYI");
92+
}
93+
7094
cir::ConstantOp getBool(bool state, mlir::Location loc) {
7195
return create<cir::ConstantOp>(loc, getBoolTy(), getCIRBoolAttr(state));
7296
}

clang/include/clang/Driver/Options.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6409,11 +6409,11 @@ def mavx10_1_256 : Flag<["-"], "mavx10.1-256">, Group<m_x86_AVX10_Features_Group
64096409
def mno_avx10_1_256 : Flag<["-"], "mno-avx10.1-256">, Group<m_x86_AVX10_Features_Group>;
64106410
def mavx10_1_512 : Flag<["-"], "mavx10.1-512">, Group<m_x86_AVX10_Features_Group>;
64116411
def mno_avx10_1_512 : Flag<["-"], "mno-avx10.1-512">, Alias<mno_avx10_1_256>;
6412-
def mavx10_1 : Flag<["-"], "mavx10.1">, Flags<[Unsupported]>;
6413-
def mno_avx10_1 : Flag<["-"], "mno-avx10.1">, Flags<[Unsupported]>;
6412+
def mavx10_1 : Flag<["-"], "mavx10.1">, Group<m_x86_AVX10_Features_Group>;
6413+
def mno_avx10_1 : Flag<["-"], "mno-avx10.1">, Group<m_x86_AVX10_Features_Group>;
64146414
def mavx10_2_256 : Flag<["-"], "mavx10.2-256">, Group<m_x86_AVX10_Features_Group>;
64156415
def mavx10_2_512 : Flag<["-"], "mavx10.2-512">, Group<m_x86_AVX10_Features_Group>;
6416-
def mavx10_2 : Flag<["-"], "mavx10.2">, Alias<mavx10_2_512>;
6416+
def mavx10_2 : Flag<["-"], "mavx10.2">, Group<m_x86_AVX10_Features_Group>;
64176417
def mno_avx10_2 : Flag<["-"], "mno-avx10.2">, Group<m_x86_AVX10_Features_Group>;
64186418
def mavx2 : Flag<["-"], "mavx2">, Group<m_x86_Features_Group>;
64196419
def mno_avx2 : Flag<["-"], "mno-avx2">, Group<m_x86_Features_Group>;

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,17 @@ void cleanupAfterFunctionCall(InterpState &S, CodePtr OpPC,
302302
TYPE_SWITCH(Ty, S.Stk.discard<T>());
303303
}
304304

305+
// FIXME: Instead of using this fairly expensive test, we should
306+
// just mark constexpr-unknown values when creating them.
307+
bool isConstexprUnknown(const Pointer &P) {
308+
if (!P.isBlockPointer())
309+
return false;
310+
if (P.isDummy())
311+
return false;
312+
const VarDecl *VD = P.block()->getDescriptor()->asVarDecl();
313+
return VD && VD->hasLocalStorage();
314+
}
315+
305316
bool CheckBCPResult(InterpState &S, const Pointer &Ptr) {
306317
if (Ptr.isDummy())
307318
return false;
@@ -607,11 +618,8 @@ bool CheckMutable(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
607618
// variables in Compiler.cpp:visitDeclRef. Revisiting a so far
608619
// unknown variable will get the same EvalID and we end up allowing
609620
// reads from mutable members of it.
610-
if (!S.inConstantContext()) {
611-
if (const VarDecl *VD = Ptr.block()->getDescriptor()->asVarDecl();
612-
VD && VD->hasLocalStorage())
613-
return false;
614-
}
621+
if (!S.inConstantContext() && isConstexprUnknown(Ptr))
622+
return false;
615623
return true;
616624
}
617625

0 commit comments

Comments
 (0)