projects
/
openpower-isa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4b556b5
)
oppc/code: do not emit pseudocode unless necessary
author
Dmitry Selyutin
<ghostmansd@gmail.com>
Tue, 16 Jan 2024 19:09:45 +0000
(22:09 +0300)
committer
Dmitry Selyutin
<ghostmansd@gmail.com>
Tue, 16 Jan 2024 19:10:07 +0000
(22:10 +0300)
src/openpower/oppc/pc_code.py
patch
|
blob
|
history
diff --git
a/src/openpower/oppc/pc_code.py
b/src/openpower/oppc/pc_code.py
index 04dcf23630605cfc00dabf232a76364a2564ff3a..bf15f57f2e24f747e7946985dc4df0b97ab83177 100644
(file)
--- a/
src/openpower/oppc/pc_code.py
+++ b/
src/openpower/oppc/pc_code.py
@@
-172,8
+172,9
@@
class CodeVisitor(pc_util.Visitor):
@contextlib.contextmanager
def pseudocode(self, node):
- for (level, stmt) in self.__pseudocode[node]:
- self[node].emit(stmt=f"/* {stmt} */", level=level)
+ if node in self.__pseudocode:
+ for (level, stmt) in self.__pseudocode[node]:
+ self[node].emit(stmt=f"/* {stmt} */", level=level)
yield
@pc_util.Hook(pc_ast.Scope)