Skip to content

Commit ae76e7a

Browse files
committed
Merge branch 'main' into hgh/libcxx/P2255R2-A_type_trait_to_detect_reference_binding_to_temporary
2 parents 9342360 + 1a31bb3 commit ae76e7a

File tree

269 files changed

+14431
-4634
lines changed

Some content is hidden

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

269 files changed

+14431
-4634
lines changed

.github/workflows/issue-write.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
- name: 'Comment on PR'
4141
if: steps.download-artifact.outputs.artifact-id != ''
42-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
42+
uses: actions/github-script@ffc2c79a5b2490bd33e0a41c1de74b877714d736 # v3.2.0
4343
with:
4444
github-token: ${{ secrets.GITHUB_TOKEN }}
4545
script: |

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ AST Dumping Potentially Breaking Changes
6262
Clang Frontend Potentially Breaking Changes
6363
-------------------------------------------
6464

65+
- The ``-Wglobal-constructors`` flag now applies to ``[[gnu::constructor]]`` and
66+
``[[gnu::destructor]]`` attributes.
67+
6568
Clang Python Bindings Potentially Breaking Changes
6669
--------------------------------------------------
6770

@@ -222,6 +225,7 @@ Improvements to Clang's diagnostics
222225
under the subgroup ``-Wunsafe-buffer-usage-in-libc-call``.
223226
- Diagnostics on chained comparisons (``a < b < c``) are now an error by default. This can be disabled with
224227
``-Wno-error=parentheses``.
228+
- The ``-Wshift-bool`` warning has been added to warn about shifting a boolean. (#GH28334)
225229

226230
- The :doc:`ThreadSafetyAnalysis` now supports ``-Wthread-safety-pointer``,
227231
which enables warning on passing or returning pointers to guarded variables

clang/include/clang/AST/OpenACCClause.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,26 @@ class OpenACCSeqClause : public OpenACCClause {
162162
return const_child_range(const_child_iterator(), const_child_iterator());
163163
}
164164
};
165+
// Represents the 'nohost' clause.
166+
class OpenACCNoHostClause : public OpenACCClause {
167+
protected:
168+
OpenACCNoHostClause(SourceLocation BeginLoc, SourceLocation EndLoc)
169+
: OpenACCClause(OpenACCClauseKind::NoHost, BeginLoc, EndLoc) {}
170+
171+
public:
172+
static bool classof(const OpenACCClause *C) {
173+
return C->getClauseKind() == OpenACCClauseKind::NoHost;
174+
}
175+
static OpenACCNoHostClause *
176+
Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc);
177+
178+
child_range children() {
179+
return child_range(child_iterator(), child_iterator());
180+
}
181+
const_child_range children() const {
182+
return const_child_range(const_child_iterator(), const_child_iterator());
183+
}
184+
};
165185

166186
/// Represents a clause that has a list of parameters.
167187
class OpenACCClauseWithParams : public OpenACCClause {

clang/include/clang/Basic/Attr.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,8 +2232,8 @@ def RISCVInterrupt : InheritableAttr, TargetSpecificAttr<TargetRISCV> {
22322232
let Spellings = [GCC<"interrupt">];
22332233
let Subjects = SubjectList<[Function]>;
22342234
let Args = [EnumArgument<"Interrupt", "InterruptType", /*is_string=*/true,
2235-
["supervisor", "machine"],
2236-
["supervisor", "machine"],
2235+
["supervisor", "machine", "qci-nest", "qci-nonest"],
2236+
["supervisor", "machine", "qcinest", "qcinonest"],
22372237
1>];
22382238
let ParseKind = "Interrupt";
22392239
let Documentation = [RISCVInterruptDocs];

clang/include/clang/Basic/AttrDocs.td

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2828,8 +2828,17 @@ targets. This attribute may be attached to a function definition and instructs
28282828
the backend to generate appropriate function entry/exit code so that it can be
28292829
used directly as an interrupt service routine.
28302830

2831-
Permissible values for this parameter are ``supervisor`` and ``machine``. If
2832-
there is no parameter, then it defaults to ``machine``.
2831+
Permissible values for this parameter are ``supervisor``, ``machine``,
2832+
``qci-nest`` and ``qci-nonest``. If there is no parameter, then it defaults to
2833+
``machine``.
2834+
2835+
The ``qci-nest`` and ``qci-nonest`` values require Qualcomm's Xqciint extension
2836+
and are used for Machine-mode Interrupts and Machine-mode Non-maskable
2837+
interrupts. These use the following instructions from Xqciint to save and
2838+
restore interrupt state to the stack -- the ``qci-nest`` value will use
2839+
``qc.c.mienter.nest`` and the ``qci-nonest`` value will use ``qc.c.mienter`` to
2840+
begin the interrupt handler. Both of these will use ``qc.c.mileaveret`` to
2841+
restore the state and return to the previous context.
28332842

28342843
Repeated interrupt attribute on the same declaration will cause a warning
28352844
to be emitted. In case of repeated declarations, the last one prevails.
@@ -2839,6 +2848,7 @@ https://gcc.gnu.org/onlinedocs/gcc/RISC-V-Function-Attributes.html
28392848
https://riscv.org/specifications/privileged-isa/
28402849
The RISC-V Instruction Set Manual Volume II: Privileged Architecture
28412850
Version 1.10.
2851+
https://github.com/quic/riscv-unified-db/releases/tag/Xqci-0.6
28422852
}];
28432853
}
28442854

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7132,6 +7132,9 @@ def warn_shift_result_sets_sign_bit : Warning<
71327132
"signed shift result (%0) sets the sign bit of the shift expression's "
71337133
"type (%1) and becomes negative">,
71347134
InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
7135+
def warn_shift_bool : Warning<
7136+
"right shifting a 'bool' implicitly converts it to 'int'">,
7137+
InGroup<DiagGroup<"shift-bool">>, DefaultIgnore;
71357138

71367139
def warn_precedence_bitwise_rel : Warning<
71377140
"%0 has lower precedence than %1; %1 will be evaluated first">,
@@ -12637,8 +12640,9 @@ def err_riscv_builtin_requires_extension : Error<
1263712640
def err_riscv_builtin_invalid_lmul : Error<
1263812641
"LMUL argument must be in the range [0,3] or [5,7]">;
1263912642
def err_riscv_type_requires_extension : Error<
12640-
"RISC-V type %0 requires the '%1' extension"
12641-
>;
12643+
"RISC-V type %0 requires the '%1' extension">;
12644+
def err_riscv_attribute_interrupt_requires_extension : Error<
12645+
"RISC-V interrupt attribute '%0' requires extension '%1'">;
1264212646

1264312647
def err_std_source_location_impl_not_found : Error<
1264412648
"'std::source_location::__impl' was not found; it must be defined before '__builtin_source_location' is called">;

clang/include/clang/Basic/OpenACCClauses.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ VISIT_CLAUSE(IfPresent)
5656
VISIT_CLAUSE(Independent)
5757
VISIT_CLAUSE(Link)
5858
VISIT_CLAUSE(NoCreate)
59+
VISIT_CLAUSE(NoHost)
5960
VISIT_CLAUSE(NumGangs)
6061
VISIT_CLAUSE(NumWorkers)
6162
VISIT_CLAUSE(Present)

clang/include/clang/Sema/SemaOpenACC.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,8 @@ class SemaOpenACC : public SemaBase {
698698
/// parsing has consumed the 'annot_pragma_openacc_end' token. This DOES
699699
/// happen before any associated declarations or statements have been parsed.
700700
/// This function is only called when we are parsing a 'Decl' context.
701-
bool ActOnStartDeclDirective(OpenACCDirectiveKind K, SourceLocation StartLoc);
701+
bool ActOnStartDeclDirective(OpenACCDirectiveKind K, SourceLocation StartLoc,
702+
ArrayRef<const OpenACCClause *> Clauses);
702703
/// Called when we encounter an associated statement for our construct, this
703704
/// should check legality of the statement as it appertains to this Construct.
704705
StmtResult ActOnAssociatedStmt(SourceLocation DirectiveLoc,

clang/lib/AST/DeclPrinter.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,9 +1918,12 @@ void DeclPrinter::VisitNonTypeTemplateParmDecl(
19181918

19191919
void DeclPrinter::VisitOpenACCDeclareDecl(OpenACCDeclareDecl *D) {
19201920
if (!D->isInvalidDecl()) {
1921-
Out << "#pragma acc declare ";
1922-
OpenACCClausePrinter Printer(Out, Policy);
1923-
Printer.VisitClauseList(D->clauses());
1921+
Out << "#pragma acc declare";
1922+
if (!D->clauses().empty()) {
1923+
Out << ' ';
1924+
OpenACCClausePrinter Printer(Out, Policy);
1925+
Printer.VisitClauseList(D->clauses());
1926+
}
19241927
}
19251928
}
19261929
void DeclPrinter::VisitOpenACCRoutineDecl(OpenACCRoutineDecl *D) {
@@ -1941,7 +1944,10 @@ void DeclPrinter::VisitOpenACCRoutineDecl(OpenACCRoutineDecl *D) {
19411944
Out << ")";
19421945
}
19431946

1944-
OpenACCClausePrinter Printer(Out, Policy);
1945-
Printer.VisitClauseList(D->clauses());
1947+
if (!D->clauses().empty()) {
1948+
Out << ' ';
1949+
OpenACCClausePrinter Printer(Out, Policy);
1950+
Printer.VisitClauseList(D->clauses());
1951+
}
19461952
}
19471953
}

clang/lib/AST/OpenACCClause.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,13 @@ OpenACCSeqClause *OpenACCSeqClause::Create(const ASTContext &C,
534534
return new (Mem) OpenACCSeqClause(BeginLoc, EndLoc);
535535
}
536536

537+
OpenACCNoHostClause *OpenACCNoHostClause::Create(const ASTContext &C,
538+
SourceLocation BeginLoc,
539+
SourceLocation EndLoc) {
540+
void *Mem = C.Allocate(sizeof(OpenACCNoHostClause));
541+
return new (Mem) OpenACCNoHostClause(BeginLoc, EndLoc);
542+
}
543+
537544
OpenACCGangClause *
538545
OpenACCGangClause::Create(const ASTContext &C, SourceLocation BeginLoc,
539546
SourceLocation LParenLoc,
@@ -871,6 +878,10 @@ void OpenACCClausePrinter::VisitSeqClause(const OpenACCSeqClause &C) {
871878
OS << "seq";
872879
}
873880

881+
void OpenACCClausePrinter::VisitNoHostClause(const OpenACCNoHostClause &C) {
882+
OS << "nohost";
883+
}
884+
874885
void OpenACCClausePrinter::VisitCollapseClause(const OpenACCCollapseClause &C) {
875886
OS << "collapse(";
876887
if (C.hasForce())

0 commit comments

Comments
 (0)