Skip to content

Commit

Permalink
transforms.llvm_ir_generator: use private linkage instead of internal.
Browse files Browse the repository at this point in the history
This reduces the size of symbol tables (internal adds an STB_LOCAL
symbol, but private doesn't).
whitequark committed Feb 25, 2016
1 parent 6bd16e4 commit 82a8e81
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions artiq/compiler/transforms/llvm_ir_generator.py
Original file line number Diff line number Diff line change
@@ -485,7 +485,7 @@ def rpc_tag_error(typ):
])
llrpcattr.global_constant = True
llrpcattr.unnamed_addr = True
llrpcattr.linkage = 'internal'
llrpcattr.linkage = 'private'

return llrpcattr

@@ -499,14 +499,14 @@ def rpc_tag_error(typ):
llrpcattrs + [ll.Constant(llrpcattrty.as_pointer(), None)])
llrpcattrary.global_constant = True
llrpcattrary.unnamed_addr = True
llrpcattrary.linkage = 'internal'
llrpcattrary.linkage = 'private'

llobjectaryty = ll.ArrayType(llptr, len(llobjects[typ]) + 1)
llobjectary = ll.GlobalVariable(self.llmodule, llobjectaryty,
name="objects.{}".format(type_name))
llobjectary.initializer = ll.Constant(llobjectaryty,
llobjects[typ] + [ll.Constant(llptr, None)])
llobjectary.linkage = 'internal'
llobjectary.linkage = 'private'

lldesc = ll.GlobalVariable(self.llmodule, lldescty,
name="desc.{}".format(type_name))
@@ -515,7 +515,7 @@ def rpc_tag_error(typ):
llobjectary.bitcast(llptr.as_pointer())
])
lldesc.global_constant = True
lldesc.linkage = 'internal'
lldesc.linkage = 'private'
lldescs.append(lldesc)

llglobaldescty = ll.ArrayType(lldescty.as_pointer(), len(lldescs) + 1)
@@ -529,7 +529,7 @@ def process_function(self, func):
self.llfunction = self.map(func)

if func.is_internal:
self.llfunction.linkage = 'internal'
self.llfunction.linkage = 'private'

self.llfunction.attributes.add('uwtable')

0 comments on commit 82a8e81

Please sign in to comment.