Changeset d41280e for src/main.cc
- Timestamp:
- Feb 8, 2016, 10:07:42 AM (10 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
r00ede9e rd41280e 10 10 // Created On : Fri May 15 23:12:02 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Dec 17 12:59:06 201513 // Update Count : 1 7912 // Last Modified On : Wed Jan 27 22:20:20 2016 13 // Update Count : 199 14 14 // 15 15 … … 24 24 #include "SynTree/Declaration.h" 25 25 #include "SynTree/Visitor.h" 26 #include "GenPoly/InstantiateGeneric.h"27 26 #include "GenPoly/Lvalue.h" 28 27 #include "GenPoly/Specialize.h" … … 45 44 //#include "Try/Visit.h" 46 45 47 #include " SemanticError.h"48 #include " UnimplementedError.h"46 #include "Common/SemanticError.h" 47 #include "Common/UnimplementedError.h" 49 48 50 49 #include "../config.h" … … 70 69 resolvep = false, // used in AlternativeFinder 71 70 symtabp = false, 71 treep = false, 72 72 validp = false, 73 73 errorp = false, 74 74 codegenp = false; 75 75 76 enum { Ast, Bresolver, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Validate, };76 enum { Ast, Bresolver, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, Validate, }; 77 77 78 78 static struct option long_opts[] = { … … 88 88 { "resolver", no_argument, 0, Resolver }, 89 89 { "symbol", no_argument, 0, Symbol }, 90 { "tree", no_argument, 0, Tree }, 90 91 { "validate", no_argument, 0, Validate }, 91 92 { 0, 0, 0, 0 } … … 101 102 102 103 int c; 103 while ( (c = getopt_long( argc, argv, "abefglnpqrs vyzD:", long_opts, &long_index )) != -1 ) {104 while ( (c = getopt_long( argc, argv, "abefglnpqrstvyzD:", long_opts, &long_index )) != -1 ) { 104 105 switch ( c ) { 105 106 case Ast: … … 146 147 case 's': // print symbol table events 147 148 symtabp = true; 149 break; 150 case Tree: 151 case 't': // build in tree 152 treep = true; 148 153 break; 149 154 case 'v': // dump AST after decl validation pass … … 188 193 if ( ! nopreludep ) { // include gcc builtins 189 194 // -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" ); 191 196 if ( builtins == NULL ) { 192 std::cerr << "Error: can't open builtins " << std::endl;197 std::cerr << "Error: can't open builtins.cf" << std::endl; 193 198 exit( 1 ); 194 199 } // if … … 198 203 if ( ! libcfap ) { 199 204 // 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" ); 201 206 if ( prelude == NULL ) { 202 std::cerr << "Error: can't open prelude " << std::endl;207 std::cerr << "Error: can't open prelude.cf" << std::endl; 203 208 exit( 1 ); 204 209 } // if … … 265 270 } 266 271 267 OPTPRINT( "instantiateGeneric" )268 GenPoly::instantiateGeneric( translationUnit );269 272 OPTPRINT( "copyParams" ); 270 273 GenPoly::copyParams( translationUnit ); … … 275 278 OPTPRINT( "box" ) 276 279 GenPoly::box( translationUnit ); 277 280 278 281 // print tree right before code generation 279 282 if ( codegenp ) {
Note:
See TracChangeset
for help on using the changeset viewer.