Skip to content
Browse files

[pct] Add file annotations to generated PIR

This allows all users of PCT::HLLCompiler to keep knowledge of the
source file in the final result.

Closes TT #2132
  • Loading branch information...
1 parent 6e4dc98 commit 6afb0ae02319c56080dec9ffb902f02471331595 @Benabik Benabik committed
Showing with 8 additions and 0 deletions.
  1. +8 −0 compilers/pct/src/POST/Compiler.pir
View
8 compilers/pct/src/POST/Compiler.pir
@@ -397,6 +397,14 @@ the sub.
goto param_loop
paramlist_done:
+ ## Add a file annotation
+ .local pmc files
+ files = find_caller_lex '$?FILES'
+ if null files goto no_files
+ unless files goto no_files
+ subpir.'append_format'(".annotate 'file', '%0'\n", files)
+ no_files:
+
self.'pir_children'(node)
subpir.'append_format'(".end\n\n")

0 comments on commit 6afb0ae

Please sign in to comment.
Something went wrong with that request. Please try again.