Skip to content

Commit 7c6b3fa

Browse files
committed
Handling storage class specifier thread_local
The `thread_local` storage class specifier was handled differently from the other storage class specifiers (like `mutable`) this has been corrected
1 parent e839209 commit 7c6b3fa

39 files changed

+83
-40
lines changed

addon/doxmlparser/doxmlparser/compound.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3741,7 +3741,7 @@ class memberdefType(GeneratedsSuper):
37413741
__hash__ = GeneratedsSuper.__hash__
37423742
subclass = None
37433743
superclass = None
3744-
def __init__(self, kind=None, id=None, prot=None, static=None, extern=None, strong=None, const=None, explicit=None, inline=None, refqual=None, virt=None, volatile=None, mutable=None, noexcept=None, noexceptexpression=None, nodiscard=None, constexpr=None, consteval=None, constinit=None, readable=None, writable=None, initonly=None, settable=None, privatesettable=None, protectedsettable=None, gettable=None, privategettable=None, protectedgettable=None, final=None, sealed=None, new=None, add=None, remove=None, raise_=None, optional=None, required=None, accessor=None, attribute=None, property=None, readonly=None, bound=None, removable=None, constrained=None, transient=None, maybevoid=None, maybedefault=None, maybeambiguous=None, templateparamlist=None, type_=None, definition=None, argsstring=None, name=None, qualifiedname=None, read=None, write=None, bitfield=None, reimplements=None, reimplementedby=None, qualifier=None, param=None, enumvalue=None, requiresclause=None, initializer=None, exceptions=None, briefdescription=None, detaileddescription=None, inbodydescription=None, location=None, references=None, referencedby=None, gds_collector_=None, **kwargs_):
3744+
def __init__(self, kind=None, id=None, prot=None, static=None, extern=None, strong=None, const=None, explicit=None, inline=None, refqual=None, virt=None, volatile=None, mutable=None, thread_local=None, noexcept=None, noexceptexpression=None, nodiscard=None, constexpr=None, consteval=None, constinit=None, readable=None, writable=None, initonly=None, settable=None, privatesettable=None, protectedsettable=None, gettable=None, privategettable=None, protectedgettable=None, final=None, sealed=None, new=None, add=None, remove=None, raise_=None, optional=None, required=None, accessor=None, attribute=None, property=None, readonly=None, bound=None, removable=None, constrained=None, transient=None, maybevoid=None, maybedefault=None, maybeambiguous=None, templateparamlist=None, type_=None, definition=None, argsstring=None, name=None, qualifiedname=None, read=None, write=None, bitfield=None, reimplements=None, reimplementedby=None, qualifier=None, param=None, enumvalue=None, requiresclause=None, initializer=None, exceptions=None, briefdescription=None, detaileddescription=None, inbodydescription=None, location=None, references=None, referencedby=None, gds_collector_=None, **kwargs_):
37453745
self.gds_collector_ = gds_collector_
37463746
self.gds_elementtree_node_ = None
37473747
self.original_tagname_ = None
@@ -3773,6 +3773,8 @@ def __init__(self, kind=None, id=None, prot=None, static=None, extern=None, stro
37733773
self.volatile_nsprefix_ = None
37743774
self.mutable = _cast(None, mutable)
37753775
self.mutable_nsprefix_ = None
3776+
self.thread_local = _cast(None, thread_local)
3777+
self.thread_local_nsprefix_ = None
37763778
self.noexcept = _cast(None, noexcept)
37773779
self.noexcept_nsprefix_ = None
37783780
self.noexceptexpression = _cast(None, noexceptexpression)
@@ -4109,6 +4111,10 @@ def get_mutable(self):
41094111
return self.mutable
41104112
def set_mutable(self, mutable):
41114113
self.mutable = mutable
4114+
def get_thread_local(self):
4115+
return self.thread_local
4116+
def set_thread_local(self, thread_local):
4117+
self.thread_local = thread_local
41124118
def get_noexcept(self):
41134119
return self.noexcept
41144120
def set_noexcept(self, noexcept):
@@ -4415,6 +4421,9 @@ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='
44154421
if self.mutable is not None and 'mutable' not in already_processed:
44164422
already_processed.add('mutable')
44174423
outfile.write(' mutable=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.mutable), input_name='mutable')), ))
4424+
if self.thread_local is not None and 'thread_local' not in already_processed:
4425+
already_processed.add('thread_local')
4426+
outfile.write(' thread_local=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.thread_local), input_name='thread_local')), ))
44184427
if self.noexcept is not None and 'noexcept' not in already_processed:
44194428
already_processed.add('noexcept')
44204429
outfile.write(' noexcept=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.noexcept), input_name='noexcept')), ))
@@ -4675,6 +4684,11 @@ def buildAttributes(self, node, attrs, already_processed):
46754684
already_processed.add('mutable')
46764685
self.mutable = value
46774686
self.validate_DoxBool(self.mutable) # validate type DoxBool
4687+
value = find_attr_value_('thread_local', node)
4688+
if value is not None and 'thread_local' not in already_processed:
4689+
already_processed.add('thread_local')
4690+
self.thread_local = value
4691+
self.validate_DoxBool(self.thread_local) # validate type DoxBool
46784692
value = find_attr_value_('noexcept', node)
46794693
if value is not None and 'noexcept' not in already_processed:
46804694
already_processed.add('noexcept')

src/classdef.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3317,7 +3317,7 @@ void ClassDefImpl::writeMemberList(OutputList &ol) const
33173317
(prot!=Protection::Public || (virt!=Specifier::Normal && getLanguage()!=SrcLangExt::ObjC) ||
33183318
md->isFriend() || md->isRelated() || md->isExplicit() ||
33193319
md->isMutable() || (md->isInline() && Config_getBool(INLINE_INFO)) ||
3320-
md->isSignal() || md->isSlot() ||
3320+
md->isSignal() || md->isSlot() || md->isThreadLocal() ||
33213321
(getLanguage()==SrcLangExt::IDL &&
33223322
(md->isOptional() || md->isAttribute() || md->isUNOProperty())) ||
33233323
md->isStatic() || lang==SrcLangExt::VHDL
@@ -3337,6 +3337,7 @@ void ClassDefImpl::writeMemberList(OutputList &ol) const
33373337
sl.emplace_back("inline");
33383338
if (md->isExplicit()) sl.emplace_back("explicit");
33393339
if (md->isMutable()) sl.emplace_back("mutable");
3340+
if (md->isThreadLocal()) sl.emplace_back("thread_local");
33403341
if (prot==Protection::Protected) sl.emplace_back("protected");
33413342
else if (prot==Protection::Private) sl.emplace_back("private");
33423343
else if (prot==Protection::Package) sl.emplace_back("package");

src/doxygen.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6690,6 +6690,11 @@ static void findMember(const Entry *root,
66906690
spec.setMutable(true);
66916691
done=false;
66926692
}
6693+
if (funcDecl.stripPrefix("thread_local "))
6694+
{
6695+
spec.setThreadLocal(true);
6696+
done=false;
6697+
}
66936698
if (funcDecl.stripPrefix("virtual "))
66946699
{
66956700
done=false;

src/memberdef.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
126126
bool isInline() const override;
127127
bool isExplicit() const override;
128128
bool isMutable() const override;
129+
bool isThreadLocal() const override;
129130
bool isGettable() const override;
130131
bool isPrivateGettable() const override;
131132
bool isProtectedGettable() const override;
@@ -675,6 +676,8 @@ class MemberDefAliasImpl : public DefinitionAliasMixin<MemberDef>
675676
{ return getMdAlias()->isExplicit(); }
676677
bool isMutable() const override
677678
{ return getMdAlias()->isMutable(); }
679+
bool isThreadLocal() const override
680+
{ return getMdAlias()->isThreadLocal(); }
678681
bool isGettable() const override
679682
{ return getMdAlias()->isGettable(); }
680683
bool isPrivateGettable() const override
@@ -2831,6 +2834,7 @@ StringVector MemberDefImpl::getLabels(const Definition *container) const
28312834
if (inlineInfo && isInline()) sl.emplace_back("inline");
28322835
if (isExplicit()) sl.emplace_back("explicit");
28332836
if (isMutable()) sl.emplace_back("mutable");
2837+
if (isThreadLocal()) sl.emplace_back("thread_local");
28342838
if (isStatic()) sl.emplace_back("static");
28352839
if (isGettable()) sl.emplace_back("get");
28362840
if (isProtectedGettable()) sl.emplace_back("protected get");
@@ -5272,6 +5276,11 @@ bool MemberDefImpl::isMutable() const
52725276
return m_memSpec.isMutable();
52735277
}
52745278

5279+
bool MemberDefImpl::isThreadLocal() const
5280+
{
5281+
return m_memSpec.isThreadLocal();
5282+
}
5283+
52755284
bool MemberDefImpl::isGettable() const
52765285
{
52775286
return m_memSpec.isGettable();

src/memberdef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ class MemberDef : public Definition
128128
virtual bool isInline() const = 0;
129129
virtual bool isExplicit() const = 0;
130130
virtual bool isMutable() const = 0;
131+
virtual bool isThreadLocal() const = 0;
131132
virtual bool isGettable() const = 0;
132133
virtual bool isPrivateGettable() const = 0;
133134
virtual bool isProtectedGettable() const = 0;

src/scanner.l

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,6 +1326,10 @@ NONLopt [^\n]*
13261326
yyextra->current->spec.setMutable(true);
13271327
lineCount(yyscanner);
13281328
}
1329+
<FindMembers>{B}*"thread_local"{BN}+ { if (yyextra->insideJava) REJECT;
1330+
yyextra->current->spec.setThreadLocal(true);
1331+
lineCount(yyscanner);
1332+
}
13291333
<FindMembers>{B}*"explicit"{BN}+ { if (yyextra->insideJava) REJECT;
13301334
yyextra->current->spec.setExplicit(true);
13311335
lineCount(yyscanner);

src/sqlite3gen.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ const char * table_schema[][2] = {
189189
"\tvolatile INTEGER DEFAULT 0, -- 0:no 1:yes\n"
190190
"\tvirt INTEGER DEFAULT 0, -- 0:no 1:virtual 2:pure-virtual\n"
191191
"\tmutable INTEGER DEFAULT 0, -- 0:no 1:yes\n"
192+
"\tthread_local INTEGER DEFAULT 0, -- 0:no 1:yes\n"
192193
"\tinitonly INTEGER DEFAULT 0, -- 0:no 1:yes\n"
193194
"\tattribute INTEGER DEFAULT 0, -- 0:no 1:yes\n"
194195
"\tproperty INTEGER DEFAULT 0, -- 0:no 1:yes\n"
@@ -623,6 +624,7 @@ SqlStmt memberdef_insert={
623624
"volatile,"
624625
"virt,"
625626
"mutable,"
627+
"thread_local,"
626628
"initonly,"
627629
"attribute,"
628630
"property,"
@@ -682,6 +684,7 @@ SqlStmt memberdef_insert={
682684
":volatile,"
683685
":virt,"
684686
":mutable,"
687+
":thread_local,"
685688
":initonly,"
686689
":attribute,"
687690
":property,"
@@ -1693,6 +1696,7 @@ static void generateSqlite3ForMember(const MemberDef *md, struct Refid scope_ref
16931696
if (md->memberType() == MemberType::Variable)
16941697
{
16951698
bindIntParameter(memberdef_insert,":mutable",md->isMutable());
1699+
bindIntParameter(memberdef_insert,":thread_local",md->isThreadLocal());
16961700
bindIntParameter(memberdef_insert,":initonly",md->isInitonly());
16971701
bindIntParameter(memberdef_insert,":attribute",md->isAttribute());
16981702
bindIntParameter(memberdef_insert,":property",md->isProperty());

src/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ class LocalToc
645645
/* 50 */ TSPEC(Default) TSPEC(Delete) TSPEC(NoExcept) TSPEC(Attribute) TSPEC(Property) \
646646
/* 55 */ TSPEC(Readonly) TSPEC(Bound) TSPEC(Constrained) TSPEC(Transient) TSPEC(MaybeVoid) \
647647
/* 60 */ TSPEC(MaybeDefault) TSPEC(MaybeAmbiguous) TSPEC(Published) TSPEC(ConstEval) TSPEC(ConstInit) \
648-
/* 65 */ TSPEC(NoDiscard)
648+
/* 65 */ TSPEC(NoDiscard) TSPEC(ThreadLocal)
649649

650650
/** Wrapper class for a number of boolean properties.
651651
* The properties are packed together, and initialized to false.

src/xmlgen.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,10 @@ static void generateXMLForMember(const MemberDef *md,TextStream &ti,TextStream &
904904
if (md->isMutable()) t << "yes"; else t << "no";
905905
t << "\"";
906906

907+
t << " thread_local=\"";
908+
if (md->isThreadLocal()) t << "yes"; else t << "no";
909+
t << "\"";
910+
907911
if (md->isInitonly())
908912
{
909913
t << " initonly=\"yes\"";

templates/xml/compound.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@
221221
<xsd:attribute name="virt" type="DoxVirtualKind" use="optional"/>
222222
<xsd:attribute name="volatile" type="DoxBool" use="optional"/>
223223
<xsd:attribute name="mutable" type="DoxBool" use="optional"/>
224+
<xsd:attribute name="thread_local" type="DoxBool" use="optional"/>
224225
<xsd:attribute name="noexcept" type="DoxBool" use="optional"/>
225226
<xsd:attribute name="noexceptexpression" type="xsd:string" use="optional"/>
226227
<xsd:attribute name="nodiscard" type="DoxBool" use="optional"/>

0 commit comments

Comments
 (0)