Changeset b826e6b for src/main.cc
- Timestamp:
- Jul 19, 2017, 11:49:33 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 9cc0472
- Parents:
- fea3faa (diff), a57cb58 (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
rfea3faa rb826e6b 11 11 // Created On : Fri May 15 23:12:02 2015 12 12 // Last Modified By : Andrew Beach 13 // Last Modified On : Wed May 10 14:45:00 201714 // Update Count : 4 3713 // Last Modified On : Fri Jul 7 11:13:00 2017 14 // Update Count : 442 15 15 // 16 16 17 #include <iostream> 18 #include <fstream> 19 #include <signal.h> // signal 20 #include <getopt.h> // getopt 21 #include <execinfo.h> // backtrace, backtrace_symbols 22 #include <cxxabi.h> // __cxa_demangle 23 #include <cstring> // index 24 25 using namespace std; 26 27 #include "Parser/lex.h" 28 #include "Parser/parser.h" 29 #include "Parser/TypedefTable.h" 30 #include "GenPoly/Lvalue.h" 31 #include "GenPoly/Specialize.h" 32 #include "GenPoly/Box.h" 33 #include "GenPoly/CopyParams.h" 34 #include "GenPoly/InstantiateGeneric.h" 35 #include "Concurrency/Keywords.h" 36 #include "CodeGen/Generate.h" 37 #include "CodeGen/FixNames.h" 38 #include "CodeGen/FixMain.h" 39 #include "CodeTools/DeclStats.h" 40 #include "CodeTools/TrackLoc.h" 41 #include "ControlStruct/Mutate.h" 42 #include "SymTab/Validate.h" 43 #include "ResolvExpr/AlternativePrinter.h" 44 #include "ResolvExpr/Resolver.h" 45 #include "MakeLibCfa.h" 46 #include "InitTweak/GenInit.h" 47 #include "InitTweak/FixInit.h" 48 #include "Common/UnimplementedError.h" 49 #include "../config.h" 50 #include "Tuples/Tuples.h" 17 #include <cassert> // for assertf 18 #include <cxxabi.h> // for __cxa_demangle 19 #include <execinfo.h> // for backtrace, backtrace_symbols 20 #include <getopt.h> // for no_argument, optind, geto... 21 #include <signal.h> // for signal, SIGABRT, SIGSEGV 22 #include <cstdio> // for fopen, FILE, fclose, stdin 23 #include <cstdlib> // for exit, free, abort, EXIT_F... 24 #include <cstring> // for index 25 #include <fstream> // for ofstream 26 #include <iostream> // for operator<<, basic_ostream 27 #include <iterator> // for back_inserter 28 #include <list> // for list 29 #include <string> // for operator<<, allocator 30 31 #include "../config.h" // for CFA_LIBDIR 32 #include "CodeGen/FixMain.h" // for FixMain 33 #include "CodeGen/FixNames.h" // for fixNames 34 #include "CodeGen/Generate.h" // for generate 35 #include "CodeTools/DeclStats.h" // for printDeclStats 36 #include "CodeTools/TrackLoc.h" // for fillLocations 37 #include "Common/CompilerError.h" // for CompilerError 38 #include "Common/SemanticError.h" // for SemanticError 39 #include "Common/UnimplementedError.h" // for UnimplementedError 40 #include "Common/utility.h" // for deleteAll, filter, printAll 41 #include "ControlStruct/ExceptTranslate.h" // for translateEHM 42 #include "ControlStruct/Mutate.h" // for mutate 43 #include "GenPoly/Box.h" // for box 44 #include "GenPoly/CopyParams.h" // for copyParams 45 #include "GenPoly/InstantiateGeneric.h" // for instantiateGeneric 46 #include "GenPoly/Lvalue.h" // for convertLvalue 47 #include "GenPoly/Specialize.h" // for convertSpecializations 48 #include "InitTweak/FixInit.h" // for fix 49 #include "InitTweak/GenInit.h" // for genInit 50 #include "MakeLibCfa.h" // for makeLibCfa 51 #include "Parser/LinkageSpec.h" // for Spec, Cforall, Intrinsic 52 #include "Parser/ParseNode.h" // for DeclarationNode, buildList 53 #include "Parser/TypedefTable.h" // for TypedefTable 54 #include "ResolvExpr/AlternativePrinter.h" // for AlternativePrinter 55 #include "ResolvExpr/Resolver.h" // for resolve 56 #include "SymTab/Validate.h" // for validate 57 #include "SynTree/Declaration.h" // for Declaration 58 #include "SynTree/Visitor.h" // for acceptAll 59 #include "Tuples/Tuples.h" // for expandMemberTuples, expan... 51 60 52 61 using namespace std; … … 186 195 if ( ! nopreludep ) { // include gcc builtins 187 196 // -l is for initial build ONLY and builtins.cf is not in the lib directory so access it here. 188 // Read to cfa builtins, if not generating the cfa library189 FILE * builtins = fopen( libcfap | treep ? "../prelude/builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" );190 assertf( builtins, "cannot open builtins.cf\n" );191 parse( builtins, LinkageSpec::Compiler );192 197 193 198 // Read to gcc builtins, if not generating the cfa library … … 206 211 assertf( prelude, "cannot open prelude.cf\n" ); 207 212 parse( prelude, LinkageSpec::Intrinsic ); 213 214 // Read to cfa builtins, if not generating the cfa library 215 FILE * builtins = fopen( libcfap | treep ? "../prelude/builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" ); 216 assertf( builtins, "cannot open builtins.cf\n" ); 217 parse( builtins, LinkageSpec::BuiltinCFA ); 208 218 } // if 209 219 } // if … … 289 299 OPTPRINT( "expandUniqueExpr" ); // xxx - is this the right place for this? want to expand ASAP so that subsequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused 290 300 Tuples::expandUniqueExpr( translationUnit ); 301 302 OPTPRINT( "translateEHM" ); 303 ControlStruct::translateEHM( translationUnit ); 291 304 292 305 OPTPRINT( "convertSpecializations" ) // needs to happen before tuple types are expanded … … 481 494 break; 482 495 case '?': 483 assertf( false, "Unknown option: '%c'\n", (char)optopt ); 496 if ( optopt ) { // short option ? 497 assertf( false, "Unknown option: -%c\n", (char)optopt ); 498 } else { 499 assertf( false, "Unknown option: %s\n", argv[optind - 1] ); 500 } // if 484 501 default: 485 502 abort();
Note:
See TracChangeset
for help on using the changeset viewer.