Changeset 3f3bfe5a for src/SymTab
- Timestamp:
- Oct 11, 2019, 2:23:30 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 396b830
- Parents:
- cf32116 (diff), 70b4ea20 (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. - Location:
- src/SymTab
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Autogen.h
rcf32116 r3f3bfe5a 98 98 // type->get_qualifiers() = Type::Qualifiers(); 99 99 Type * castType = addCast->clone(); 100 castType->get_qualifiers() -= Type::Qualifiers( Type:: Lvalue | Type::Const | Type::Volatile | Type::Restrict | Type::Atomic );100 castType->get_qualifiers() -= Type::Qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Atomic ); 101 101 // castType->set_lvalue( true ); // xxx - might not need this 102 102 dstParam = new CastExpr( dstParam, new ReferenceType( Type::Qualifiers(), castType ) ); -
src/SymTab/ManglerCommon.cc
rcf32116 r3f3bfe5a 88 88 { Type::Atomic, "DA" }, // A is array, so need something unique for atmoic. For now, go with multiletter DA 89 89 { Type::Mutex, "X" }, 90 { Type::Lvalue, "L" },91 90 }; 92 91 -
src/SymTab/Validate.cc
rcf32116 r3f3bfe5a 81 81 #include "SynTree/Label.h" // for operator==, Label 82 82 #include "SynTree/Mutator.h" // for Mutator 83 #include "SynTree/TopLvalue.h" // for assertTopLvalue, clearInnerLvalue84 83 #include "SynTree/Type.h" // for Type, TypeInstType, EnumInstType 85 84 #include "SynTree/TypeSubstitution.h" // for TypeSubstitution … … 309 308 PassVisitor<FixQualifiedTypes> fixQual; 310 309 311 assertTopLvalue( translationUnit );312 310 { 313 311 Stats::Heap::newPass("validate-A"); … … 318 316 acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes_old because it is an indexer and needs correct types for mangling 319 317 } 320 assertTopLvalue( translationUnit );321 318 { 322 319 Stats::Heap::newPass("validate-B"); 323 320 Stats::Time::BlockGuard guard("validate-B"); 324 assertTopLvalue( translationUnit );325 321 Stats::Time::TimeBlock("Link Reference To Types", [&]() { 326 322 acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions 327 323 }); 328 clearInnerLvalue( translationUnit );329 assertTopLvalue( translationUnit );330 324 Stats::Time::TimeBlock("Fix Qualified Types", [&]() { 331 325 mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes_old, because aggregate members are accessed 332 326 }); 333 assertTopLvalue( translationUnit );334 327 Stats::Time::TimeBlock("Hoist Structs", [&]() { 335 328 HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order 336 329 }); 337 assertTopLvalue( translationUnit );338 330 Stats::Time::TimeBlock("Eliminate Typedefs", [&]() { 339 331 EliminateTypedef::eliminateTypedef( translationUnit ); // 340 332 }); 341 333 } 342 assertTopLvalue( translationUnit );343 334 { 344 335 Stats::Heap::newPass("validate-C"); … … 349 340 InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen 350 341 } 351 assertTopLvalue( translationUnit );352 342 { 353 343 Stats::Heap::newPass("validate-D"); 354 344 Stats::Time::BlockGuard guard("validate-D"); 355 assertTopLvalue( translationUnit );356 345 Stats::Time::TimeBlock("Apply Concurrent Keywords", [&]() { 357 346 Concurrency::applyKeywords( translationUnit ); 358 347 }); 359 clearInnerLvalue( translationUnit );360 assertTopLvalue( translationUnit );361 348 Stats::Time::TimeBlock("Forall Pointer Decay", [&]() { 362 349 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution 363 350 }); 364 assertTopLvalue( translationUnit );365 351 Stats::Time::TimeBlock("Hoist Control Declarations", [&]() { 366 352 ControlStruct::hoistControlDecls( translationUnit ); // hoist initialization out of for statements; must happen before autogenerateRoutines 367 353 }); 368 assertTopLvalue( translationUnit );369 354 Stats::Time::TimeBlock("Generate Autogen routines", [&]() { 370 355 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay_old 371 356 }); 372 clearInnerLvalue( translationUnit ); 373 } 374 assertTopLvalue( translationUnit ); 357 } 375 358 { 376 359 Stats::Heap::newPass("validate-E"); 377 360 Stats::Time::BlockGuard guard("validate-E"); 378 assertTopLvalue( translationUnit );379 361 Stats::Time::TimeBlock("Implement Mutex Func", [&]() { 380 362 Concurrency::implementMutexFuncs( translationUnit ); 381 363 }); 382 clearInnerLvalue( translationUnit );383 assertTopLvalue( translationUnit );384 364 Stats::Time::TimeBlock("Implement Thread Start", [&]() { 385 365 Concurrency::implementThreadStarter( translationUnit ); 386 366 }); 387 assertTopLvalue( translationUnit );388 367 Stats::Time::TimeBlock("Compound Literal", [&]() { 389 368 mutateAll( translationUnit, compoundliteral ); 390 369 }); 391 assertTopLvalue( translationUnit );392 370 Stats::Time::TimeBlock("Resolve With Expressions", [&]() { 393 371 ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables 394 372 }); 395 clearInnerLvalue( translationUnit ); 396 } 397 assertTopLvalue( translationUnit ); 373 } 398 374 { 399 375 Stats::Heap::newPass("validate-F"); 400 376 Stats::Time::BlockGuard guard("validate-F"); 401 assertTopLvalue( translationUnit );402 377 Stats::Time::TimeBlock("Fix Object Type", [&]() { 403 378 FixObjectType::fix( translationUnit ); 404 379 }); 405 assertTopLvalue( translationUnit );406 380 Stats::Time::TimeBlock("Array Length", [&]() { 407 381 ArrayLength::computeLength( translationUnit ); 408 382 }); 409 clearInnerLvalue( translationUnit );410 assertTopLvalue( translationUnit );411 383 Stats::Time::TimeBlock("Find Special Declarations", [&]() { 412 384 Validate::findSpecialDecls( translationUnit ); 413 385 }); 414 assertTopLvalue( translationUnit );415 386 Stats::Time::TimeBlock("Fix Label Address", [&]() { 416 387 mutateAll( translationUnit, labelAddrFixer ); 417 388 }); 418 assertTopLvalue( translationUnit );419 389 Stats::Time::TimeBlock("Handle Attributes", [&]() { 420 390 Validate::handleAttributes( translationUnit ); 421 391 }); 422 392 } 423 assertTopLvalue( translationUnit );424 393 } 425 394 … … 1334 1303 void FixObjectType::previsit( ObjectDecl * objDecl ) { 1335 1304 Type * new_type = ResolvExpr::resolveTypeof( objDecl->get_type(), indexer ); 1336 new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type1337 1305 objDecl->set_type( new_type ); 1338 1306 } … … 1340 1308 void FixObjectType::previsit( FunctionDecl * funcDecl ) { 1341 1309 Type * new_type = ResolvExpr::resolveTypeof( funcDecl->type, indexer ); 1342 new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type1343 1310 funcDecl->set_type( new_type ); 1344 1311 } … … 1347 1314 if ( typeDecl->get_base() ) { 1348 1315 Type * new_type = ResolvExpr::resolveTypeof( typeDecl->get_base(), indexer ); 1349 new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type1350 1316 typeDecl->set_base( new_type ); 1351 1317 } // if
Note: See TracChangeset
for help on using the changeset viewer.