Currently, we are emitting file name and "null this" as new string constants for each inserted this check assertion, which leads to slight code bloat. Not that this would usually matter in the face of debug info…
This seems to apply not only to assert(this) checks, but to all kinds of string literals.
Just to clarify, the LLVM constant merger pass does catch this on optimized builds.
We should mark string constants as unnamed_addr.
Okay, merged the patch. User- (resp. frontend-) generated string constants are still not marked up with unnamed_addr though. This should be possible if the result type is immutable (and DMD does merge them).
Mark frontend generated strings with attribute unnamed_addr.
This is part of a fix for issue #133.
Frontend generated string constants are now marked with unnamed_addr. Especially "null this" strings are marked.
But the strings are still emitted to the IR file. At least -O2 is needed to merge the strings.
This is issue overlaps with the issue #898 and should be resolved when/if PR #896 is merged.
shouldn't the issue be closed?
I guess so, yes.