Changes in / [779a4a3:f3152ab]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
r779a4a3 rf3152ab 63 63 using namespace std; 64 64 65 #define OPTPRINT(x) if ( errorp ) cerr << x << endl; 66 65 #define PASS(name, pass) \ 66 if ( errorp ) { cerr << #name << endl; } \ 67 HeapStats::newPass(#name); \ 68 pass; 67 69 68 70 LinkageSpec::Spec linkage = LinkageSpec::Cforall; … … 245 247 246 248 // add the assignment statement after the initialization of a type parameter 247 OPTPRINT( "validate" ) 248 SymTab::validate( translationUnit, symtabp ); 249 PASS( "validate", SymTab::validate( translationUnit, symtabp ) ); 249 250 if ( symtabp ) { 250 251 deleteAll( translationUnit ); … … 263 264 } // if 264 265 265 OPTPRINT( "mutate" ) 266 ControlStruct::mutate( translationUnit ); 267 OPTPRINT( "fixNames" ) 268 CodeGen::fixNames( translationUnit ); 269 OPTPRINT( "genInit" ) 270 InitTweak::genInit( translationUnit ); 271 OPTPRINT( "expandMemberTuples" ); 272 Tuples::expandMemberTuples( translationUnit ); 266 PASS( "mutate", ControlStruct::mutate( translationUnit ) ); 267 PASS( "fixNames", CodeGen::fixNames( translationUnit ) ); 268 PASS( "genInit", InitTweak::genInit( translationUnit ) ); 269 PASS( "expandMemberTuples" , Tuples::expandMemberTuples( translationUnit ) ); 273 270 if ( libcfap ) { 274 271 // generate the bodies of cfa library functions … … 289 286 CodeTools::fillLocations( translationUnit ); 290 287 291 OPTPRINT( "resolve" ) 292 ResolvExpr::resolve( translationUnit ); 288 PASS( "resolve", ResolvExpr::resolve( translationUnit ) ); 293 289 if ( exprp ) { 294 290 dump( translationUnit ); … … 297 293 298 294 // fix ObjectDecl - replaces ConstructorInit nodes 299 OPTPRINT( "fixInit" ) 300 InitTweak::fix( translationUnit, filename, libcfap || treep ); 295 PASS( "fixInit", InitTweak::fix( translationUnit, filename, libcfap || treep ) ); 301 296 if ( ctorinitp ) { 302 297 dump ( translationUnit ); … … 304 299 } // if 305 300 306 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 reused301 PASS( "expandUniqueExpr", Tuples::expandUniqueExpr( translationUnit ) ); // xxx - is this the right place for this? want to expand ASAP so tha, sequent 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 307 302 Tuples::expandUniqueExpr( translationUnit ); 308 303 309 OPTPRINT( "translateEHM" ); 310 ControlStruct::translateEHM( translationUnit ); 311 312 OPTPRINT( "generateWaitfor" ); 313 Concurrency::generateWaitFor( translationUnit ); 314 315 OPTPRINT( "convertSpecializations" ) // needs to happen before tuple types are expanded 316 GenPoly::convertSpecializations( translationUnit ); 317 318 OPTPRINT( "expandTuples" ); // xxx - is this the right place for this? 319 Tuples::expandTuples( translationUnit ); 304 PASS( "translateEHM" , ControlStruct::translateEHM( translationUnit ) ); 305 306 PASS( "generateWaitfor" , Concurrency::generateWaitFor( translationUnit ) ); 307 308 PASS( "convertSpecializations", GenPoly::convertSpecializations( translationUnit ) ); // needs to happen before tuple types are expanded 309 310 PASS( "expandTuples", Tuples::expandTuples( translationUnit ) ); // xxx - is this the right place for this? 311 320 312 if ( tuplep ) { 321 313 dump( translationUnit ); … … 323 315 } 324 316 325 OPTPRINT( "virtual expandCasts" ) // Must come after translateEHM 326 Virtual::expandCasts( translationUnit ); 327 328 OPTPRINT("instantiateGenerics") 329 GenPoly::instantiateGeneric( translationUnit ); 317 PASS( "virtual expandCasts", Virtual::expandCasts( translationUnit ) ); // Must come after translateEHM 318 319 PASS( "instantiateGenerics", GenPoly::instantiateGeneric( translationUnit ) ); 330 320 if ( genericsp ) { 331 321 dump( translationUnit ); 332 322 return 0; 333 323 } 334 OPTPRINT( "convertLvalue" ) 335 GenPoly::convertLvalue( translationUnit ); 324 PASS( "convertLvalue", GenPoly::convertLvalue( translationUnit ) ); 336 325 337 326 … … 340 329 return 0; 341 330 } // if 342 OPTPRINT( "box" ) 343 GenPoly::box( translationUnit ); 331 PASS( "box", GenPoly::box( translationUnit ) ); 344 332 345 333 if ( bcodegenp ) { … … 353 341 354 342 CodeTools::fillLocations( translationUnit ); 355 OPTPRINT( "codegen" ) 356 CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks ); 343 PASS( "codegen", CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks ) ); 357 344 358 345 CodeGen::FixMain::fix( *output, treep ? "../prelude/bootloader.c" : CFA_LIBDIR "/bootloader.c" ); 359 OPTPRINT( "end" )360 361 362 346 if ( output != &cout ) { 363 347 delete output;
Note: See TracChangeset
for help on using the changeset viewer.