www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Turn output of -vtemplates into compiler-messages and show template

reply Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
D just got a better formatting of existing template usage sorted 
by descending unique instantiation count via the flag 
`-vtemplates`. Each template that has a least one instantiation 
is now printed using standard compiler diagnostics formatting for 
easy navigation to the point of its declaration.

Additionally, a new feature is to instead of

     `-vtemplates`

use

     `-vtemplates=list-instances`

. Then the location(s) for each instance of each instantiated 
template is printed along with information telling whether the 
instantiation was implicit or explicit.

A good example of the behavior can be found in the test file [2]

[1] https://github.com/dlang/dmd/pull/11463
[2] 
https://github.com/nordlow/dmd/blob/6b69ff7f0676314953344b5c920d960c023b3134/test/compilable/vtemplates_list.d
Sep 03
parent reply jmh530 <john.michael.hall gmail.com> writes:
On Thursday, 3 September 2020 at 13:13:40 UTC, Per Nordlöw wrote:
 D just got a better formatting of existing template usage 
 sorted by descending unique instantiation count via the flag 
 `-vtemplates`. Each template that has a least one instantiation 
 is now printed using standard compiler diagnostics formatting 
 for easy navigation to the point of its declaration.

 [snip]
Nice. People also might find it useful to filter for just one template (and show all the instances).
Sep 03
parent Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
On Thursday, 3 September 2020 at 13:20:32 UTC, jmh530 wrote:
 People also might find it useful to filter for just one 
 template (and show all the instances).
I proposed that feature as, say, `vtemplates=list-instances:Template1,Template2,...` . Just complain a bit and I'll get momentum to add that too ;)
Sep 03