Skip to content

Commit 78b5345

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:fc3ec135d34c into amd-gfx:5821ef850156
Local branch amd-gfx 5821ef8 Emit S_CBRANCH_SCC for uniform floating-point conditions. (llvm#252) Remote branch main fc3ec13 [RISCV][GISel] Remove unused function leftover from a removed SDNodeXForm. NFC
2 parents 5821ef8 + fc3ec13 commit 78b5345

File tree

248 files changed

+9542
-2718
lines changed

Some content is hidden

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

248 files changed

+9542
-2718
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ Attribute Changes in Clang
113113
Improvements to Clang's diagnostics
114114
-----------------------------------
115115

116+
- Improve the diagnostics for deleted default constructor errors for C++ class
117+
initializer lists that don't explicitly list a class member and thus attempt
118+
to implicitly default construct that member.
119+
116120
Improvements to Clang's time-trace
117121
----------------------------------
118122

@@ -219,10 +223,6 @@ Code Completion
219223
Static Analyzer
220224
---------------
221225

222-
- Clang currently support extending lifetime of object bound to
223-
reference members of aggregates in CFG and ExprEngine, that are
224-
created from default member initializer.
225-
226226
New features
227227
^^^^^^^^^^^^
228228

clang/include/clang-c/Index.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2206,7 +2206,11 @@ enum CXCursorKind {
22062206
*/
22072207
CXCursor_OpenACCUpdateConstruct = 331,
22082208

2209-
CXCursor_LastStmt = CXCursor_OpenACCUpdateConstruct,
2209+
/** OpenACC atomic Construct.
2210+
*/
2211+
CXCursor_OpenACCAtomicConstruct = 332,
2212+
2213+
CXCursor_LastStmt = CXCursor_OpenACCAtomicConstruct,
22102214

22112215
/**
22122216
* Cursor that represents the translation unit itself.

clang/include/clang/AST/DeclBase.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,8 +1257,11 @@ class alignas(8) Decl {
12571257
int64_t getID() const;
12581258

12591259
/// Looks through the Decl's underlying type to extract a FunctionType
1260-
/// when possible. Will return null if the type underlying the Decl does not
1261-
/// have a FunctionType.
1260+
/// when possible. This includes direct FunctionDecls, along with various
1261+
/// function types and typedefs. This includes function pointers/references,
1262+
/// member function pointers, and optionally if \p BlocksToo is set
1263+
/// Objective-C block pointers. Returns nullptr if the type underlying the
1264+
/// Decl does not have a FunctionType.
12621265
const FunctionType *getFunctionType(bool BlocksToo = true) const;
12631266

12641267
// Looks through the Decl's underlying type to determine if it's a

clang/include/clang/AST/RecursiveASTVisitor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4099,6 +4099,8 @@ DEF_TRAVERSE_STMT(OpenACCSetConstruct,
40994099
{ TRY_TO(VisitOpenACCClauseList(S->clauses())); })
41004100
DEF_TRAVERSE_STMT(OpenACCUpdateConstruct,
41014101
{ TRY_TO(VisitOpenACCClauseList(S->clauses())); })
4102+
DEF_TRAVERSE_STMT(OpenACCAtomicConstruct,
4103+
{ TRY_TO(TraverseOpenACCAssociatedStmtConstruct(S)); })
41024104

41034105
// Traverse HLSL: Out argument expression
41044106
DEF_TRAVERSE_STMT(HLSLOutArgExpr, {})

clang/include/clang/AST/StmtOpenACC.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,5 +751,50 @@ class OpenACCUpdateConstruct final
751751
Create(const ASTContext &C, SourceLocation Start, SourceLocation DirectiveLoc,
752752
SourceLocation End, ArrayRef<const OpenACCClause *> Clauses);
753753
};
754+
755+
// This class represents the 'atomic' construct, which has an associated
756+
// statement, but no clauses.
757+
class OpenACCAtomicConstruct final : public OpenACCAssociatedStmtConstruct {
758+
759+
friend class ASTStmtReader;
760+
OpenACCAtomicKind AtomicKind = OpenACCAtomicKind::None;
761+
762+
OpenACCAtomicConstruct(EmptyShell)
763+
: OpenACCAssociatedStmtConstruct(
764+
OpenACCAtomicConstructClass, OpenACCDirectiveKind::Atomic,
765+
SourceLocation{}, SourceLocation{}, SourceLocation{},
766+
/*AssociatedStmt=*/nullptr) {}
767+
768+
OpenACCAtomicConstruct(SourceLocation Start, SourceLocation DirectiveLoc,
769+
OpenACCAtomicKind AtKind, SourceLocation End,
770+
Stmt *AssociatedStmt)
771+
: OpenACCAssociatedStmtConstruct(OpenACCAtomicConstructClass,
772+
OpenACCDirectiveKind::Atomic, Start,
773+
DirectiveLoc, End, AssociatedStmt),
774+
AtomicKind(AtKind) {}
775+
776+
void setAssociatedStmt(Stmt *S) {
777+
OpenACCAssociatedStmtConstruct::setAssociatedStmt(S);
778+
}
779+
780+
public:
781+
static bool classof(const Stmt *T) {
782+
return T->getStmtClass() == OpenACCAtomicConstructClass;
783+
}
784+
785+
static OpenACCAtomicConstruct *CreateEmpty(const ASTContext &C);
786+
static OpenACCAtomicConstruct *
787+
Create(const ASTContext &C, SourceLocation Start, SourceLocation DirectiveLoc,
788+
OpenACCAtomicKind AtKind, SourceLocation End, Stmt *AssociatedStmt);
789+
790+
OpenACCAtomicKind getAtomicKind() const { return AtomicKind; }
791+
const Stmt *getAssociatedStmt() const {
792+
return OpenACCAssociatedStmtConstruct::getAssociatedStmt();
793+
}
794+
Stmt *getAssociatedStmt() {
795+
return OpenACCAssociatedStmtConstruct::getAssociatedStmt();
796+
}
797+
};
798+
754799
} // namespace clang
755800
#endif // LLVM_CLANG_AST_STMTOPENACC_H

clang/include/clang/AST/TextNodeDumper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ class TextNodeDumper
420420
void VisitOpenACCSetConstruct(const OpenACCSetConstruct *S);
421421
void VisitOpenACCShutdownConstruct(const OpenACCShutdownConstruct *S);
422422
void VisitOpenACCUpdateConstruct(const OpenACCUpdateConstruct *S);
423+
void VisitOpenACCAtomicConstruct(const OpenACCAtomicConstruct *S);
423424
void VisitOpenACCAsteriskSizeExpr(const OpenACCAsteriskSizeExpr *S);
424425
void VisitEmbedExpr(const EmbedExpr *S);
425426
void VisitAtomicExpr(const AtomicExpr *AE);

clang/include/clang/Basic/Attr.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def OpenCLKernelFunction
198198
// inclusive nature of subject testing).
199199
def HasFunctionProto : SubsetSubject<DeclBase,
200200
[{(S->getFunctionType(true) != nullptr &&
201-
isa<FunctionProtoType>(S->getFunctionType())) ||
201+
isa<FunctionProtoType>(S->getFunctionType())) ||
202202
isa<ObjCMethodDecl>(S) ||
203203
isa<BlockDecl>(S)}],
204204
"non-K&R-style functions">;

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6113,6 +6113,8 @@ def note_deleted_special_member_class_subobject : Note<
61136113
"destructor}5"
61146114
"%select{||s||}4"
61156115
"|is an ObjC pointer}6">;
6116+
def note_default_constructed_field
6117+
: Note<"default constructed field %0 declared here">;
61166118
def note_deleted_default_ctor_uninit_field : Note<
61176119
"%select{default constructor of|constructor inherited by}0 "
61186120
"%1 is implicitly deleted because field %2 of "
@@ -12903,6 +12905,48 @@ def err_acc_update_as_body
1290312905
: Error<"OpenACC 'update' construct may not appear in place of the "
1290412906
"statement following a%select{n if statement| while statement| do "
1290512907
"statement| switch statement| label statement}0">;
12908+
def err_acc_invalid_atomic
12909+
: Error<"statement associated with OpenACC 'atomic%select{| "
12910+
"%1}0' directive is invalid">;
12911+
def note_acc_atomic_expr_must_be
12912+
: Note<"expected "
12913+
"%enum_select<OACCAtomicExpr>{%Assign{assignment}|%UnaryCompAssign{"
12914+
"assignment, compound assignment, increment, or decrement}}0 "
12915+
"expression">;
12916+
def note_acc_atomic_unsupported_unary_operator
12917+
: Note<"unary operator not supported, only increment and decrement "
12918+
"operations permitted">;
12919+
def note_acc_atomic_unsupported_binary_operator
12920+
: Note<"binary operator not supported, only +, *, -, /, &, ^, |, <<, or >> "
12921+
"are permitted">;
12922+
def note_acc_atomic_unsupported_compound_binary_operator
12923+
: Note<"compound binary operator not supported, only +=, *=, -=, /=, &=, "
12924+
"^=, |=, <<=, or >>= are permitted">;
12925+
12926+
def note_acc_atomic_operand_lvalue_scalar
12927+
: Note<"%select{left |right |}0operand to "
12928+
"%enum_select<OACCAtomicOpKind>{%Assign{assignment}|%CompoundAssign{"
12929+
"compound assignment}|%Inc{increment}|"
12930+
"%Dec{decrement}}1 "
12931+
"expression must be "
12932+
"%enum_select<OACCLValScalar>{%LVal{an l-value}|%Scalar{of scalar "
12933+
"type (was %3)}}2">;
12934+
def note_acc_atomic_too_many_stmts
12935+
: Note<"'atomic capture' with a compound statement only supports two "
12936+
"statements">;
12937+
def note_acc_atomic_expected_binop : Note<"expected binary operation on right "
12938+
"hand side of assignment operator">;
12939+
def note_acc_atomic_mismatch_operand
12940+
: Note<"left hand side of assignment operation('%0') must match one side "
12941+
"of the sub-operation on the right hand side('%1' and '%2')">;
12942+
def note_acc_atomic_mismatch_compound_operand
12943+
: Note<"variable %select{|in unary expression|on right hand side of "
12944+
"assignment|on left hand side of assignment|on left hand side of "
12945+
"compound assignment|on left hand side of assignment}2('%3') must "
12946+
"match variable used %select{|in unary expression|on right hand "
12947+
"side of assignment|<not possible>|on left hand side of compound "
12948+
"assignment|on left hand side of assignment}0('%1') from the first "
12949+
"statement">;
1290612950

1290712951
// AMDGCN builtins diagnostics
1290812952
def err_amdgcn_global_load_lds_size_invalid_value : Error<"invalid size value">;

clang/include/clang/Basic/OpenACCKinds.h

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,33 @@ enum class OpenACCAtomicKind : uint8_t {
171171
Write,
172172
Update,
173173
Capture,
174-
Invalid,
174+
None,
175175
};
176176

177+
template <typename StreamTy>
178+
inline StreamTy &printOpenACCAtomicKind(StreamTy &Out, OpenACCAtomicKind AK) {
179+
switch (AK) {
180+
case OpenACCAtomicKind::Read:
181+
return Out << "read";
182+
case OpenACCAtomicKind::Write:
183+
return Out << "write";
184+
case OpenACCAtomicKind::Update:
185+
return Out << "update";
186+
case OpenACCAtomicKind::Capture:
187+
return Out << "capture";
188+
case OpenACCAtomicKind::None:
189+
return Out << "<none>";
190+
}
191+
}
192+
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &Out,
193+
OpenACCAtomicKind AK) {
194+
return printOpenACCAtomicKind(Out, AK);
195+
}
196+
inline llvm::raw_ostream &operator<<(llvm::raw_ostream &Out,
197+
OpenACCAtomicKind AK) {
198+
return printOpenACCAtomicKind(Out, AK);
199+
}
200+
177201
/// Represents the kind of an OpenACC clause.
178202
enum class OpenACCClauseKind : uint8_t {
179203
/// 'finalize' clause, allowed on 'exit data' directive.

clang/include/clang/Basic/StmtNodes.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ def OpenACCInitConstruct : StmtNode<OpenACCConstructStmt>;
319319
def OpenACCShutdownConstruct : StmtNode<OpenACCConstructStmt>;
320320
def OpenACCSetConstruct : StmtNode<OpenACCConstructStmt>;
321321
def OpenACCUpdateConstruct : StmtNode<OpenACCConstructStmt>;
322+
def OpenACCAtomicConstruct : StmtNode<OpenACCAssociatedStmtConstruct>;
322323

323324
// OpenACC Additional Expressions.
324325
def OpenACCAsteriskSizeExpr : StmtNode<Expr>;

0 commit comments

Comments
 (0)