Note [Compilation plan for top-level string literals]
Here is a summary on how top-level string literals are handled by various parts of the compilation pipeline. * In the source language, there is no way to bind a primitive string literal at the top level. * In Core, we have a special rule that permits top-level Addr# bindings. See Note [Core top-level string literals]. Core-to-core passes may introduce new top-level string literals. See GHC.Core.Utils.exprIsTopLevelBindable, and exprIsTickedString * In STG, top-level string literals are explicitly represented in the syntax tree. * A top-level string literal may end up exported from a module. In this case, in the object file, the content of the exported literal is given a label with the _bytes suffix.
References 1
- Core top-level string literals GHC.Core
Referenced by 2
- Core top-level string literals GHC.Core
- Generating code for top-level string literal bindings GHC.StgToByteCode