www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - -fno-rtti (disable RTTI)?

reply Denis Feklushkin <feklushkin.denis gmail.com> writes:
Hi!

Is there any way to disable RTTI? Perhaps some simple compiler 
patch?
May 13 2020
next sibling parent reply IGotD- <nise nise.com> writes:
On Wednesday, 13 May 2020 at 09:49:33 UTC, Denis Feklushkin wrote:
 Hi!

 Is there any way to disable RTTI? Perhaps some simple compiler 
 patch?
What is RTTI in a D language context? -fno-rtti is a switch for C++ compilers and I'm not sure what the equivalent in D would be. Would that be the module info meta data?
May 13 2020
parent Denis Feklushkin <feklushkin.denis gmail.com> writes:
On Wednesday, 13 May 2020 at 10:10:13 UTC, IGotD- wrote:
 On Wednesday, 13 May 2020 at 09:49:33 UTC, Denis Feklushkin 
 wrote:
 Hi!

 Is there any way to disable RTTI? Perhaps some simple compiler 
 patch?
What is RTTI in a D language context? -fno-rtti is a switch for C++ compilers and I'm not sure what the equivalent in D would be. Would that be the module info meta data?
Yes, I mean this thing - text names of types and stuff like that. Maybe you remember that I am trying to port druntime to an embedded system. Now I have a binary about 90KB and I have a suspicion that several kilobytes occupied by type information and exceptions messages.
May 13 2020
prev sibling parent reply kinke <noone nowhere.com> writes:
On Wednesday, 13 May 2020 at 09:49:33 UTC, Denis Feklushkin wrote:
 Is there any way to disable RTTI?
TypeInfos aren't emitted if there's no class TypeInfo in object.d. But then obviously everything that depends on them doesn't work, like associative arrays and GC allocations. - If a struct's TypeInfo isn't used, it should be stripped by the linker.
May 13 2020
next sibling parent "David Nadlinger" <code klickverbot.at> writes:
On 13 May 2020, at 13:09, kinke via digitalmars-d-ldc wrote:
 TypeInfos aren't emitted if there's no class TypeInfo in object.d. But 
 then obviously everything that depends on them doesn't work, like 
 associative arrays and GC allocations. - If a struct's TypeInfo isn't 
 used, it should be stripped by the linker.
In addition to this, there are also LDC_no_moduleinfo/LDC_no_typeinfo for more fine-grained control; see https://wiki.dlang.org/LDC-specific_language_changes#Pragmas. (I haven't use those myself in a while.) — David
May 13 2020
prev sibling parent reply Denis Feklushkin <feklushkin.denis gmail.com> writes:
On Wednesday, 13 May 2020 at 12:09:09 UTC, kinke wrote:
 On Wednesday, 13 May 2020 at 09:49:33 UTC, Denis Feklushkin 
 wrote:
 Is there any way to disable RTTI?
TypeInfos aren't emitted if there's no class TypeInfo in object.d. But then obviously everything that depends on them doesn't work, like associative arrays
Hmm, is suddenly for me. Why AAs needs TypeInfo?
May 14 2020
parent kinke <kinke gmx.net> writes:
On Thursday, 14 May 2020 at 16:05:41 UTC, Denis Feklushkin wrote:
 Hmm, is suddenly for me. Why AAs needs TypeInfo?
See https://github.com/dlang/druntime/blob/master/src/rt/aaA.d - apparently for hashing & equality of keys, plus destruction of keys & values.
May 14 2020