Changeset 1699

Show
Ignore:
Timestamp:
10/21/08 20:06:10 (3 months ago)
Author:
Chuck.Esterbrook
Message:

Add compile option -include-traces default value yes to allow compile time suppression of any trace code.

credit:hopscc, Chuck
ticket:32

Location:
cobra/trunk
Files:
1 added
5 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Developer/IntermediateReleaseNotes.text

    r1683 r1699  
    7373     parenthesised expressions. 
    7474 
     75* Add compile option -include-traces default value yes to allow compile time suppression of any trace code. 
     76  
    7577* Added a new built-in doc tool accessible via "cobra -doc ...". The documentation is generated to local HTML files using your declarations, doc strings, contracts, etc. 
    7678 
  • cobra/trunk/Source/CommandLine.cobra

    r1698 r1699  
    154154                }, 
    155155                { 
     156                        'name': 'include-traces', 
     157                        'type': 'bool', 
     158                        'default': 'yes', 
     159                        'description': 'Includes trace statements in the output assembly.', 
     160                }, 
     161                { 
    156162                        'name': 'keep-intermediate-files', 
    157163                        'synonyms': ['kif'], 
     
    278284                { 
    279285                        'name': 'turbo', 
    280                         'description': 'Maximum run-time performance. This is a convenience for -contracts:none -include-asserts:no -include-nil-checks:no -include-tests:no -optimize', 
     286                        'description': 'Maximum run-time performance. This is a convenience for -contracts:none -include-asserts:no -include-nil-checks:no -include-tests:no -include-traces:no -optimize', 
    281287                        'type': 'bool', 
    282288                }, 
     
    937943                        options['include-nil-checks'] = false 
    938944                        options['include-tests'] = false 
     945                        options['include-traces'] = false 
    939946                        options['optimize'] = true 
    940947                         
  • cobra/trunk/Source/SharpGenerator.cobra

    r1693 r1699  
    26572657        def writeSharpDef(sw as SharpWriter) 
    26582658                base.writeSharpDef(sw) 
    2659                 sw.write('CobraCore.Tracer.Trace([.sharpSourceSite]);\n') 
     2659                if .includeTraces 
     2660                        sw.write('CobraCore.Tracer.Trace([.sharpSourceSite]);\n') 
    26602661 
    26612662 
     
    26652666        def writeSharpDef(sw as SharpWriter) 
    26662667                base.writeSharpDef(sw) 
    2667                 sw.write('CobraCore.Tracer.Trace([.sharpSourceSite], "this", [_codePart.sharpThis]') 
    2668                 for param in _codePart.params 
    2669                         sw.write(', "[param.name]", [param.sharpName]') 
    2670                 for local in _codePart.locals 
    2671                         sw.write(', "[local.name]", [local.sharpName]') 
    2672                 sw.write(');\n') 
     2668                if .includeTraces 
     2669                        sw.write('CobraCore.Tracer.Trace([.sharpSourceSite], "this", [_codePart.sharpThis]') 
     2670                        for param in _codePart.params 
     2671                                sw.write(', "[param.name]", [param.sharpName]') 
     2672                        for local in _codePart.locals 
     2673                                sw.write(', "[local.name]", [local.sharpName]') 
     2674                        sw.write(');\n') 
    26732675 
    26742676 
     
    26782680        def writeSharpDef(sw as SharpWriter) 
    26792681                base.writeSharpDef(sw) 
    2680                 sw.write('CobraCore.Tracer.Trace([.sharpSourceSite]') 
    2681                 sep = ', ' 
    2682                 for expr in _exprs 
    2683                         sw.write('[sep][Utils.sharpStringLiteralFor(expr.toCobraSource)][sep]') 
    2684                         expr.writeSharpDef(sw, false) 
    2685                 sw.write(');\n') 
     2682                if .includeTraces 
     2683                        sw.write('CobraCore.Tracer.Trace([.sharpSourceSite]') 
     2684                        sep = ', ' 
     2685                        for expr in _exprs 
     2686                                sw.write('[sep][Utils.sharpStringLiteralFor(expr.toCobraSource)][sep]') 
     2687                                expr.writeSharpDef(sw, false) 
     2688                        sw.write(');\n') 
    26862689 
    26872690 
  • cobra/trunk/Source/Statements.cobra

    r1656 r1699  
    950950                _codePart = codePart 
    951951 
     952        def includeTraces as bool        
     953                return .compiler.options.boolValue('include-traces') 
     954 
    952955 
    953956class TraceLocationStmt 
  • cobra/trunk/Tests/700-command-line/602-turbo.cobra

    r1371 r1699  
    55        def main is shared 
    66                assert false 
     7                trace  
     8                x = 1 
     9                trace all 
     10                trace x