[cfe-dev] Disallow rtti
David Chisnall via cfe-dev
cfe-dev at lists.llvm.org
Wed Oct 25 01:25:07 PDT 2017
On 24 Oct 2017, at 18:48, Martin J. O'Riordan via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> I have not found the overhead of RTTI to be a significant burden (even for embedded with a 128KB memory size constraint)
With only 128KB of ROM, you’re going to find it hard to fit a C++ runtime library (though if you rip out the demangler you’ll save quite a lot), so even if you compile with RTTI, you won’t be able to use it or throw exceptions. A stack unwinder plus the C++ personality function can easily add up to more than the ROM on such devices. It’s possible to fit just enough support for dynamic_cast on such a system, but it’s somewhat awkward to have dynamic_cast working but exceptions not working.
More information about the cfe-dev