summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index 3c847809f..e5ff03fae 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -45,6 +45,19 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
}
}
+ void visit(Expression* curr) {
+ if (currFunction) {
+ // show an annotation, if there is one
+ auto& annotations = currFunction->annotations;
+ auto iter = annotations.find(curr);
+ if (iter != annotations.end()) {
+ o << ";; " << iter->second << '\n';
+ doIndent(o, indent);
+ }
+ }
+ Visitor<PrintSExpression>::visit(curr);
+ }
+
void setMinify(bool minify_) {
minify = minify_;
maybeSpace = minify ? "" : " ";