Skip to content

Commit 91a8c3c

Browse files
committed
add SpecializationInfo
1 parent f9aa994 commit 91a8c3c

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

include/mrdox/Metadata/Template.hpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,36 @@ struct TArg
191191

192192
// ----------------------------------------------------------------
193193

194+
// stores information pertaining to an explicit specialization of a
195+
// member of an implicitly instantiated class template specialization.
196+
// this structure is stored in the TemplateInfo corresponding to the
197+
// outermost specialized template. if the explicitly specialized
198+
// member is itself a member of a nested template, the SpecializationInfo
199+
// which stores the arguments for the parent template will additionally
200+
// store a pointer to the SpecializationInfo for the nested template,
201+
// recursively. each SpecializationInfo node contains a vector of
202+
// SymbolIDs pairs `(specialized, primary)`, where `specialized` is the
203+
// replacement definition of `primary` for the given set of template
204+
// arguments of its parent template(s).
205+
struct SpecializationInfo
206+
{
207+
// template arguments a parent template is specialized for
208+
std::vector<TArg> Args;
209+
210+
// ID of the template to which the arguments pertain
211+
SymbolID Template;
212+
213+
// SpecializationInfo for nested templates which are also specialized
214+
std::vector<SpecializationInfo> Nested;
215+
216+
// SymbolID pairs of any specialized members.
217+
// the first element is the ID of the original member (i.e. member that is replaced)
218+
// the second element is the ID of the specialized member (i.e. replacement)
219+
std::vector<std::pair<SymbolID, SymbolID>> Members;
220+
};
221+
222+
// ----------------------------------------------------------------
223+
194224
enum class TemplateSpecKind
195225
{
196226
Primary = 0, // for bitstream
@@ -218,6 +248,10 @@ struct TemplateInfo
218248
// for partial and explicit specializations
219249
OptionalSymbolID Primary;
220250

251+
// stores information for explicit specializations of members
252+
// of implicitly instantiated class template specializations
253+
std::vector<SpecializationInfo> Specializations;
254+
221255
// KRYSTIAN NOTE: using the presence of args/params
222256
// to determine the specialization kind *should* work.
223257
// emphasis on should.

0 commit comments

Comments
 (0)