New expression in ToElemVisitor

Jacob Carlborg doob at me.com
Wed Aug 22 19:10:48 UTC 2018


On 2018-08-20 14:03, kinke wrote:
> On Monday, 20 August 2018 at 11:30:15 UTC, Jacob Carlborg wrote:
>> You mean an instance of `TypePointer`?
> 
> Something like `DImValue(Type::tvoidptr, DtoBitCast(myLLGlobal, 
> getVoidPtrType())` (a DLValue would be preferrable, but you'd probably 
> need a proper D type then). But what's the type of your new Expression? 
> Do you have some code to show?

Not in LDC, yet, but in DMD. The new expression is defined here [1], 
getRuntimeMetaclass here [2] and setMetaclass here [3]. This is the code 
returning the elem value of the expression [4]. getClassReference is 
defined here [5].

[1] 
https://github.com/dlang/dmd/blob/3d289d3ea100bda6a2b25c5e43779d7dd487281f/src/dmd/expression.d#L6500-L6515

[2] 
https://github.com/dlang/dmd/blob/3d289d3ea100bda6a2b25c5e43779d7dd487281f/src/dmd/objc.d#L427-L438

[3] 
https://github.com/dlang/dmd/blob/3d289d3ea100bda6a2b25c5e43779d7dd487281f/src/dmd/objc.d#L485-L528

[4] 
https://github.com/dlang/dmd/blob/3d289d3ea100bda6a2b25c5e43779d7dd487281f/src/dmd/objc_glue.d#L143-L146

[5] 
https://github.com/dlang/dmd/blob/3d289d3ea100bda6a2b25c5e43779d7dd487281f/src/dmd/objc_glue.d#L449-L479

-- 
/Jacob Carlborg


More information about the digitalmars-d-ldc mailing list