Debug string literal pooling #133

Closed
klickverbot opened this Issue Jun 26, 2012 · 8 comments

Projects

None yet

3 participants

@klickverbot
Member

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…

@klickverbot
Member

This seems to apply not only to assert(this) checks, but to all kinds of string literals.

@klickverbot
Member

Just to clarify, the LLVM constant merger pass does catch this on optimized builds.

@klickverbot
Member

We should mark string constants as unnamed_addr.

@klickverbot
Member

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).

@redstar redstar added a commit that referenced this issue Aug 18, 2013
@redstar redstar Mark frontend generated strings with attribute unnamed_addr.
This is part of a fix for issue #133.
6875d8a
@redstar
Member
redstar commented Aug 18, 2013

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.

@dmakarov
Contributor

This is issue overlaps with the issue #898 and should be resolved when/if PR #896 is merged.

@dmakarov
Contributor

shouldn't the issue be closed?

@klickverbot
Member

I guess so, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment