Ticket #2132: 0001-pct-Add-file-annotations-to-generated-PIR.patch

File 0001-pct-Add-file-annotations-to-generated-PIR.patch, 1.0 KB (added by benabik, 3 years ago)

File Annotations

  • compilers/pct/src/POST/Compiler.pir

    From 6afb0ae02319c56080dec9ffb902f02471331595 Mon Sep 17 00:00:00 2001
    From: Brian Gernhardt <brian.gernhardt@mail.rit.edu>
    Date: Thu, 16 Jun 2011 15:51:29 -0400
    Subject: [PATCH] [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
    ---
     compilers/pct/src/POST/Compiler.pir |    8 ++++++++
     1 files changed, 8 insertions(+), 0 deletions(-)
    
    diff --git a/compilers/pct/src/POST/Compiler.pir b/compilers/pct/src/POST/Compiler.pir
    index bf8b9bf..0e4c6e2 100644
    a b  
    397397    goto param_loop 
    398398  paramlist_done: 
    399399 
     400    ## Add a file annotation 
     401    .local pmc files 
     402    files = find_caller_lex '$?FILES' 
     403    if null files goto no_files 
     404    unless files goto no_files 
     405    subpir.'append_format'(".annotate 'file', '%0'\n", files) 
     406  no_files: 
     407 
    400408    self.'pir_children'(node) 
    401409    subpir.'append_format'(".end\n\n") 
    402410