Skip to content

Commit dccf00d

Browse files
authored
Merge branch 'main' into acp/vbvictor/1414050061759150
2 parents 29c70e4 + c0e4bce commit dccf00d

File tree

77 files changed

+5725
-807
lines changed

Some content is hidden

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

77 files changed

+5725
-807
lines changed

clang-tools-extra/clang-doc/assets/class-template.mustache

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,7 @@
141141
<div>
142142
{{#PublicMembers}}
143143
<div id="{{Name}}" class="delimiter-container">
144-
<pre>
145-
<code class="language-cpp code-clang-doc" >{{Type}} {{Name}}</code>
146-
</pre>
144+
<pre><code class="language-cpp code-clang-doc" >{{Type}} {{Name}}</code></pre>
147145
{{#MemberComments}}
148146
<div>
149147
{{>Comments}}
@@ -160,9 +158,7 @@
160158
<div>
161159
{{#Obj}}
162160
<div id="{{Name}}" class="delimiter-container">
163-
<pre>
164-
<code class="language-cpp code-clang-doc" >{{Type}} {{Name}}</code>
165-
</pre>
161+
<pre><code class="language-cpp code-clang-doc" >{{Type}} {{Name}}</code></pre>
166162
{{#MemberComments}}
167163
<div>
168164
{{>Comments}}

clang-tools-extra/clang-doc/assets/namespace-template.mustache

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@
9292
{{#Records}}
9393
<li id="{{USR}}" style="max-height: 40px;">
9494
<a href="{{DocumentationFileName}}.html">
95-
<pre>
96-
<code class="language-cpp code-clang-doc">class {{Name}}</code>
97-
</pre>
95+
<pre><code class="language-cpp code-clang-doc">class {{Name}}</code></pre>
9896
</a>
9997
</li>
10098
{{/Records}}

clang-tools-extra/test/clang-doc/mustache-index.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ class Foo;
7070
// CHECK-NEXT: <ul class="class-container">
7171
// CHECK-NEXT: <li id="{{[0-9A-F]*}}" style="max-height: 40px;">
7272
// CHECK-NEXT: <a href="_ZTV3Foo.html">
73-
// CHECK-NEXT: <pre>
74-
// CHECK-NEXT: <code class="language-cpp code-clang-doc">class Foo</code>
75-
// CHECK-NEXT: </pre>
73+
// CHECK-NEXT: <pre><code class="language-cpp code-clang-doc">class Foo</code></pre>
7674
// CHECK-NEXT: </a>
7775
// CHECK-NEXT: </li>
7876
// CHECK-NEXT: </ul>

clang-tools-extra/test/clang-doc/mustache-separate-namespace.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ namespace MyNamespace {
99
// CHECK: <ul class="class-container">
1010
// CHECK-NEXT: <li id="{{[0-9A-F]*}}" style="max-height: 40px;">
1111
// CHECK-NEXT: <a href="_ZTVN11MyNamespace3FooE.html">
12-
// CHECK-NEXT: <pre>
13-
// CHECK-NEXT: <code class="language-cpp code-clang-doc">class Foo</code>
14-
// CHECK-NEXT: </pre>
12+
// CHECK-NEXT: <pre><code class="language-cpp code-clang-doc">class Foo</code></pre>
1513
// CHECK-NEXT: </a>
1614
// CHECK-NEXT: </li>
1715
// CHECK-NEXT: </ul>

clang/include/clang/AST/OpenMPClause.h

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10068,6 +10068,152 @@ class OMPXDynCGroupMemClause
1006810068
Expr *getSize() const { return getStmtAs<Expr>(); }
1006910069
};
1007010070

10071+
/// This represents 'dyn_groupprivate' clause in '#pragma omp target ...'
10072+
/// and '#pragma omp teams ...' directives.
10073+
///
10074+
/// \code
10075+
/// #pragma omp target [...] dyn_groupprivate(a,b: N)
10076+
/// \endcode
10077+
class OMPDynGroupprivateClause : public OMPClause, public OMPClauseWithPreInit {
10078+
friend class OMPClauseReader;
10079+
10080+
/// Location of '('.
10081+
SourceLocation LParenLoc;
10082+
10083+
/// Modifiers for 'dyn_groupprivate' clause.
10084+
enum { SIMPLE, FALLBACK, NUM_MODIFIERS };
10085+
unsigned Modifiers[NUM_MODIFIERS];
10086+
10087+
/// Locations of modifiers.
10088+
SourceLocation ModifiersLoc[NUM_MODIFIERS];
10089+
10090+
/// The size of the dyn_groupprivate.
10091+
Expr *Size = nullptr;
10092+
10093+
/// Set the first dyn_groupprivate modifier.
10094+
///
10095+
/// \param M The modifier.
10096+
void setDynGroupprivateModifier(OpenMPDynGroupprivateClauseModifier M) {
10097+
Modifiers[SIMPLE] = M;
10098+
}
10099+
10100+
/// Set the second dyn_groupprivate modifier.
10101+
///
10102+
/// \param M The modifier.
10103+
void setDynGroupprivateFallbackModifier(
10104+
OpenMPDynGroupprivateClauseFallbackModifier M) {
10105+
Modifiers[FALLBACK] = M;
10106+
}
10107+
10108+
/// Set location of the first dyn_groupprivate modifier.
10109+
void setDynGroupprivateModifierLoc(SourceLocation Loc) {
10110+
ModifiersLoc[SIMPLE] = Loc;
10111+
}
10112+
10113+
/// Set location of the second dyn_groupprivate modifier.
10114+
void setDynGroupprivateFallbackModifierLoc(SourceLocation Loc) {
10115+
ModifiersLoc[FALLBACK] = Loc;
10116+
}
10117+
10118+
/// Sets the location of '('.
10119+
///
10120+
/// \param Loc Location of '('.
10121+
void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
10122+
10123+
/// Set size.
10124+
///
10125+
/// \param E Size.
10126+
void setSize(Expr *E) { Size = E; }
10127+
10128+
public:
10129+
/// Build 'dyn_groupprivate' clause with a size expression \a Size.
10130+
///
10131+
/// \param StartLoc Starting location of the clause.
10132+
/// \param LParenLoc Location of '('.
10133+
/// \param EndLoc Ending location of the clause.
10134+
/// \param Size Size.
10135+
/// \param M1 The first modifier applied to 'dyn_groupprivate' clause.
10136+
/// \param M1Loc Location of the first modifier.
10137+
/// \param M2 The second modifier applied to 'dyn_groupprivate' clause.
10138+
/// \param M2Loc Location of the second modifier.
10139+
OMPDynGroupprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
10140+
SourceLocation EndLoc, Expr *Size, Stmt *HelperSize,
10141+
OpenMPDirectiveKind CaptureRegion,
10142+
OpenMPDynGroupprivateClauseModifier M1,
10143+
SourceLocation M1Loc,
10144+
OpenMPDynGroupprivateClauseFallbackModifier M2,
10145+
SourceLocation M2Loc)
10146+
: OMPClause(llvm::omp::OMPC_dyn_groupprivate, StartLoc, EndLoc),
10147+
OMPClauseWithPreInit(this), LParenLoc(LParenLoc), Size(Size) {
10148+
setPreInitStmt(HelperSize, CaptureRegion);
10149+
Modifiers[SIMPLE] = M1;
10150+
Modifiers[FALLBACK] = M2;
10151+
ModifiersLoc[SIMPLE] = M1Loc;
10152+
ModifiersLoc[FALLBACK] = M2Loc;
10153+
}
10154+
10155+
/// Build an empty clause.
10156+
explicit OMPDynGroupprivateClause()
10157+
: OMPClause(llvm::omp::OMPC_dyn_groupprivate, SourceLocation(),
10158+
SourceLocation()),
10159+
OMPClauseWithPreInit(this) {
10160+
Modifiers[SIMPLE] = OMPC_DYN_GROUPPRIVATE_unknown;
10161+
Modifiers[FALLBACK] = OMPC_DYN_GROUPPRIVATE_FALLBACK_unknown;
10162+
}
10163+
10164+
/// Get the first modifier of the clause.
10165+
OpenMPDynGroupprivateClauseModifier getDynGroupprivateModifier() const {
10166+
return static_cast<OpenMPDynGroupprivateClauseModifier>(Modifiers[SIMPLE]);
10167+
}
10168+
10169+
/// Get the second modifier of the clause.
10170+
OpenMPDynGroupprivateClauseFallbackModifier
10171+
getDynGroupprivateFallbackModifier() const {
10172+
return static_cast<OpenMPDynGroupprivateClauseFallbackModifier>(
10173+
Modifiers[FALLBACK]);
10174+
}
10175+
10176+
/// Get location of '('.
10177+
SourceLocation getLParenLoc() { return LParenLoc; }
10178+
10179+
/// Get the first modifier location.
10180+
SourceLocation getDynGroupprivateModifierLoc() const {
10181+
return ModifiersLoc[SIMPLE];
10182+
}
10183+
10184+
/// Get the second modifier location.
10185+
SourceLocation getDynGroupprivateFallbackModifierLoc() const {
10186+
return ModifiersLoc[FALLBACK];
10187+
}
10188+
10189+
/// Get size.
10190+
Expr *getSize() { return Size; }
10191+
10192+
/// Get size.
10193+
const Expr *getSize() const { return Size; }
10194+
10195+
child_range children() {
10196+
return child_range(reinterpret_cast<Stmt **>(&Size),
10197+
reinterpret_cast<Stmt **>(&Size) + 1);
10198+
}
10199+
10200+
const_child_range children() const {
10201+
auto Children = const_cast<OMPDynGroupprivateClause *>(this)->children();
10202+
return const_child_range(Children.begin(), Children.end());
10203+
}
10204+
10205+
child_range used_children() {
10206+
return child_range(child_iterator(), child_iterator());
10207+
}
10208+
const_child_range used_children() const {
10209+
return const_child_range(const_child_iterator(), const_child_iterator());
10210+
}
10211+
10212+
static bool classof(const OMPClause *T) {
10213+
return T->getClauseKind() == llvm::omp::OMPC_dyn_groupprivate;
10214+
}
10215+
};
10216+
1007110217
/// This represents the 'doacross' clause for the '#pragma omp ordered'
1007210218
/// directive.
1007310219
///

clang/include/clang/AST/RecursiveASTVisitor.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4165,6 +4165,14 @@ bool RecursiveASTVisitor<Derived>::VisitOMPXDynCGroupMemClause(
41654165
return true;
41664166
}
41674167

4168+
template <typename Derived>
4169+
bool RecursiveASTVisitor<Derived>::VisitOMPDynGroupprivateClause(
4170+
OMPDynGroupprivateClause *C) {
4171+
TRY_TO(VisitOMPClauseWithPreInit(C));
4172+
TRY_TO(TraverseStmt(C->getSize()));
4173+
return true;
4174+
}
4175+
41684176
template <typename Derived>
41694177
bool RecursiveASTVisitor<Derived>::VisitOMPDoacrossClause(
41704178
OMPDoacrossClause *C) {

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12137,6 +12137,9 @@ def err_omp_unexpected_schedule_modifier : Error<
1213712137
"modifier '%0' cannot be used along with modifier '%1'">;
1213812138
def err_omp_schedule_nonmonotonic_static : Error<
1213912139
"'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
12140+
def err_omp_incompatible_dyn_groupprivate_modifier
12141+
: Error<"modifier '%0' cannot be used along with modifier '%1' in "
12142+
"dyn_groupprivate">;
1214012143
def err_omp_simple_clause_incompatible_with_ordered : Error<
1214112144
"'%0' clause with '%1' modifier cannot be specified if an 'ordered' clause is specified">;
1214212145
def err_omp_ordered_simd : Error<

clang/include/clang/Basic/OpenMPKinds.def

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@
8686
#ifndef OPENMP_GRAINSIZE_MODIFIER
8787
#define OPENMP_GRAINSIZE_MODIFIER(Name)
8888
#endif
89+
#ifndef OPENMP_DYN_GROUPPRIVATE_MODIFIER
90+
#define OPENMP_DYN_GROUPPRIVATE_MODIFIER(Name)
91+
#endif
92+
#ifndef OPENMP_DYN_GROUPPRIVATE_FALLBACK_MODIFIER
93+
#define OPENMP_DYN_GROUPPRIVATE_FALLBACK_MODIFIER(Name)
94+
#endif
8995
#ifndef OPENMP_NUMTASKS_MODIFIER
9096
#define OPENMP_NUMTASKS_MODIFIER(Name)
9197
#endif
@@ -242,6 +248,14 @@ OPENMP_BIND_KIND(thread)
242248
// Modifiers for the 'grainsize' clause.
243249
OPENMP_GRAINSIZE_MODIFIER(strict)
244250

251+
// Modifiers for the 'dyn_groupprivate' clause.
252+
OPENMP_DYN_GROUPPRIVATE_MODIFIER(cgroup)
253+
254+
// Fallback modifiers for the 'dyn_groupprivate' clause.
255+
OPENMP_DYN_GROUPPRIVATE_FALLBACK_MODIFIER(abort)
256+
OPENMP_DYN_GROUPPRIVATE_FALLBACK_MODIFIER(null)
257+
OPENMP_DYN_GROUPPRIVATE_FALLBACK_MODIFIER(default_mem)
258+
245259
// Modifiers for the 'num_tasks' clause.
246260
OPENMP_NUMTASKS_MODIFIER(strict)
247261

@@ -263,6 +277,8 @@ OPENMP_THREADSET_KIND(omp_team)
263277

264278
#undef OPENMP_NUMTASKS_MODIFIER
265279
#undef OPENMP_NUMTHREADS_MODIFIER
280+
#undef OPENMP_DYN_GROUPPRIVATE_MODIFIER
281+
#undef OPENMP_DYN_GROUPPRIVATE_FALLBACK_MODIFIER
266282
#undef OPENMP_GRAINSIZE_MODIFIER
267283
#undef OPENMP_BIND_KIND
268284
#undef OPENMP_ADJUST_ARGS_KIND

clang/include/clang/Basic/OpenMPKinds.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,20 @@ enum OpenMPGrainsizeClauseModifier {
224224
OMPC_GRAINSIZE_unknown
225225
};
226226

227+
enum OpenMPDynGroupprivateClauseModifier {
228+
#define OPENMP_DYN_GROUPPRIVATE_MODIFIER(Name) OMPC_DYN_GROUPPRIVATE_##Name,
229+
#include "clang/Basic/OpenMPKinds.def"
230+
OMPC_DYN_GROUPPRIVATE_unknown
231+
};
232+
233+
enum OpenMPDynGroupprivateClauseFallbackModifier {
234+
OMPC_DYN_GROUPPRIVATE_FALLBACK_unknown = OMPC_DYN_GROUPPRIVATE_unknown,
235+
#define OPENMP_DYN_GROUPPRIVATE_FALLBACK_MODIFIER(Name) \
236+
OMPC_DYN_GROUPPRIVATE_FALLBACK_##Name,
237+
#include "clang/Basic/OpenMPKinds.def"
238+
OMPC_DYN_GROUPPRIVATE_FALLBACK_last
239+
};
240+
227241
enum OpenMPNumTasksClauseModifier {
228242
#define OPENMP_NUMTASKS_MODIFIER(Name) OMPC_NUMTASKS_##Name,
229243
#include "clang/Basic/OpenMPKinds.def"

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ struct MissingFeatures {
189189

190190
// Misc
191191
static bool abiArgInfo() { return false; }
192-
static bool addAutoInitAnnotation() { return false; }
193192
static bool addHeapAllocSiteMetadata() { return false; }
194193
static bool aggEmitFinalDestCopyRValue() { return false; }
195194
static bool aggValueSlot() { return false; }
@@ -199,7 +198,6 @@ struct MissingFeatures {
199198
static bool aggValueSlotMayOverlap() { return false; }
200199
static bool aggValueSlotVolatile() { return false; }
201200
static bool alignCXXRecordDecl() { return false; }
202-
static bool appleKext() { return false; }
203201
static bool armComputeVolatileBitfields() { return false; }
204202
static bool asmGoto() { return false; }
205203
static bool asmInputOperands() { return false; }
@@ -246,7 +244,6 @@ struct MissingFeatures {
246244
static bool deleteArray() { return false; }
247245
static bool devirtualizeDestructor() { return false; }
248246
static bool devirtualizeMemberFunction() { return false; }
249-
static bool dtorCleanups() { return false; }
250247
static bool ehCleanupFlags() { return false; }
251248
static bool ehCleanupHasPrebranchedFallthrough() { return false; }
252249
static bool ehCleanupScope() { return false; }
@@ -292,7 +289,6 @@ struct MissingFeatures {
292289
static bool objCGC() { return false; }
293290
static bool objCLifetime() { return false; }
294291
static bool hlsl() { return false; }
295-
static bool msvcBuiltins() { return false; }
296292
static bool openCL() { return false; }
297293
static bool openMP() { return false; }
298294
static bool opTBAA() { return false; }
@@ -307,10 +303,6 @@ struct MissingFeatures {
307303
static bool setNonGC() { return false; }
308304
static bool setObjCGCLValueClass() { return false; }
309305
static bool setTargetAttributes() { return false; }
310-
static bool shouldCreateMemCpyFromGlobal() { return false; }
311-
static bool shouldSplitConstantStore() { return false; }
312-
static bool shouldUseBZeroPlusStoresToInitialize() { return false; }
313-
static bool shouldUseMemSetToInitialize() { return false; }
314306
static bool simplifyCleanupEntry() { return false; }
315307
static bool sourceLanguageCases() { return false; }
316308
static bool stackBase() { return false; }
@@ -322,14 +314,16 @@ struct MissingFeatures {
322314
static bool thunks() { return false; }
323315
static bool tryEmitAsConstant() { return false; }
324316
static bool typeChecks() { return false; }
325-
static bool vaArgABILowering() { return false; }
326-
static bool vectorConstants() { return false; }
327-
static bool vlas() { return false; }
317+
static bool weakRefReference() { return false; }
318+
static bool writebacks() { return false; }
319+
static bool appleKext() { return false; }
320+
static bool dtorCleanups() { return false; }
328321
static bool vtableInitialization() { return false; }
329322
static bool vtableEmitMetadata() { return false; }
330323
static bool vtableRelativeLayout() { return false; }
331-
static bool weakRefReference() { return false; }
332-
static bool writebacks() { return false; }
324+
static bool msvcBuiltins() { return false; }
325+
static bool vaArgABILowering() { return false; }
326+
static bool vlas() { return false; }
333327

334328
// Missing types
335329
static bool dataMemberType() { return false; }

0 commit comments

Comments
 (0)