Mark string constants as unnamed_addr.

As a result they will be merged when possible.
This commit is contained in:
whitequark 2015-07-21 17:10:31 +03:00
parent 49ece6a12a
commit 7301a76d68

View File

@ -83,6 +83,7 @@ class LLVMIRGenerator:
llconst = ll.GlobalVariable(self.llmodule, llstrty,
name=self.llmodule.get_unique_name("str"))
llconst.global_constant = True
llconst.unnamed_addr = True
llconst.initializer = ll.Constant(llstrty, bytearray(as_bytes))
return llconst.bitcast(ll.IntType(8).as_pointer())
else: