Need clarification on dmd symbol generation

kenji hara k.hara.pg at gmail.com
Wed Apr 10 05:36:17 PDT 2013


2013/4/10 Dicebot <m.strashun at gmail.com>

> On Wednesday, 10 April 2013 at 09:37:44 UTC, kenji hara wrote:
>
>> OK. I don't understand the issue enough, but I'd like to help you.
>>
>> - TemplateInstance::tinst may represent the enclosing template instance
>> that 'this' instance is instantiated. It is set in
>> TemplateInstance::semantic(|2|**3) for its member's semantic process.
>>
>> - TemplateInstance::enclosing may represent the parent of nested template
>> instance. If a template is instantiated in function scope with implicit
>> context, it points the function. It is set in
>> TemplateInstance::**hasNestedArgs.
>>
>> - Module::importedFrom may represents the "root module" of import chain.
>> it
>> points one of the module that listed in command line.
>>
>> Good luck.
>>
>> Kenji Hara
>>
>
> I see no TemplateInstance::enclosing, only Scope::enclosing and
> TemplateInstance is not Scope descendant.


Very recently TemplateInstance::isnested is renamed to
TemplateInstance::enclosing.


> Essentially I need to emit symbols not for "importedFrom" module but for
> module of top-most tinst in chain. I supposed that iterating tinst can do
> the trick, but it is not. For example, when map is used, it call templated
> range functions somewhere down the line and iterating up from those don't
> get you initial map call scope. (Same issue in printInstantiationTrace as
> it uses this method).
>

It sounds that using TemplateInstance::enclosing is correct.

Kenji Hara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130410/e5ec76c1/attachment.html>


More information about the Digitalmars-d mailing list