Changeset d41280e for src/main.cc


Ignore:
Timestamp:
Feb 8, 2016, 10:07:42 AM (10 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
c44e622
Parents:
00ede9e (diff), bd85400 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into gc_noraii

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main.cc

    r00ede9e rd41280e  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec 17 12:59:06 2015
    13 // Update Count     : 179
     12// Last Modified On : Wed Jan 27 22:20:20 2016
     13// Update Count     : 199
    1414//
    1515
     
    2424#include "SynTree/Declaration.h"
    2525#include "SynTree/Visitor.h"
    26 #include "GenPoly/InstantiateGeneric.h"
    2726#include "GenPoly/Lvalue.h"
    2827#include "GenPoly/Specialize.h"
     
    4544//#include "Try/Visit.h"
    4645
    47 #include "SemanticError.h"
    48 #include "UnimplementedError.h"
     46#include "Common/SemanticError.h"
     47#include "Common/UnimplementedError.h"
    4948
    5049#include "../config.h"
     
    7069        resolvep = false,                                                                       // used in AlternativeFinder
    7170        symtabp = false,
     71        treep = false,
    7272        validp = false,
    7373        errorp = false,
    7474        codegenp = false;
    7575
    76 enum { Ast, Bresolver, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Validate, };
     76enum { Ast, Bresolver, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, Validate, };
    7777
    7878static struct option long_opts[] = {
     
    8888        { "resolver", no_argument, 0, Resolver },
    8989        { "symbol", no_argument, 0, Symbol },
     90        { "tree", no_argument, 0, Tree },
    9091        { "validate", no_argument, 0, Validate },
    9192        { 0, 0, 0, 0 }
     
    101102       
    102103        int c;
    103         while ( (c = getopt_long( argc, argv, "abefglnpqrsvyzD:", long_opts, &long_index )) != -1 ) {
     104        while ( (c = getopt_long( argc, argv, "abefglnpqrstvyzD:", long_opts, &long_index )) != -1 ) {
    104105                switch ( c ) {
    105106                  case Ast:
     
    146147                  case 's':                                                                             // print symbol table events
    147148                        symtabp = true;
     149                        break;
     150                  case Tree:
     151                  case 't':                                                                             // build in tree
     152                        treep = true;
    148153                        break;
    149154                  case 'v':                                                                             // dump AST after decl validation pass
     
    188193                if ( ! nopreludep ) {                                                   // include gcc builtins
    189194                        // -l is for initial build ONLY and builtins.cf is not in the lib directory so access it here.
    190                         FILE * builtins = fopen( libcfap ? "./builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" );
     195                        FILE * builtins = fopen( libcfap | treep ? "builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" );
    191196                        if ( builtins == NULL ) {
    192                                 std::cerr << "Error: can't open builtins" << std::endl;
     197                                std::cerr << "Error: can't open builtins.cf" << std::endl;
    193198                                exit( 1 );
    194199                        } // if
     
    198203                        if ( ! libcfap ) {
    199204                                // read the prelude in, if not generating the cfa library
    200                                 FILE * prelude = fopen( CFA_LIBDIR "/prelude.cf", "r" );
     205                                FILE * prelude = fopen( treep ? "prelude.cf" : CFA_LIBDIR "/prelude.cf", "r" );
    201206                                if ( prelude == NULL ) {
    202                                         std::cerr << "Error: can't open prelude" << std::endl;
     207                                        std::cerr << "Error: can't open prelude.cf" << std::endl;
    203208                                        exit( 1 );
    204209                                } // if
     
    265270                }
    266271
    267                 OPTPRINT( "instantiateGeneric" )
    268                 GenPoly::instantiateGeneric( translationUnit );
    269272                OPTPRINT( "copyParams" );
    270273                GenPoly::copyParams( translationUnit );
     
    275278                OPTPRINT( "box" )
    276279                GenPoly::box( translationUnit );
    277 
     280               
    278281                // print tree right before code generation
    279282                if ( codegenp ) {
Note: See TracChangeset for help on using the changeset viewer.