Skip to content
This repository

Debug string literal pooling #133

Open
klickverbot opened this Issue · 5 comments

2 participants

David Nadlinger Kai Nacke
David Nadlinger
Owner

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…

David Nadlinger
Owner

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

David Nadlinger
Owner

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

David Nadlinger
Owner

We should mark string constants as unnamed_addr.

David Nadlinger
Owner

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

Kai Nacke redstar referenced this issue from a commit
Kai Nacke redstar Mark frontend generated strings with attribute unnamed_addr.
This is part of a fix for issue #133.
6875d8a
Kai Nacke
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.