Skip to content

Commit d5b4f5a

Browse files
committed
Merge branch 'main' into vector-step-op-temp
2 parents b27d010 + ea24d62 commit d5b4f5a

File tree

68 files changed

+1279
-1777
lines changed

Some content is hidden

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

68 files changed

+1279
-1777
lines changed

clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,8 @@ class RenamerClangTidyVisitor
350350
const TemplateDecl *Decl =
351351
Loc.getTypePtr()->getTemplateName().getAsTemplateDecl(
352352
/*IgnoreDeduced=*/true);
353+
if (!Decl)
354+
return true;
353355

354356
if (const auto *ClassDecl = dyn_cast<TemplateDecl>(Decl))
355357
if (const NamedDecl *TemplDecl = ClassDecl->getTemplatedDecl())

clang-tools-extra/clangd/FindTarget.cpp

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -406,15 +406,6 @@ struct TargetFinder {
406406
}
407407
}
408408
}
409-
void VisitDependentTemplateSpecializationType(
410-
const DependentTemplateSpecializationType *DTST) {
411-
if (Outer.Resolver) {
412-
for (const NamedDecl *ND :
413-
Outer.Resolver->resolveTemplateSpecializationType(DTST)) {
414-
Outer.add(ND, Flags);
415-
}
416-
}
417-
}
418409
void VisitTypedefType(const TypedefType *TT) {
419410
if (shouldSkipTypedef(TT->getDecl()))
420411
return;
@@ -455,11 +446,13 @@ struct TargetFinder {
455446
// class template specializations have a (specialized) CXXRecordDecl.
456447
else if (const CXXRecordDecl *RD = TST->getAsCXXRecordDecl())
457448
Outer.add(RD, Flags); // add(Decl) will despecialize if needed.
458-
else {
449+
else if (auto *TD = TST->getTemplateName().getAsTemplateDecl())
459450
// fallback: the (un-specialized) declaration from primary template.
460-
if (auto *TD = TST->getTemplateName().getAsTemplateDecl())
461-
Outer.add(TD->getTemplatedDecl(), Flags | Rel::TemplatePattern);
462-
}
451+
Outer.add(TD->getTemplatedDecl(), Flags | Rel::TemplatePattern);
452+
else if (Outer.Resolver)
453+
for (const NamedDecl *ND :
454+
Outer.Resolver->resolveTemplateSpecializationType(TST))
455+
Outer.add(ND, Flags);
463456
}
464457
void
465458
VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *STTPT) {
@@ -900,15 +893,6 @@ refInTypeLoc(TypeLoc L, const HeuristicResolver *Resolver) {
900893
DeclRelation::Alias, Resolver)});
901894
}
902895

903-
void VisitDependentTemplateSpecializationTypeLoc(
904-
DependentTemplateSpecializationTypeLoc L) {
905-
Refs.push_back(
906-
ReferenceLoc{L.getQualifierLoc(), L.getTemplateNameLoc(),
907-
/*IsDecl=*/false,
908-
explicitReferenceTargets(
909-
DynTypedNode::create(L.getType()), {}, Resolver)});
910-
}
911-
912896
void VisitDependentNameTypeLoc(DependentNameTypeLoc L) {
913897
Refs.push_back(
914898
ReferenceLoc{L.getQualifierLoc(), L.getNameLoc(),

clang-tools-extra/clangd/SemanticHighlighting.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -728,11 +728,6 @@ class CollectExtraHighlightings
728728
return true;
729729
}
730730

731-
bool VisitTemplateSpecializationTypeLoc(TemplateSpecializationTypeLoc L) {
732-
H.addAngleBracketTokens(L.getLAngleLoc(), L.getRAngleLoc());
733-
return true;
734-
}
735-
736731
bool VisitFunctionDecl(FunctionDecl *D) {
737732
if (D->isOverloadedOperator()) {
738733
const auto AddOpDeclToken = [&](SourceLocation Loc) {
@@ -1087,11 +1082,12 @@ class CollectExtraHighlightings
10871082
return true;
10881083
}
10891084

1090-
bool VisitDependentTemplateSpecializationTypeLoc(
1091-
DependentTemplateSpecializationTypeLoc L) {
1092-
H.addToken(L.getTemplateNameLoc(), HighlightingKind::Type)
1093-
.addModifier(HighlightingModifier::DependentName)
1094-
.addModifier(HighlightingModifier::ClassScope);
1085+
bool VisitTemplateSpecializationTypeLoc(TemplateSpecializationTypeLoc L) {
1086+
if (!L.getTypePtr()->getTemplateName().getAsTemplateDecl(
1087+
/*IgnoreDeduced=*/true))
1088+
H.addToken(L.getTemplateNameLoc(), HighlightingKind::Type)
1089+
.addModifier(HighlightingModifier::DependentName)
1090+
.addModifier(HighlightingModifier::ClassScope);
10951091
H.addAngleBracketTokens(L.getLAngleLoc(), L.getRAngleLoc());
10961092
return true;
10971093
}

clang-tools-extra/clangd/unittests/FindTargetTests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,8 +1029,7 @@ TEST_F(TargetDeclTest, DependentTypes) {
10291029
template <typename T>
10301030
void foo(typename A<T>::template [[B]]<int>);
10311031
)cpp";
1032-
EXPECT_DECLS("DependentTemplateSpecializationTypeLoc",
1033-
"template <typename> struct B");
1032+
EXPECT_DECLS("TemplateSpecializationTypeLoc", "template <typename> struct B");
10341033

10351034
// Dependent name with recursive definition. We don't expect a
10361035
// result, but we shouldn't get into a stack overflow either.

clang-tools-extra/include-cleaner/lib/WalkAST.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ class ASTWalker : public RecursiveASTVisitor<ASTWalker> {
321321

322322
// TypeLoc visitors.
323323
void reportType(SourceLocation RefLoc, NamedDecl *ND) {
324+
if (!ND)
325+
return;
324326
// Reporting explicit references to types nested inside classes can cause
325327
// issues, e.g. a type accessed through a derived class shouldn't require
326328
// inclusion of the base.

clang/docs/OpenMPSupport.rst

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,12 +348,97 @@ implementation.
348348
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
349349

350350

351+
.. _OpenMP 5.2 implementation details:
352+
353+
OpenMP 5.2 Implementation Details
354+
=================================
355+
356+
The following table provides a quick overview of various OpenMP 5.2 features
357+
and their implementation status. Please post on the
358+
`Discourse forums (Runtimes - OpenMP category)`_ for more
359+
information or if you want to help with the
360+
implementation.
361+
362+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
363+
|Feature | C/C++ Status | Fortran Status | Reviews |
364+
+=============================================================+===========================+===========================+==========================================================================+
365+
| omp_in_explicit_task() | :none:`unclaimed` | :none:`unclaimed` | |
366+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
367+
| semantics of explicit_task_var and implicit_task_var | :none:`unclaimed` | :none:`unclaimed` | |
368+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
369+
| ompx sentinel for C/C++ directive extensions | :none:`unclaimed` | :none:`unclaimed` | |
370+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
371+
| ompx prefix for clause extensions | :none:`unclaimed` | :none:`unclaimed` | |
372+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
373+
| if clause on teams construct | :none:`unclaimed` | :none:`unclaimed` | |
374+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
375+
| step modifier added | :none:`unclaimed` | :none:`unclaimed` | |
376+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
377+
| declare mapper: Add iterator modifier on map clause | :none:`unclaimed` | :none:`unclaimed` | |
378+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
379+
| declare mapper: Add iterator modifier on map clause | :none:`unclaimed` | :none:`unclaimed` | |
380+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
381+
| memspace and traits modifiers to uses allocator i | :none:`unclaimed` | :none:`unclaimed` | |
382+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
383+
| Add otherwise clause to metadirectives | :none:`unclaimed` | :none:`unclaimed` | |
384+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
385+
| doacross clause with support for omp_cur_iteration | :none:`unclaimed` | :none:`unclaimed` | |
386+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
387+
| position of interop_type in init clause on iterop | :none:`unclaimed` | :none:`unclaimed` | |
388+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
389+
| implicit map type for target enter/exit data | :none:`unclaimed` | :none:`unclaimed` | |
390+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
391+
| work OMPT type for work-sharing loop constructs | :none:`unclaimed` | :none:`unclaimed` | |
392+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
393+
| allocate and firstprivate on scope directive | :none:`unclaimed` | :none:`unclaimed` | |
394+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
395+
| Change loop consistency for order clause | :none:`unclaimed` | :none:`unclaimed` | |
396+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
397+
| Add memspace and traits modifiers to uses_allocators | :none:`unclaimed` | :none:`unclaimed` | |
398+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
399+
| Keep original base pointer on map w/o matched candidate | :none:`unclaimed` | :none:`unclaimed` | |
400+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
401+
| Pure procedure support for certain directives | :none:`N/A` | :none:`unclaimed` | |
402+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
403+
| ALLOCATE statement support for allocators | :none:`N/A` | :none:`unclaimed` | |
404+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
405+
| dispatch construct extension to support end directive | :none:`N/A` | :none:`unclaimed` | |
406+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
407+
408+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
409+
|OpenMP 5.2 Deprecations | C/C++ Status | Fortran Status | Reviews |
410+
+=============================================================+===========================+===========================+==========================================================================+
411+
| Linear clause syntax | :none:`unclaimed` | :none:`unclaimed` | |
412+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
413+
| The minus operator | :none:`unclaimed` | :none:`unclaimed` | |
414+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
415+
| Map clause modifiers without commas | :none:`unclaimed` | :none:`unclaimed` | |
416+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
417+
| The use of allocate directives with ALLOCATE statement | :good:`N/A` | :none:`unclaimed` | |
418+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
419+
| uses_allocators list syntax | :none:`unclaimed` | :none:`unclaimed` | |
420+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
421+
| The default clause on metadirectives | :none:`unclaimed` | :none:`unclaimed` | |
422+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
423+
| The delimited form of the declare target directive | :none:`unclaimed` | :good:`N/A` | |
424+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
425+
| The use of the to clause on the declare target directive | :none:`unclaimed` | :none:`unclaimed` | |
426+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
427+
| The syntax of the destroy clause on the depobj construct | :none:`unclaimed` | :none:`unclaimed` | |
428+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
429+
| keyword source and sink as task-dependence modifiers | :none:`unclaimed` | :none:`unclaimed` | |
430+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
431+
| interop types in any position on init clause of interop | :none:`unclaimed` | :none:`unclaimed` | |
432+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
433+
| ompd prefix usage for some ICVs | :none:`unclaimed` | :none:`unclaimed` | |
434+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
435+
351436
.. _OpenMP 6.0 implementation details:
352437

353438
OpenMP 6.0 Implementation Details
354439
=================================
355440

356-
The following table provides a quick overview over various OpenMP 6.0 features
441+
The following table provides a quick overview of various OpenMP 6.0 features
357442
and their implementation status. Please post on the
358443
`Discourse forums (Runtimes - OpenMP category)`_ for more
359444
information or if you want to help with the

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,9 @@ AST Matchers
458458
following the corresponding changes in the clang AST.
459459
- Ensure ``hasBitWidth`` doesn't crash on bit widths that are dependent on template
460460
parameters.
461-
461+
- Remove the ``dependentTemplateSpecializationType`` matcher, as the
462+
corresponding AST node was removed. This matcher was never very useful, since
463+
there was no way to match on its template name.
462464
- Add a boolean member ``IgnoreSystemHeaders`` to ``MatchFinderOptions``. This
463465
allows it to ignore nodes in system headers when traversing the AST.
464466

0 commit comments

Comments
 (0)