forked from M-Labs/artiq
1
0
Fork 0

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
1 changed files with 1 additions and 0 deletions

View File

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