forked from M-Labs/artiq
Mark string constants as unnamed_addr.
As a result they will be merged when possible.
This commit is contained in:
parent
49ece6a12a
commit
7301a76d68
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue