mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-25 03:08:27 +08:00
Add printing of SSA functions.
This commit is contained in:
parent
dbdd45acc5
commit
ebe243f8d9
@ -331,4 +331,16 @@ class Function(Value):
|
||||
return "{} @{}".format(types.TypePrinter().name(self.type),
|
||||
escape_name(self.name))
|
||||
|
||||
def __str__(self):
|
||||
printer = types.TypePrinter()
|
||||
lines = []
|
||||
lines.append("{} {}({}) {{ ; type: {}".format(
|
||||
printer.name(self.type.ret), self.name,
|
||||
", ".join([arg.as_operand() for arg in self.arguments]),
|
||||
printer.name(self.type)))
|
||||
for block in self.basic_blocks:
|
||||
lines.append(str(block))
|
||||
lines.append("}")
|
||||
return "\n".join(lines)
|
||||
|
||||
# Python-specific SSA IR classes
|
||||
|
Loading…
Reference in New Issue
Block a user