Skip to content

Commit 8c779b7

Browse files
committed
Merge from 'master' to 'sycl-web' (#2)
CONFLICT (content): Merge conflict in clang/lib/Sema/Sema.cpp
2 parents 7517d36 + 1b978dd commit 8c779b7

File tree

434 files changed

+22086
-6453
lines changed

Some content is hidden

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

434 files changed

+22086
-6453
lines changed

clang-tools-extra/clang-tidy/openmp/UseDefaultNoneCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void UseDefaultNoneCheck::check(const MatchFinder::MatchResult &Result) {
4848
"'default(none)' clause instead")
4949
<< getOpenMPDirectiveName(Directive->getDirectiveKind())
5050
<< getOpenMPSimpleClauseTypeName(Clause->getClauseKind(),
51-
Clause->getDefaultKind());
51+
unsigned(Clause->getDefaultKind()));
5252
diag(Clause->getBeginLoc(), "existing 'default' clause specified here",
5353
DiagnosticIDs::Note);
5454
return;

clang/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ add_subdirectory(utils/hmaptool)
874874

875875
if(CLANG_BUILT_STANDALONE)
876876
llvm_distribution_add_targets()
877-
process_llvm_pass_plugins()
877+
process_llvm_pass_plugins(NO_GEN)
878878
endif()
879879

880880
configure_file(

clang/docs/OpenMPSupport.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,13 @@ implementation.
229229
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
230230
| misc extension | library shutdown (omp_pause_resource[_all]) | :none:`unclaimed parts` | D55078 |
231231
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
232-
| misc extension | metadirectives | :none:`worked on` | |
232+
| misc extension | metadirectives | :part:`worked on` | |
233233
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
234234
| misc extension | conditional modifier for lastprivate clause | :good:`done` | |
235235
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
236236
| misc extension | iterator and multidependences | :part:`claimed` | |
237237
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
238-
| misc extension | user-defined function variants | :part:`worked on` | D67294, D64095 |
238+
| misc extension | user-defined function variants | :part:`worked on` | D67294, D64095, D71847, D71830 |
239239
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
240240
| misc extension | pointer/reference to pointer based array reductions | :none:`unclaimed` | |
241241
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
@@ -258,5 +258,7 @@ want to help with the implementation.
258258
+==============================+==============================================================+==========================+=======================================================================+
259259
| misc extension | user-defined function variants with #ifdef protection | :part:`worked on` | D71179 |
260260
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
261+
| misc extension | default(firstprivate) & default(private) | :part:`worked on` | |
262+
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
261263
| loop extension | Loop tiling transformation | :part:`claimed` | |
262264
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ Major New Features
5151
Improvements to Clang's diagnostics
5252
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5353

54-
- ...
54+
- -Wpointer-to-int-cast is a new warning group. This group warns about C-style
55+
casts of pointers to a integer type too small to hold all possible values.
5556

5657
Non-comprehensive list of changes in this release
5758
-------------------------------------------------

clang/include/clang/AST/OpenMPClause.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -867,15 +867,15 @@ class OMPDefaultClause : public OMPClause {
867867
SourceLocation LParenLoc;
868868

869869
/// A kind of the 'default' clause.
870-
OpenMPDefaultClauseKind Kind = OMPC_DEFAULT_unknown;
870+
llvm::omp::DefaultKind Kind = llvm::omp::OMP_DEFAULT_unknown;
871871

872872
/// Start location of the kind in source code.
873873
SourceLocation KindKwLoc;
874874

875875
/// Set kind of the clauses.
876876
///
877877
/// \param K Argument of clause.
878-
void setDefaultKind(OpenMPDefaultClauseKind K) { Kind = K; }
878+
void setDefaultKind(llvm::omp::DefaultKind K) { Kind = K; }
879879

880880
/// Set argument location.
881881
///
@@ -890,7 +890,7 @@ class OMPDefaultClause : public OMPClause {
890890
/// \param StartLoc Starting location of the clause.
891891
/// \param LParenLoc Location of '('.
892892
/// \param EndLoc Ending location of the clause.
893-
OMPDefaultClause(OpenMPDefaultClauseKind A, SourceLocation ALoc,
893+
OMPDefaultClause(llvm::omp::DefaultKind A, SourceLocation ALoc,
894894
SourceLocation StartLoc, SourceLocation LParenLoc,
895895
SourceLocation EndLoc)
896896
: OMPClause(OMPC_default, StartLoc, EndLoc), LParenLoc(LParenLoc),
@@ -907,7 +907,7 @@ class OMPDefaultClause : public OMPClause {
907907
SourceLocation getLParenLoc() const { return LParenLoc; }
908908

909909
/// Returns kind of the clause.
910-
OpenMPDefaultClauseKind getDefaultKind() const { return Kind; }
910+
llvm::omp::DefaultKind getDefaultKind() const { return Kind; }
911911

912912
/// Returns location of clause kind.
913913
SourceLocation getDefaultKindKwLoc() const { return KindKwLoc; }
@@ -6682,10 +6682,10 @@ struct OMPTraitInfo {
66826682
llvm::SmallVector<OMPTraitSet, 4> Sets;
66836683

66846684
bool anyScoreOrCondition(
6685-
llvm::function_ref<bool(Expr *&, bool /* IsScore */)> Cond) {
6686-
return llvm::any_of(Sets, [Cond](OMPTraitInfo::OMPTraitSet &Set) {
6685+
const llvm::function_ref<bool(Expr *&, bool /* IsScore */)> &Cond) {
6686+
return llvm::any_of(Sets, [&Cond](OMPTraitInfo::OMPTraitSet &Set) {
66876687
return llvm::any_of(
6688-
Set.Selectors, [Cond](OMPTraitInfo::OMPTraitSelector &Selector) {
6688+
Set.Selectors, [&Cond](OMPTraitInfo::OMPTraitSelector &Selector) {
66896689
return Cond(Selector.ScoreOrCondition,
66906690
/* IsScore */ Selector.Kind !=
66916691
llvm::omp::TraitSelector::user_condition);

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7049,7 +7049,7 @@ extern const internal::VariadicDynCastAllOfMatcher<OMPClause, OMPDefaultClause>
70497049
///
70507050
/// ``ompDefaultClause(isNoneKind())`` matches only ``default(none)``.
70517051
AST_MATCHER(OMPDefaultClause, isNoneKind) {
7052-
return Node.getDefaultKind() == OMPC_DEFAULT_none;
7052+
return Node.getDefaultKind() == llvm::omp::OMP_DEFAULT_none;
70537053
}
70547054

70557055
/// Matches if the OpenMP ``default`` clause has ``shared`` kind specified.
@@ -7064,7 +7064,7 @@ AST_MATCHER(OMPDefaultClause, isNoneKind) {
70647064
///
70657065
/// ``ompDefaultClause(isSharedKind())`` matches only ``default(shared)``.
70667066
AST_MATCHER(OMPDefaultClause, isSharedKind) {
7067-
return Node.getDefaultKind() == OMPC_DEFAULT_shared;
7067+
return Node.getDefaultKind() == llvm::omp::OMP_DEFAULT_shared;
70687068
}
70697069

70707070
/// Matches if the OpenMP directive is allowed to contain the specified OpenMP

clang/include/clang/Basic/Attr.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class NamedArgument<string name, bit opt = 0, bit fake = 0> : Argument<name,
181181
opt,
182182
fake>;
183183

184-
// An argument of a OMPDeclareVariantAttribute that represents the `match`
184+
// An argument of a OMPDeclareVariantAttr that represents the `match`
185185
// clause of the declare variant by keeping the information (incl. nesting) in
186186
// an OMPTraitInfo object.
187187
//
@@ -2289,7 +2289,7 @@ def ObjCDirect : Attr {
22892289

22902290
def ObjCDirectMembers : Attr {
22912291
let Spellings = [Clang<"objc_direct_members">];
2292-
let Subjects = SubjectList<[ObjCImpl, ObjCCategory], ErrorDiag>;
2292+
let Subjects = SubjectList<[ObjCImpl, ObjCInterface, ObjCCategory], ErrorDiag>;
22932293
let LangOpts = [ObjC];
22942294
let Documentation = [ObjCDirectMembersDocs];
22952295
}
@@ -3729,7 +3729,7 @@ def OMPDeclareVariant : InheritableAttr {
37293729
OMPTraitInfoArgument<"TraitInfos">,
37303730
];
37313731
let AdditionalMembers = [{
3732-
~OMPDeclareVariantAttr() { delete traitInfos; }
3732+
OMPTraitInfo &getTraitInfo() { return traitInfos; }
37333733
void printPrettyPragma(raw_ostream & OS, const PrintingPolicy &Policy)
37343734
const {
37353735
if (const Expr *E = getVariantFuncRef()) {
@@ -3738,7 +3738,7 @@ def OMPDeclareVariant : InheritableAttr {
37383738
OS << ")";
37393739
}
37403740
OS << " match(";
3741-
traitInfos->print(OS, Policy);
3741+
traitInfos.print(OS, Policy);
37423742
OS << ")";
37433743
}
37443744
}];

clang/include/clang/Basic/AttrDocs.td

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4446,7 +4446,7 @@ documentation for more information.
44464446
def ObjCDirectMembersDocs : Documentation {
44474447
let Category = DocCatDecl;
44484448
let Content = [{
4449-
The ``objc_direct_members`` attribute can be placed on an Objective-C
4449+
The ``objc_direct_members`` attribute can be placed on an Objective-C
44504450
``@interface`` or ``@implementation`` to mark that methods declared
44514451
therein should be considered direct by default. See the documentation
44524452
for ``objc_direct`` for more information about direct methods.
@@ -4455,9 +4455,7 @@ When ``objc_direct_members`` is placed on an ``@interface`` block, every
44554455
method in the block is considered to be declared as direct. This includes any
44564456
implicit method declarations introduced by property declarations. If the method
44574457
redeclares a non-direct method, the declaration is ill-formed, exactly as if the
4458-
method was annotated with the ``objc_direct`` attribute. ``objc_direct_members``
4459-
cannot be placed on the primary interface of a class, only on category or class
4460-
extension interfaces.
4458+
method was annotated with the ``objc_direct`` attribute.
44614459

44624460
When ``objc_direct_members`` is placed on an ``@implementation`` block,
44634461
methods defined in the block are considered to be declared as direct unless

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,9 @@ def IncompatibleExceptionSpec : DiagGroup<"incompatible-exception-spec">;
838838
def IntToVoidPointerCast : DiagGroup<"int-to-void-pointer-cast">;
839839
def IntToPointerCast : DiagGroup<"int-to-pointer-cast",
840840
[IntToVoidPointerCast]>;
841+
def VoidPointerToIntCast : DiagGroup<"void-pointer-to-int-cast">;
842+
def PointerToIntCast : DiagGroup<"pointer-to-int-cast",
843+
[VoidPointerToIntCast]>;
841844

842845
def Move : DiagGroup<"move", [
843846
PessimizingMove,

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,8 +1050,8 @@ def err_objc_direct_on_protocol : Error<
10501050
"'objc_direct' attribute cannot be applied to %select{methods|properties}0 "
10511051
"declared in an Objective-C protocol">;
10521052
def err_objc_direct_duplicate_decl : Error<
1053-
"%select{|direct }0method declaration conflicts "
1054-
"with previous %select{|direct }1declaration of method %2">;
1053+
"%select{|direct }0%select{method|property}1 declaration conflicts "
1054+
"with previous %select{|direct }2declaration of %select{method|property}1 %3">;
10551055
def err_objc_direct_impl_decl_mismatch : Error<
10561056
"direct method was declared in %select{the primary interface|an extension|a category}0 "
10571057
"but is implemented in %select{the primary interface|a category|a different category}1">;
@@ -1067,6 +1067,8 @@ def warn_objc_direct_ignored : Warning<
10671067
def warn_objc_direct_property_ignored : Warning<
10681068
"direct attribute on property %0 ignored (not implemented by this Objective-C runtime)">,
10691069
InGroup<IgnoredAttributes>;
1070+
def err_objc_direct_dynamic_property : Error<
1071+
"direct property cannot be @dynamic">;
10701072

10711073
def warn_conflicting_overriding_ret_types : Warning<
10721074
"conflicting return type in "
@@ -3699,6 +3701,15 @@ def warn_int_to_pointer_cast : Warning<
36993701
def warn_int_to_void_pointer_cast : Warning<
37003702
"cast to %1 from smaller integer type %0">,
37013703
InGroup<IntToVoidPointerCast>;
3704+
def warn_pointer_to_int_cast : Warning<
3705+
"cast to smaller integer type %1 from %0">,
3706+
InGroup<PointerToIntCast>;
3707+
def warn_void_pointer_to_int_cast : Warning<
3708+
"cast to smaller integer type %1 from %0">,
3709+
InGroup<VoidPointerToIntCast>;
3710+
def ext_ms_pointer_to_int_cast : ExtWarn<
3711+
"cast to smaller integer type %1 from %0 is a Microsoft extension">,
3712+
InGroup<MicrosoftCast>;
37023713

37033714
def warn_attribute_ignored_for_field_of_type : Warning<
37043715
"%0 attribute ignored for field of type %1">,
@@ -9953,7 +9964,8 @@ def err_omp_declare_variant_incompat_attributes : Error<
99539964
"'#pragma omp declare variant' is not compatible with any target-specific attributes">;
99549965
def warn_omp_declare_variant_score_not_constant
99559966
: Warning<"score expressions in the OpenMP context selector need to be "
9956-
"constant; %0 is not and will be ignored">;
9967+
"constant; %0 is not and will be ignored">,
9968+
InGroup<SourceUsesOpenMP>;
99579969
def err_omp_declare_variant_user_condition_not_constant
99589970
: Error<"the user condition in the OpenMP context selector needs to be "
99599971
"constant; %0 is not">;

clang/include/clang/Basic/OpenMPKinds.def

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@
107107
#ifndef OPENMP_DISTRIBUTE_CLAUSE
108108
#define OPENMP_DISTRIBUTE_CLAUSE(Name)
109109
#endif
110-
#ifndef OPENMP_DEFAULT_KIND
111-
# define OPENMP_DEFAULT_KIND(Name)
112-
#endif
113110
#ifndef OPENMP_SCHEDULE_KIND
114111
#define OPENMP_SCHEDULE_KIND(Name)
115112
#endif
@@ -351,10 +348,6 @@ OPENMP_SINGLE_CLAUSE(allocate)
351348
// Clauses allowed for OpenMP directive 'cancel'.
352349
OPENMP_CANCEL_CLAUSE(if)
353350

354-
// Static attributes for 'default' clause.
355-
OPENMP_DEFAULT_KIND(none)
356-
OPENMP_DEFAULT_KIND(shared)
357-
358351
// Static attributes for 'schedule' clause.
359352
OPENMP_SCHEDULE_KIND(static)
360353
OPENMP_SCHEDULE_KIND(dynamic)
@@ -1103,7 +1096,6 @@ OPENMP_FLUSH_CLAUSE(release)
11031096
#undef OPENMP_DEPEND_KIND
11041097
#undef OPENMP_SCHEDULE_MODIFIER
11051098
#undef OPENMP_SCHEDULE_KIND
1106-
#undef OPENMP_DEFAULT_KIND
11071099
#undef OPENMP_CLAUSE
11081100
#undef OPENMP_CRITICAL_CLAUSE
11091101
#undef OPENMP_ORDERED_CLAUSE

clang/include/clang/Basic/OpenMPKinds.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@ enum OpenMPClauseKind {
3434
OMPC_unknown
3535
};
3636

37-
/// OpenMP attributes for 'default' clause.
38-
enum OpenMPDefaultClauseKind {
39-
#define OPENMP_DEFAULT_KIND(Name) \
40-
OMPC_DEFAULT_##Name,
41-
#include "clang/Basic/OpenMPKinds.def"
42-
OMPC_DEFAULT_unknown
43-
};
44-
4537
/// OpenMP attributes for 'schedule' clause.
4638
enum OpenMPScheduleClauseKind {
4739
#define OPENMP_SCHEDULE_KIND(Name) \

0 commit comments

Comments
 (0)