提交 1776fb3a authored 作者: notoraptor's avatar notoraptor

Allow c_support_code() to return a string or a list of strings

(help avoir duplicated support codes in final module code).
上级 fbb066c4
......@@ -914,7 +914,11 @@ class CLinker(link.Linker):
for x in [y.type for y in self.variables] + [
y.op for y in self.node_order]:
try:
ret.append(x.c_support_code())
support_code = x.c_support_code()
if isinstance(support_code, list):
ret.extend(support_code)
else:
ret.append(support_code)
except utils.MethodNotDefined:
pass
return ret
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论