Skip to content

Restore template-argument ctferef on newer libdparse - #6

Open
Silvia-weka wants to merge 1 commit into
masterfrom
named-template-argument-ctfe
Open

Restore template-argument ctferef on newer libdparse#6
Silvia-weka wants to merge 1 commit into
masterfrom
named-template-argument-ctfe

Conversation

@Silvia-weka

Copy link
Copy Markdown
Collaborator

The submodule pin moved to weka/libdparse, whose upstream merge added named template arguments: TemplateArguments now holds a NamedTemplateArgumentList of NamedTemplateArgument, and plain TemplateArgument is no longer produced for an instantiation's arguments. ScopeInfoVisitor's visit(const TemplateArgument) therefore became dead code, and every template-value-argument CTFE root went unreported -- both Foo!(3 + bareVal) and the ut!({ ... }) lambda form, whose body is compile-time-evaluated.

Measured over 400 weka/**.d files, against the previous libdparse pin: -7381 ctferef, -748 ctferef_tmpl. With this override added, the same build is a strict superset of that baseline -- nothing dropped, plus 203 call / 29 ctferef_tmpl / 26 ifaceref / 19 instance / 6 ctferef the newer parser now sees. The older TemplateArgument override is kept so the visitor works against either libdparse.

tests/verify-scope-info.d already covers the case (InstantiateWithValue!(...)).

The submodule pin moved to weka/libdparse, whose upstream merge added named
template arguments: TemplateArguments now holds a NamedTemplateArgumentList of
NamedTemplateArgument, and plain TemplateArgument is no longer produced for an
instantiation's arguments. ScopeInfoVisitor's visit(const TemplateArgument)
therefore became dead code, and every template-value-argument CTFE root went
unreported -- both `Foo!(3 + bareVal)` and the `ut!({ ... })` lambda form, whose
body is compile-time-evaluated.

Measured over 400 weka/**.d files, against the previous libdparse pin: -7381
ctferef, -748 ctferef_tmpl. With this override added, the same build is a strict
superset of that baseline -- nothing dropped, plus 203 call / 29 ctferef_tmpl /
26 ifaceref / 19 instance / 6 ctferef the newer parser now sees. The older
TemplateArgument override is kept so the visitor works against either libdparse.

tests/verify-scope-info.d already covers the case (InstantiateWithValue!(...)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant