On Tuesday, 20 June 2017 at 09:46:13 UTC, Dan Walmsley wrote:

No longer compiles:

"Error: Missing class declaration: ModuleInfo

but then ldc crashes...

I had to use code from my minimal runtime experiment here and merge it with some of the code in the TypeInfo bloat issue. Here's code that compiles.

object.d
https://dpaste.dzfl.pl/f7496296301a

test.d
https://dpaste.dzfl.pl/6a97b6f7fccf

How to compile
-------------------------------
`ldc2 --version`
LDC - the LLVM D compiler (1.2.0):
  based on DMD v2.072.2 and LLVM 4.0.0
  built with DMD64 D Compiler v2.074.0
  Default target: x86_64-unknown-linux-gnu

`ldc2 -m64 -defaultlib= -debuglib= -conf= -betterC -release object.d test.d -oftest`

`objdump -s -j .rodata test`

test:     file format elf64-x86-64

Contents of section .rodata:
 4005fd 74657374 2e546573 74436c61 73733100  test.TestClass1.
 40060d 74657374 2e546573 74436c61 73733200  test.TestClass2.
 40061d 74657374 2e546573 74436c61 73733300  test.TestClass3.
 40062d 74657374 2e546573 74436c61 73733400  test.TestClass4.
 40063d 74657374 2e546573 74436c61 73733500  test.TestClass5.
 40064d 74657374 2e546573 74436c61 73733600  test.TestClass6.
 40065d 74657374 2e546573 74436c61 73733700  test.TestClass7.
 40066d 74657374 2e546573 74436c61 73733800  test.TestClass8.
 40067d 74657374 2e546573 74436c61 73733900  test.TestClass9.
 40068d 48656c6c 6f0a006f 626a6563 742e4f62  Hello..object.Ob
 40069d 6a656374 006f626a 6563742e 54797065  ject.object.Type
 4006ad 496e666f 00547970 65496e66 6f5f5374  Info.TypeInfo_St
 4006bd 72756374 00547970 65496e66 6f5f436c  ruct.TypeInfo_Cl
 4006cd 61737300 54797065 496e666f 5f456e75  ass.TypeInfo_Enu
 4006dd 6d005479 7065496e 666f5f43 6f6e7374  m.TypeInfo_Const
 4006ed 006f626a 6563742e 4572726f 7200      .object.Error.


RESULT
------
* The TypeInfo bloat problem still exists.
* The problem is even worse as you now have to add even more silly hacks and stubs to get a build.

This problem has been known for more than 3 years, and it's only getting worse. Move on. There are better alternatives.

Mike


Reply via email to