Changes between Version 11 and Version 12 of Commentary/Compiler/StrictnessAnalysis/KirstenNotes


Ignore:
Timestamp:
Nov 6, 2006 10:20:57 PM (7 years ago)
Author:
kirsten
Comment:

ticky counter declarations

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/StrictnessAnalysis/KirstenNotes

    v11 v12  
    3939 
    4040Argh! I spent days tracking down this bug: {{{idInfoLabelType}}} in [[GhcFile(compiler/cmm/CLabel.hs)]] needs to return {{{DataLabel}}} for labels of type {{{RednCount}}} (i.e., labels for ticky counters.) By default, it was returning {{{CodeLabel}}}, which caused the ticky counter labels to get declared with the wrong type in the generated C, which caused C compiler errors. 
     41 
     42== Declarations for ticky counters == 
     43 
     44{{{emitTickyCounter}}} spits out C declarations that look like this: 
     45{{{ 
     46static char c16O_str[] = "main:Main.$wrepeated{v r4}"; 
     47 
     48static char c16Q_str[] = "i"; 
     49 
     50StgWord Main_zdwrepeated_ct[] = { 
     510x0, 0x1U, 0x1U, 0x0, (W_)&c16O_str, (W_)&c16Q_str, 0x0, 0x0, 0x0 
     52}; 
     53}}} 
     54Here, {{{Main_zdwrepeated_ct}}} is actually an {{{StgEntCounter}}} (this type is declared in [[GhcFile(includes/StgTicky.h)]]). The counters get used by {{{printRegisteredCounterInfo}}} in [[GhcFile(rts/Ticky.c)]], which prints out the ticky reports.