Skip to content

Commit 1434e11

Browse files
committed
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.4 [skip ci]
2 parents 49341e9 + 8c917f3 commit 1434e11

File tree

162 files changed

+5461
-3573
lines changed

Some content is hidden

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

162 files changed

+5461
-3573
lines changed

clang-tools-extra/docs/clang-tidy/checks/bugprone/implicit-widening-of-multiplication-result.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@ Options
3737
.. option:: UseCXXStaticCastsInCppSources
3838

3939
When suggesting fix-its for C++ code, should C++-style ``static_cast<>()``'s
40-
be suggested, or C-style casts. Defaults to ``true``.
40+
be suggested, or C-style casts. Defaults to `true`.
4141

4242
.. option:: UseCXXHeadersInCppSources
4343

4444
When suggesting to include the appropriate header in C++ code,
4545
should ``<cstddef>`` header be suggested, or ``<stddef.h>``.
46-
Defaults to ``true``.
46+
Defaults to `true`.
4747

4848
.. option:: IgnoreConstantIntExpr
4949

5050
If the multiplication operands are compile-time constants (like literals or
5151
are ``constexpr``) and fit within the source expression type, do not emit a
5252
diagnostic or suggested fix. Only considers expressions where the source
53-
expression is a signed integer type. Defaults to ``false``.
53+
expression is a signed integer type. Defaults to `false`.
5454

5555
Examples:
5656

clang-tools-extra/docs/clang-tidy/checks/cert/err33-c.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ This check is an alias of check :doc:`bugprone-unused-return-value <../bugprone/
190190
with a fixed set of functions.
191191

192192
Suppressing issues by casting to ``void`` is enabled by default and can be
193-
disabled by setting `AllowCastToVoid` option to ``false``.
193+
disabled by setting `AllowCastToVoid` option to `false`.
194194

195195
The check corresponds to a part of CERT C Coding Standard rule `ERR33-C.
196196
Detect and handle standard library errors

clang-tools-extra/docs/clang-tidy/checks/modernize/loop-convert.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ lives.
144144

145145
When set to true convert loops when in C++20 or later mode using
146146
``std::ranges::reverse_view``.
147-
Default value is ``true``.
147+
Default value is `true`.
148148

149149
.. option:: MakeReverseRangeFunction
150150

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4786,17 +4786,20 @@ the configuration (without a prefix: ``Auto``).
47864786

47874787
.. note::
47884788

4789-
You can also specify the language (``Cpp`` or ``ObjC``) for ``.h`` files
4790-
by adding a ``// clang-format Language:`` line before the first
4789+
You can specify the language (``C``, ``Cpp``, or ``ObjC``) for ``.h``
4790+
files by adding a ``// clang-format Language:`` line before the first
47914791
non-comment (and non-empty) line, e.g. ``// clang-format Language: Cpp``.
47924792

47934793
Possible values:
47944794

47954795
* ``LK_None`` (in configuration: ``None``)
47964796
Do not use.
47974797

4798+
* ``LK_C`` (in configuration: ``C``)
4799+
Should be used for C.
4800+
47984801
* ``LK_Cpp`` (in configuration: ``Cpp``)
4799-
Should be used for C, C++.
4802+
Should be used for C++.
48004803

48014804
* ``LK_CSharp`` (in configuration: ``CSharp``)
48024805
Should be used for C#.

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,10 @@ clang-format
271271
- Adds ``BreakBeforeTemplateCloser`` option.
272272
- Adds ``BinPackLongBracedList`` option to override bin packing options in
273273
long (20 item or more) braced list initializer lists.
274-
- Allow specifying the language (C++ or Objective-C) for a ``.h`` file by adding
275-
a special comment (e.g. ``// clang-format Language: ObjC``) near the top of
276-
the file.
274+
- Add the C language instead of treating it like C++.
275+
- Allow specifying the language (C, C++, or Objective-C) for a ``.h`` file by
276+
adding a special comment (e.g. ``// clang-format Language: ObjC``) near the
277+
top of the file.
277278

278279
libclang
279280
--------

clang/include/clang/Basic/BuiltinsSPIRV.td

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,3 @@ def SPIRVLength : Builtin {
1919
let Attributes = [NoThrow, Const];
2020
let Prototype = "void(...)";
2121
}
22-
23-
def SPIRVReflect : Builtin {
24-
let Spellings = ["__builtin_spirv_reflect"];
25-
let Attributes = [NoThrow, Const];
26-
let Prototype = "void(...)";
27-
}

clang/include/clang/Format/Format.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3318,7 +3318,9 @@ struct FormatStyle {
33183318
enum LanguageKind : int8_t {
33193319
/// Do not use.
33203320
LK_None,
3321-
/// Should be used for C, C++.
3321+
/// Should be used for C.
3322+
LK_C,
3323+
/// Should be used for C++.
33223324
LK_Cpp,
33233325
/// Should be used for C#.
33243326
LK_CSharp,
@@ -3343,7 +3345,9 @@ struct FormatStyle {
33433345
/// https://sci-hub.st/10.1109/IEEESTD.2018.8299595
33443346
LK_Verilog
33453347
};
3346-
bool isCpp() const { return Language == LK_Cpp || Language == LK_ObjC; }
3348+
bool isCpp() const {
3349+
return Language == LK_Cpp || Language == LK_C || Language == LK_ObjC;
3350+
}
33473351
bool isCSharp() const { return Language == LK_CSharp; }
33483352
bool isJson() const { return Language == LK_Json; }
33493353
bool isJavaScript() const { return Language == LK_JavaScript; }
@@ -3355,8 +3359,8 @@ struct FormatStyle {
33553359

33563360
/// The language that this format style targets.
33573361
/// \note
3358-
/// You can also specify the language (``Cpp`` or ``ObjC``) for ``.h`` files
3359-
/// by adding a ``// clang-format Language:`` line before the first
3362+
/// You can specify the language (``C``, ``Cpp``, or ``ObjC``) for ``.h``
3363+
/// files by adding a ``// clang-format Language:`` line before the first
33603364
/// non-comment (and non-empty) line, e.g. ``// clang-format Language: Cpp``.
33613365
/// \endnote
33623366
/// \version 3.5
@@ -5715,6 +5719,8 @@ FormatStyle::LanguageKind guessLanguage(StringRef FileName, StringRef Code);
57155719
// Returns a string representation of ``Language``.
57165720
inline StringRef getLanguageName(FormatStyle::LanguageKind Language) {
57175721
switch (Language) {
5722+
case FormatStyle::LK_C:
5723+
return "C";
57185724
case FormatStyle::LK_Cpp:
57195725
return "C++";
57205726
case FormatStyle::LK_CSharp:

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,11 +1015,14 @@ static bool RunDestructors(InterpState &S, CodePtr OpPC, const Block *B) {
10151015
assert(Desc->isRecord() || Desc->isCompositeArray());
10161016

10171017
if (Desc->isCompositeArray()) {
1018+
unsigned N = Desc->getNumElems();
1019+
if (N == 0)
1020+
return true;
10181021
const Descriptor *ElemDesc = Desc->ElemDesc;
10191022
assert(ElemDesc->isRecord());
10201023

10211024
Pointer RP(const_cast<Block *>(B));
1022-
for (unsigned I = 0; I != Desc->getNumElems(); ++I) {
1025+
for (int I = static_cast<int>(N) - 1; I >= 0; --I) {
10231026
if (!runRecordDestructor(S, OpPC, RP.atIndex(I).narrow(), ElemDesc))
10241027
return false;
10251028
}
@@ -1379,6 +1382,18 @@ bool CallVirt(InterpState &S, CodePtr OpPC, const Function *Func,
13791382
size_t ArgSize = Func->getArgSize() + VarArgSize;
13801383
size_t ThisOffset = ArgSize - (Func->hasRVO() ? primSize(PT_Ptr) : 0);
13811384
Pointer &ThisPtr = S.Stk.peek<Pointer>(ThisOffset);
1385+
const FunctionDecl *Callee = Func->getDecl();
1386+
1387+
// C++2a [class.abstract]p6:
1388+
// the effect of making a virtual call to a pure virtual function [...] is
1389+
// undefined
1390+
if (Callee->isPureVirtual()) {
1391+
S.FFDiag(S.Current->getSource(OpPC), diag::note_constexpr_pure_virtual_call,
1392+
1)
1393+
<< Callee;
1394+
S.Note(Callee->getLocation(), diag::note_declared_at);
1395+
return false;
1396+
}
13821397

13831398
const CXXRecordDecl *DynamicDecl = nullptr;
13841399
{
@@ -1395,7 +1410,7 @@ bool CallVirt(InterpState &S, CodePtr OpPC, const Function *Func,
13951410
assert(DynamicDecl);
13961411

13971412
const auto *StaticDecl = cast<CXXRecordDecl>(Func->getParentDecl());
1398-
const auto *InitialFunction = cast<CXXMethodDecl>(Func->getDecl());
1413+
const auto *InitialFunction = cast<CXXMethodDecl>(Callee);
13991414
const CXXMethodDecl *Overrider = S.getContext().getOverridingFunction(
14001415
DynamicDecl, StaticDecl, InitialFunction);
14011416

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20829,19 +20829,6 @@ Value *CodeGenFunction::EmitSPIRVBuiltinExpr(unsigned BuiltinID,
2082920829
/*ReturnType=*/X->getType()->getScalarType(), Intrinsic::spv_length,
2083020830
ArrayRef<Value *>{X}, nullptr, "spv.length");
2083120831
}
20832-
case SPIRV::BI__builtin_spirv_reflect: {
20833-
Value *I = EmitScalarExpr(E->getArg(0));
20834-
Value *N = EmitScalarExpr(E->getArg(1));
20835-
assert(E->getArg(0)->getType()->hasFloatingRepresentation() &&
20836-
E->getArg(1)->getType()->hasFloatingRepresentation() &&
20837-
"Reflect operands must have a float representation");
20838-
assert(E->getArg(0)->getType()->isVectorType() &&
20839-
E->getArg(1)->getType()->isVectorType() &&
20840-
"Reflect operands must be a vector");
20841-
return Builder.CreateIntrinsic(
20842-
/*ReturnType=*/I->getType(), Intrinsic::spv_reflect,
20843-
ArrayRef<Value *>{I, N}, nullptr, "spv.reflect");
20844-
}
2084520832
}
2084620833
return nullptr;
2084720834
}

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -862,13 +862,15 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
862862
const llvm::Triple &Triple = ToolChain.getTriple();
863863
const bool IsOSAIX = Triple.isOSAIX();
864864
const bool IsAMDGCN = Triple.isAMDGCN();
865-
const char *Linker = Args.MakeArgString(ToolChain.GetLinkerPath());
865+
StringRef Linker = Args.getLastArgValue(options::OPT_fuse_ld_EQ);
866+
const char *LinkerPath = Args.MakeArgString(ToolChain.GetLinkerPath());
866867
const Driver &D = ToolChain.getDriver();
867868
const bool IsFatLTO = Args.hasFlag(options::OPT_ffat_lto_objects,
868869
options::OPT_fno_fat_lto_objects, false);
869870
const bool IsUnifiedLTO = Args.hasArg(options::OPT_funified_lto);
870-
if (llvm::sys::path::filename(Linker) != "ld.lld" &&
871-
llvm::sys::path::stem(Linker) != "ld.lld" && !Triple.isOSOpenBSD()) {
871+
if (Linker != "lld" && Linker != "lld-link" &&
872+
llvm::sys::path::filename(LinkerPath) != "ld.lld" &&
873+
llvm::sys::path::stem(LinkerPath) != "ld.lld" && !Triple.isOSOpenBSD()) {
872874
// Tell the linker to load the plugin. This has to come before
873875
// AddLinkerInputs as gold requires -plugin and AIX ld requires -bplugin to
874876
// come before any -plugin-opt/-bplugin_opt that -Wl might forward.

0 commit comments

Comments
 (0)