compile: LOCATE_* as static const strings
authorJean Privat <jean@pryen.org>
Wed, 5 Jan 2011 03:42:19 +0000 (22:42 -0500)
committerJean Privat <jean@pryen.org>
Wed, 5 Jan 2011 03:42:19 +0000 (22:42 -0500)
Do not use macros to factorize strings but static const strings.
This way the strings are stored in the RO segment of the binary.

Signed-off-by: Jean Privat <jean@pryen.org>

src/compiling/compiling_icode.nit

index 9c79e8b..4623ed3 100644 (file)
@@ -266,7 +266,7 @@ redef class IRoutine
                else
                        p = cparams.join(", ")
                end
-               if human_name != null then v.add_decl("#define LOCATE_{cname} \"{human_name}\"")
+               if human_name != null then v.add_decl("static const char * const LOCATE_{cname} = \"{human_name}\";")
                v.add_decl("{r} {cname}({p});")
                v.add_decl("typedef {r} (*{cname}_t)({p});")
                v.add_instr("{r} {cname}({p})\{")