Skip to content

Commit 3bc2ab8

Browse files
Merge branch 'llvm:main' into gh-101657
2 parents f20fc0f + 1d2f5ea commit 3bc2ab8

File tree

670 files changed

+23200
-16124
lines changed

Some content is hidden

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

670 files changed

+23200
-16124
lines changed

.ci/metrics/metrics.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,13 @@ def github_get_metrics(
282282
queued_count = collections.Counter()
283283
running_count = collections.Counter()
284284

285+
# Initialize all the counters to 0 so we report 0 when no job is queued
286+
# or running.
287+
for wf_name, wf_metric_name in GITHUB_WORKFLOW_TO_TRACK.items():
288+
for job_name, job_metric_name in GITHUB_JOB_TO_TRACK[wf_metric_name].items():
289+
queued_count[wf_metric_name + "_" + job_metric_name] = 0
290+
running_count[wf_metric_name + "_" + job_metric_name] = 0
291+
285292
# The list of workflows this iteration will process.
286293
# MaxSize = GITHUB_WORKFLOWS_MAX_PROCESS_COUNT
287294
workflow_seen_as_completed = set()

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -577,12 +577,12 @@ class MCPlusBuilder {
577577
return getNoRegister();
578578
}
579579

580-
/// Returns the register used as call destination, or no-register, if not
581-
/// an indirect call. Sets IsAuthenticatedInternally if the instruction
582-
/// accepts a signed pointer as its operand and authenticates it internally.
580+
/// Returns the register used as the destination of an indirect branch or call
581+
/// instruction. Sets IsAuthenticatedInternally if the instruction accepts
582+
/// a signed pointer as its operand and authenticates it internally.
583583
virtual MCPhysReg
584-
getRegUsedAsCallDest(const MCInst &Inst,
585-
bool &IsAuthenticatedInternally) const {
584+
getRegUsedAsIndirectBranchDest(const MCInst &Inst,
585+
bool &IsAuthenticatedInternally) const {
586586
llvm_unreachable("not implemented");
587587
return getNoRegister();
588588
}

bolt/lib/Passes/PAuthGadgetScanner.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,14 +498,16 @@ static std::shared_ptr<Report>
498498
shouldReportCallGadget(const BinaryContext &BC, const MCInstReference &Inst,
499499
const State &S) {
500500
static const GadgetKind CallKind("non-protected call found");
501-
if (!BC.MIB->isCall(Inst) && !BC.MIB->isBranch(Inst))
501+
if (!BC.MIB->isIndirectCall(Inst) && !BC.MIB->isIndirectBranch(Inst))
502502
return nullptr;
503503

504504
bool IsAuthenticated = false;
505-
MCPhysReg DestReg = BC.MIB->getRegUsedAsCallDest(Inst, IsAuthenticated);
506-
if (IsAuthenticated || DestReg == BC.MIB->getNoRegister())
505+
MCPhysReg DestReg =
506+
BC.MIB->getRegUsedAsIndirectBranchDest(Inst, IsAuthenticated);
507+
if (IsAuthenticated)
507508
return nullptr;
508509

510+
assert(DestReg != BC.MIB->getNoRegister());
509511
LLVM_DEBUG({
510512
traceInst(BC, "Found call inst", Inst);
511513
traceReg(BC, "Call destination reg", DestReg);

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#include "AArch64InstrInfo.h"
1314
#include "AArch64MCSymbolizer.h"
1415
#include "MCTargetDesc/AArch64AddressingModes.h"
1516
#include "MCTargetDesc/AArch64FixupKinds.h"
@@ -277,15 +278,14 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
277278
}
278279
}
279280

280-
MCPhysReg
281-
getRegUsedAsCallDest(const MCInst &Inst,
282-
bool &IsAuthenticatedInternally) const override {
283-
assert(isCall(Inst) || isBranch(Inst));
284-
IsAuthenticatedInternally = false;
281+
MCPhysReg getRegUsedAsIndirectBranchDest(
282+
const MCInst &Inst, bool &IsAuthenticatedInternally) const override {
283+
assert(isIndirectCall(Inst) || isIndirectBranch(Inst));
285284

286285
switch (Inst.getOpcode()) {
287286
case AArch64::BR:
288287
case AArch64::BLR:
288+
IsAuthenticatedInternally = false;
289289
return Inst.getOperand(0).getReg();
290290
case AArch64::BRAA:
291291
case AArch64::BRAB:
@@ -298,9 +298,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
298298
IsAuthenticatedInternally = true;
299299
return Inst.getOperand(0).getReg();
300300
default:
301-
if (isIndirectCall(Inst) || isIndirectBranch(Inst))
302-
llvm_unreachable("Unhandled indirect branch");
303-
return getNoRegister();
301+
llvm_unreachable("Unhandled indirect branch or call");
304302
}
305303
}
306304

@@ -699,7 +697,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
699697
}
700698

701699
bool isIndirectCall(const MCInst &Inst) const override {
702-
return Inst.getOpcode() == AArch64::BLR;
700+
return isIndirectCallOpcode(Inst.getOpcode());
703701
}
704702

705703
MCPhysReg getSpRegister(int Size) const {

clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output-cast-type.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %check_clang_tidy %s bugprone-unintended-char-ostream-output %t -- \
22
// RUN: -config="{CheckOptions: \
3-
// RUN: {bugprone-unintended-char-ostream-output.CastTypeName: "uint8_t"}}"
3+
// RUN: {bugprone-unintended-char-ostream-output.CastTypeName: \"unsigned char\"}}"
44

55
namespace std {
66

@@ -33,12 +33,12 @@ void origin_ostream(std::ostream &os) {
3333
unsigned char unsigned_value = 9;
3434
os << unsigned_value;
3535
// CHECK-MESSAGES: [[@LINE-1]]:6: warning: 'unsigned char' passed to 'operator<<' outputs as character instead of integer
36-
// CHECK-FIXES: os << static_cast<uint8_t>(unsigned_value);
36+
// CHECK-FIXES: os << static_cast<unsigned char>(unsigned_value);
3737

3838
signed char signed_value = 9;
3939
os << signed_value;
4040
// CHECK-MESSAGES: [[@LINE-1]]:6: warning: 'signed char' passed to 'operator<<' outputs as character instead of integer
41-
// CHECK-FIXES: os << static_cast<uint8_t>(signed_value);
41+
// CHECK-FIXES: os << static_cast<unsigned char>(signed_value);
4242

4343
char char_value = 9;
4444
os << char_value;

clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void based_on_ostream(A &os) {
5757
os << char_value;
5858
}
5959

60-
void based_on_ostream(std::basic_ostream<unsigned char> &os) {
60+
void other_ostream_template_parameters(std::basic_ostream<unsigned char> &os) {
6161
unsigned char unsigned_value = 9;
6262
os << unsigned_value;
6363

clang/docs/ReleaseNotes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ Improvements to Clang's diagnostics
321321

322322
- ``-Wc++98-compat`` no longer diagnoses use of ``__auto_type`` or
323323
``decltype(auto)`` as though it was the extension for ``auto``. (#GH47900)
324+
- Clang now issues a warning for missing return in ``main`` in C89 mode. (#GH21650)
324325

325326
- Now correctly diagnose a tentative definition of an array with static
326327
storage duration in pedantic mode in C. (#GH50661)
@@ -354,6 +355,14 @@ Bug Fixes in This Version
354355
- Defining an integer literal suffix (e.g., ``LL``) before including
355356
``<stdint.h>`` in a freestanding build no longer causes invalid token pasting
356357
when using the ``INTn_C`` macros. (#GH85995)
358+
- Clang no longer accepts invalid integer constants which are too large to fit
359+
into any (standard or extended) integer type when the constant is unevaluated.
360+
Merely forming the token is sufficient to render the program invalid. Code
361+
like this was previously accepted and is now rejected (#GH134658):
362+
.. code-block:: c
363+
364+
#if 1 ? 1 : 999999999999999999999
365+
#endif
357366
358367
Bug Fixes to Compiler Builtins
359368
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/DeclOpenACC.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class OpenACCConstructDecl : public Decl {
5959
}
6060

6161
ArrayRef<const OpenACCClause *> clauses() const { return Clauses; }
62+
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
63+
static bool classofKind(Kind K);
6264
};
6365

6466
class OpenACCDeclareDecl final

clang/include/clang/AST/GlobalDecl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "clang/AST/Attr.h"
1818
#include "clang/AST/DeclCXX.h"
1919
#include "clang/AST/DeclObjC.h"
20+
#include "clang/AST/DeclOpenACC.h"
2021
#include "clang/AST/DeclOpenMP.h"
2122
#include "clang/AST/DeclTemplate.h"
2223
#include "clang/Basic/ABI.h"
@@ -86,6 +87,8 @@ class GlobalDecl {
8687
GlobalDecl(const ObjCMethodDecl *D) { Init(D); }
8788
GlobalDecl(const OMPDeclareReductionDecl *D) { Init(D); }
8889
GlobalDecl(const OMPDeclareMapperDecl *D) { Init(D); }
90+
GlobalDecl(const OpenACCRoutineDecl *D) { Init(D); }
91+
GlobalDecl(const OpenACCDeclareDecl *D) { Init(D); }
8992
GlobalDecl(const CXXConstructorDecl *D, CXXCtorType Type) : Value(D, Type) {}
9093
GlobalDecl(const CXXDestructorDecl *D, CXXDtorType Type) : Value(D, Type) {}
9194
GlobalDecl(const VarDecl *D, DynamicInitKind StubKind)

clang/include/clang/Basic/Attr.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,13 @@ def EmptyBases : InheritableAttr, TargetSpecificAttr<TargetMicrosoftCXXABI> {
17091709
def AllocSize : InheritableAttr {
17101710
let Spellings = [GCC<"alloc_size">];
17111711
let Subjects = SubjectList<[HasFunctionProto]>;
1712+
// The parameter names here are a bit misleading.
1713+
// When used with a single argument, the first argument is obviously the
1714+
// allocation size; but when used with two arguments, the first argument is
1715+
// usually the number of elements, while the second argument is usually the
1716+
// element size - the reverse of how they are named here.
1717+
// The documentation of both GCC and clang does not describe any semantic
1718+
// difference between the first and second argument.
17121719
let Args = [ParamIdxArgument<"ElemSizeParam">,
17131720
ParamIdxArgument<"NumElemsParam", /*opt*/ 1>];
17141721
let TemplateDependent = 1;

0 commit comments

Comments
 (0)