Changes in / [7ff3e522:f8d05ee]


Ignore:
Files:
1 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    r7ff3e522 rf8d05ee  
    2424#Trasforming cc1 will break compilation
    2525M4CFA_PROGRAM_NAME
     26
     27#==============================================================================
     28# New AST toggling support
     29AH_TEMPLATE([CFA_USE_NEW_AST],[Sets whether or not to use the new-ast, this is adefault value and can be overrided by --old-ast and --new-ast])
     30AC_ARG_ENABLE(new-ast,
     31        [  --enable-new-ast     whether or not to use new ast as the default AST algorithm],
     32        [case "${enableval}" in
     33                yes) newast=true ;;
     34                no)  newast=false ;;
     35                *) AC_MSG_ERROR([bad value ${enableval} for --enable-new-ast]) ;;
     36        esac],[newast=false])
     37AC_DEFINE_UNQUOTED([CFA_USE_NEW_AST], $newast)
    2638
    2739#==============================================================================
  • src/CompilationState.cc

    r7ff3e522 rf8d05ee  
    1414//
    1515
     16#include "config.h"
     17
    1618int
    1719        astp = false,
     
    2830        genproto = false,
    2931        deterministic_output = false,
     32        useNewAST = CFA_USE_NEW_AST,
    3033        nomainp = false,
    3134        parsep = false,
  • src/CompilationState.h

    r7ff3e522 rf8d05ee  
    2929        genproto,
    3030        deterministic_output,
     31        useNewAST,
    3132        nomainp,
    3233        parsep,
  • src/config.h.in

    r7ff3e522 rf8d05ee  
    2727/* Location of cfa install. */
    2828#undef CFA_PREFIX
     29
     30/* Sets whether or not to use the new-ast, this is adefault value and can be
     31   overrided by --old-ast and --new-ast */
     32#undef CFA_USE_NEW_AST
    2933
    3034/* Major.Minor */
  • src/main.cc

    r7ff3e522 rf8d05ee  
    340340                } // if
    341341
    342                 // PASS( "Resolve", ResolvExpr::resolve( translationUnit ) );
    343                 {
     342                if( useNewAST) {
    344343                        auto transUnit = convert( move( translationUnit ) );
    345344                        PASS( "Resolve", ResolvExpr::resolve( transUnit ) );
    346345                        translationUnit = convert( move( transUnit ) );
     346                } else {
     347                        PASS( "Resolve", ResolvExpr::resolve( translationUnit ) );
    347348                }
    348349
     
    464465        { "prototypes", no_argument, nullptr, 'p' },
    465466        { "deterministic-out", no_argument, nullptr, 'd' },
     467        { "old-ast", no_argument, nullptr, 'O'},
     468        { "new-ast", no_argument, nullptr, 'A'},
    466469        { "print", required_argument, nullptr, 'P' },
    467470        { "prelude-dir", required_argument, nullptr, PreludeDir },
     
    485488        "generate prototypes for prelude functions",            // -p
    486489        "don't print output that isn't deterministic",        // -d
     490        "Use the old-ast",                                    // -O
     491        "Use the new-ast",                                    // -A
    487492        "print",                                              // -P
    488493        "<directory> prelude directory for debug/nodebug",      // no flag
     
    590595                        break;
    591596                  case 'd':                                     // don't print non-deterministic output
    592                     deterministic_output = true;
     597                        deterministic_output = true;
     598                        break;
     599                  case 'O':                                     // don't print non-deterministic output
     600                        useNewAST = false;
     601                        break;
     602                  case 'A':                                     // don't print non-deterministic output
     603                        useNewAST = true;
    593604                        break;
    594605                  case 'P':                                                                             // print options
Note: See TracChangeset for help on using the changeset viewer.