Changes in / [3f3bfe5a:cf32116]
- Location:
- src
- Files:
-
- 2 added
- 21 edited
-
AST/CVQualifiers.hpp (modified) (2 diffs)
-
AST/Expr.cpp (modified) (8 diffs)
-
AST/Type.hpp (modified) (2 diffs)
-
CodeGen/GenType.cc (modified) (1 diff)
-
GenPoly/Box.cc (modified) (1 diff)
-
GenPoly/Lvalue.cc (modified) (3 diffs)
-
Makefile.in (modified) (4 diffs)
-
ResolvExpr/ResolveAssertions.cc (modified) (1 diff)
-
SymTab/Autogen.h (modified) (1 diff)
-
SymTab/ManglerCommon.cc (modified) (1 diff)
-
SymTab/Validate.cc (modified) (7 diffs)
-
SynTree/AddressExpr.cc (modified) (1 diff)
-
SynTree/ArrayType.cc (modified) (1 diff)
-
SynTree/CommaExpr.cc (modified) (2 diffs)
-
SynTree/Expression.cc (modified) (5 diffs)
-
SynTree/TopLvalue.cc (added)
-
SynTree/TopLvalue.h (added)
-
SynTree/TupleExpr.cc (modified) (1 diff)
-
SynTree/Type.cc (modified) (1 diff)
-
SynTree/Type.h (modified) (4 diffs)
-
SynTree/module.mk (modified) (1 diff)
-
Tuples/TupleExpansion.cc (modified) (3 diffs)
-
main.cc (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/CVQualifiers.hpp
r3f3bfe5a rcf32116 27 27 Restrict = 1 << 1, 28 28 Volatile = 1 << 2, 29 Mutex = 1 << 3, 30 Atomic = 1 << 4, 31 NumQualifiers = 5 29 Lvalue = 1 << 3, 30 Mutex = 1 << 4, 31 Atomic = 1 << 5, 32 NumQualifiers = 6 32 33 }; 33 34 34 35 /// Mask for equivalence-preserving qualfiers 35 enum { EquivQualifiers = ~ Restrict};36 enum { EquivQualifiers = ~(Restrict | Lvalue) }; 36 37 37 38 /// Underlying data for qualifiers … … 43 44 bool is_restrict : 1; 44 45 bool is_volatile : 1; 46 bool is_lvalue : 1; 45 47 bool is_mutex : 1; 46 48 bool is_atomic : 1; -
src/AST/Expr.cpp
r3f3bfe5a rcf32116 10 10 // Created On : Wed May 15 17:00:00 2019 11 11 // Last Modified By : Andrew Beach 12 // Created On : Fri Oct 4 15:34:00 201913 // Update Count : 412 // Created On : Thr Jun 26 12:12:00 2019 13 // Update Count : 3 14 14 // 15 15 … … 82 82 // base type 83 83 ret->result = base; 84 add_qualifiers( ret->result, CV::Lvalue ); 84 85 } 85 86 } … … 130 131 // lvalue, retains all levels of reference, and gains a pointer inside the references 131 132 Type * res = addrType( arg->result ); 133 res->set_lvalue( false ); // result of & is never an lvalue 132 134 result = res; 133 135 } else { … … 136 138 dynamic_cast< const ReferenceType * >( arg->result.get() ) ) { 137 139 Type * res = addrType( refType->base ); 140 res->set_lvalue( false ); // result of & is never an lvalue 138 141 result = res; 139 142 } else { … … 227 230 // substitute aggregate generic parameters into member type 228 231 genericSubstitution( aggregate->result ).apply( result ); 229 // ensure appropriate restrictions from aggregate type230 add_qualifiers( result, aggregate->result->qualifiers );232 // ensure lvalue and appropriate restrictions from aggregate type 233 add_qualifiers( result, aggregate->result->qualifiers | CV::Lvalue ); 231 234 } 232 235 … … 254 257 assert( var ); 255 258 assert( var->get_type() ); 256 result = shallowCopy( var->get_type() ); 259 auto r = shallowCopy( var->get_type() ); 260 r->qualifiers |= CV::Lvalue; 261 result = r; 257 262 } 258 263 … … 371 376 assert( t && i ); 372 377 result = t; 378 add_qualifiers( result, CV::Lvalue ); 373 379 } 374 380 … … 391 397 // like MemberExpr, TupleIndexExpr is always an lvalue 392 398 result = type->types[ index ]; 399 add_qualifiers( result, CV::Lvalue ); 393 400 } 394 401 -
src/AST/Type.hpp
r3f3bfe5a rcf32116 51 51 bool is_volatile() const { return qualifiers.is_volatile; } 52 52 bool is_restrict() const { return qualifiers.is_restrict; } 53 bool is_lvalue() const { return qualifiers.is_lvalue; } 53 54 bool is_mutex() const { return qualifiers.is_mutex; } 54 55 bool is_atomic() const { return qualifiers.is_atomic; } … … 57 58 Type * set_volatile( bool v ) { qualifiers.is_volatile = v; return this; } 58 59 Type * set_restrict( bool v ) { qualifiers.is_restrict = v; return this; } 60 Type * set_lvalue( bool v ) { qualifiers.is_lvalue = v; return this; } 59 61 Type * set_mutex( bool v ) { qualifiers.is_mutex = v; return this; } 60 62 Type * set_atomic( bool v ) { qualifiers.is_atomic = v; return this; } -
src/CodeGen/GenType.cc
r3f3bfe5a rcf32116 335 335 typeString = "_Atomic " + typeString; 336 336 } // if 337 if ( type->get_lvalue() && ! options.genC ) { 338 // when not generating C code, print lvalue for debugging. 339 typeString = "lvalue " + typeString; 340 } 337 341 } 338 342 } // namespace CodeGen -
src/GenPoly/Box.cc
r3f3bfe5a rcf32116 837 837 deref->args.push_back( new CastExpr( new VariableExpr( param ), new PointerType( Type::Qualifiers(), arg->get_type()->clone() ) ) ); 838 838 deref->result = arg->get_type()->clone(); 839 deref->result->set_lvalue( true ); 839 840 return deref; 840 841 } // if -
src/GenPoly/Lvalue.cc
r3f3bfe5a rcf32116 54 54 delete ret->result; 55 55 ret->result = base->clone(); 56 ret->result->set_lvalue( true ); 56 57 return ret; 57 58 } else { … … 166 167 ReferenceType * result = strict_dynamic_cast< ReferenceType * >( appExpr->result ); 167 168 appExpr->result = result->base->clone(); 169 appExpr->result->set_lvalue( true ); 168 170 if ( ! inIntrinsic ) { 169 171 // when not in an intrinsic function, add a cast to … … 434 436 delete ret->result; 435 437 ret->result = castExpr->result; 436 assert( ret->get_lvalue()); // ensure result is lvalue438 ret->result->set_lvalue( true ); // ensure result is lvalue 437 439 castExpr->env = nullptr; 438 440 castExpr->arg = nullptr; -
src/Makefile.in
r3f3bfe5a rcf32116 232 232 SynTree/Initializer.$(OBJEXT) \ 233 233 SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \ 234 SynTree/DeclReplacer.$(OBJEXT) 234 SynTree/DeclReplacer.$(OBJEXT) SynTree/TopLvalue.$(OBJEXT) 235 235 am__objects_8 = CompilationState.$(OBJEXT) $(am__objects_1) \ 236 236 $(am__objects_2) Concurrency/Keywords.$(OBJEXT) \ … … 698 698 SynTree/TypeSubstitution.cc \ 699 699 SynTree/Attribute.cc \ 700 SynTree/DeclReplacer.cc 700 SynTree/DeclReplacer.cc \ 701 SynTree/TopLvalue.cc 701 702 702 703 … … 1029 1030 SynTree/DeclReplacer.$(OBJEXT): SynTree/$(am__dirstamp) \ 1030 1031 SynTree/$(DEPDIR)/$(am__dirstamp) 1032 SynTree/TopLvalue.$(OBJEXT): SynTree/$(am__dirstamp) \ 1033 SynTree/$(DEPDIR)/$(am__dirstamp) 1031 1034 Tuples/$(am__dirstamp): 1032 1035 @$(MKDIR_P) Tuples … … 1340 1343 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ReferenceType.Po@am__quote@ 1341 1344 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Statement.Po@am__quote@ 1345 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TopLvalue.Po@am__quote@ 1342 1346 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TupleExpr.Po@am__quote@ 1343 1347 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TupleType.Po@am__quote@ -
src/ResolvExpr/ResolveAssertions.cc
r3f3bfe5a rcf32116 156 156 for ( const auto& assn : x.assns ) { 157 157 // compute conversion cost from satisfying decl to assertion 158 assert( !assn.match.adjType->get_lvalue() ); 158 159 k += computeConversionCost( 159 160 assn.match.adjType, assn.decl->get_type(), false, indexer, x.env ); -
src/SymTab/Autogen.h
r3f3bfe5a rcf32116 98 98 // type->get_qualifiers() = Type::Qualifiers(); 99 99 Type * castType = addCast->clone(); 100 castType->get_qualifiers() -= Type::Qualifiers( Type:: Const | Type::Volatile | Type::Restrict | Type::Atomic );100 castType->get_qualifiers() -= Type::Qualifiers( Type::Lvalue | 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
r3f3bfe5a rcf32116 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" }, 90 91 }; 91 92 -
src/SymTab/Validate.cc
r3f3bfe5a rcf32116 81 81 #include "SynTree/Label.h" // for operator==, Label 82 82 #include "SynTree/Mutator.h" // for Mutator 83 #include "SynTree/TopLvalue.h" // for assertTopLvalue, clearInnerLvalue 83 84 #include "SynTree/Type.h" // for Type, TypeInstType, EnumInstType 84 85 #include "SynTree/TypeSubstitution.h" // for TypeSubstitution … … 308 309 PassVisitor<FixQualifiedTypes> fixQual; 309 310 311 assertTopLvalue( translationUnit ); 310 312 { 311 313 Stats::Heap::newPass("validate-A"); … … 316 318 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 317 319 } 320 assertTopLvalue( translationUnit ); 318 321 { 319 322 Stats::Heap::newPass("validate-B"); 320 323 Stats::Time::BlockGuard guard("validate-B"); 324 assertTopLvalue( translationUnit ); 321 325 Stats::Time::TimeBlock("Link Reference To Types", [&]() { 322 326 acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions 323 327 }); 328 clearInnerLvalue( translationUnit ); 329 assertTopLvalue( translationUnit ); 324 330 Stats::Time::TimeBlock("Fix Qualified Types", [&]() { 325 331 mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes_old, because aggregate members are accessed 326 332 }); 333 assertTopLvalue( translationUnit ); 327 334 Stats::Time::TimeBlock("Hoist Structs", [&]() { 328 335 HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order 329 336 }); 337 assertTopLvalue( translationUnit ); 330 338 Stats::Time::TimeBlock("Eliminate Typedefs", [&]() { 331 339 EliminateTypedef::eliminateTypedef( translationUnit ); // 332 340 }); 333 341 } 342 assertTopLvalue( translationUnit ); 334 343 { 335 344 Stats::Heap::newPass("validate-C"); … … 340 349 InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen 341 350 } 351 assertTopLvalue( translationUnit ); 342 352 { 343 353 Stats::Heap::newPass("validate-D"); 344 354 Stats::Time::BlockGuard guard("validate-D"); 355 assertTopLvalue( translationUnit ); 345 356 Stats::Time::TimeBlock("Apply Concurrent Keywords", [&]() { 346 357 Concurrency::applyKeywords( translationUnit ); 347 358 }); 359 clearInnerLvalue( translationUnit ); 360 assertTopLvalue( translationUnit ); 348 361 Stats::Time::TimeBlock("Forall Pointer Decay", [&]() { 349 362 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution 350 363 }); 364 assertTopLvalue( translationUnit ); 351 365 Stats::Time::TimeBlock("Hoist Control Declarations", [&]() { 352 366 ControlStruct::hoistControlDecls( translationUnit ); // hoist initialization out of for statements; must happen before autogenerateRoutines 353 367 }); 368 assertTopLvalue( translationUnit ); 354 369 Stats::Time::TimeBlock("Generate Autogen routines", [&]() { 355 370 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay_old 356 371 }); 357 } 372 clearInnerLvalue( translationUnit ); 373 } 374 assertTopLvalue( translationUnit ); 358 375 { 359 376 Stats::Heap::newPass("validate-E"); 360 377 Stats::Time::BlockGuard guard("validate-E"); 378 assertTopLvalue( translationUnit ); 361 379 Stats::Time::TimeBlock("Implement Mutex Func", [&]() { 362 380 Concurrency::implementMutexFuncs( translationUnit ); 363 381 }); 382 clearInnerLvalue( translationUnit ); 383 assertTopLvalue( translationUnit ); 364 384 Stats::Time::TimeBlock("Implement Thread Start", [&]() { 365 385 Concurrency::implementThreadStarter( translationUnit ); 366 386 }); 387 assertTopLvalue( translationUnit ); 367 388 Stats::Time::TimeBlock("Compound Literal", [&]() { 368 389 mutateAll( translationUnit, compoundliteral ); 369 390 }); 391 assertTopLvalue( translationUnit ); 370 392 Stats::Time::TimeBlock("Resolve With Expressions", [&]() { 371 393 ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables 372 394 }); 373 } 395 clearInnerLvalue( translationUnit ); 396 } 397 assertTopLvalue( translationUnit ); 374 398 { 375 399 Stats::Heap::newPass("validate-F"); 376 400 Stats::Time::BlockGuard guard("validate-F"); 401 assertTopLvalue( translationUnit ); 377 402 Stats::Time::TimeBlock("Fix Object Type", [&]() { 378 403 FixObjectType::fix( translationUnit ); 379 404 }); 405 assertTopLvalue( translationUnit ); 380 406 Stats::Time::TimeBlock("Array Length", [&]() { 381 407 ArrayLength::computeLength( translationUnit ); 382 408 }); 409 clearInnerLvalue( translationUnit ); 410 assertTopLvalue( translationUnit ); 383 411 Stats::Time::TimeBlock("Find Special Declarations", [&]() { 384 412 Validate::findSpecialDecls( translationUnit ); 385 413 }); 414 assertTopLvalue( translationUnit ); 386 415 Stats::Time::TimeBlock("Fix Label Address", [&]() { 387 416 mutateAll( translationUnit, labelAddrFixer ); 388 417 }); 418 assertTopLvalue( translationUnit ); 389 419 Stats::Time::TimeBlock("Handle Attributes", [&]() { 390 420 Validate::handleAttributes( translationUnit ); 391 421 }); 392 422 } 423 assertTopLvalue( translationUnit ); 393 424 } 394 425 … … 1303 1334 void FixObjectType::previsit( ObjectDecl * objDecl ) { 1304 1335 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 type 1305 1337 objDecl->set_type( new_type ); 1306 1338 } … … 1308 1340 void FixObjectType::previsit( FunctionDecl * funcDecl ) { 1309 1341 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 type 1310 1343 funcDecl->set_type( new_type ); 1311 1344 } … … 1314 1347 if ( typeDecl->get_base() ) { 1315 1348 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 type 1316 1350 typeDecl->set_base( new_type ); 1317 1351 } // if -
src/SynTree/AddressExpr.cc
r3f3bfe5a rcf32116 53 53 } // if 54 54 } 55 // result of & is never an lvalue 56 get_result()->set_lvalue( false ); 55 57 } 56 58 } -
src/SynTree/ArrayType.cc
r3f3bfe5a rcf32116 26 26 ArrayType::ArrayType( const Type::Qualifiers &tq, Type *base, Expression *dimension, bool isVarLen, bool isStatic, const std::list< Attribute * > & attributes ) 27 27 : Type( tq, attributes ), base( base ), dimension( dimension ), isVarLen( isVarLen ), isStatic( isStatic ) { 28 base->set_lvalue( false ); 28 29 } 29 30 -
src/SynTree/CommaExpr.cc
r3f3bfe5a rcf32116 23 23 CommaExpr::CommaExpr( Expression *arg1, Expression *arg2 ) 24 24 : Expression(), arg1( arg1 ), arg2( arg2 ) { 25 // xxx - result of a comma expression is never an lvalue, so should set lvalue 26 // to false on all result types. Actually doing this causes some strange things 27 // to happen in later passes (particularly, Specialize, Lvalue, and Box). This needs to be looked into. 25 28 set_result( maybeClone( arg2->get_result() ) ); 29 // get_type->set_isLvalue( false ); 26 30 } 27 31 … … 37 41 bool CommaExpr::get_lvalue() const { 38 42 // This is wrong by C, but the current implementation uses it. 39 // (ex: Specialize, Lvalue and Box)40 43 return arg2->get_lvalue(); 41 44 } -
src/SynTree/Expression.cc
r3f3bfe5a rcf32116 115 115 assert( var->get_type() ); 116 116 Type * type = var->get_type()->clone(); 117 type->set_lvalue( true ); 117 118 118 119 // xxx - doesn't quite work yet - get different alternatives with the same cost … … 124 125 // long long int value; 125 126 // if ( decl->valueOf( var, value ) ) { 126 // type->set_lvalue( false ); // Would have to move to get_lvalue.127 // type->set_lvalue( false ); 127 128 // } 128 129 // } … … 383 384 sub.apply( res ); 384 385 result = res; 386 result->set_lvalue( true ); 385 387 result->get_qualifiers() |= aggregate->result->get_qualifiers(); 386 388 } … … 431 433 // if references are still allowed in the AST, dereference returns a reference 432 434 ret->set_result( new ReferenceType( Type::Qualifiers(), ret->get_result() ) ); 435 } else { 436 // references have been removed, in which case dereference returns an lvalue of the base type. 437 ret->result->set_lvalue( true ); 433 438 } 434 439 } … … 586 591 CompoundLiteralExpr::CompoundLiteralExpr( Type * type, Initializer * initializer ) : initializer( initializer ) { 587 592 assert( type && initializer ); 593 type->set_lvalue( true ); 588 594 set_result( type ); 589 595 } -
src/SynTree/TupleExpr.cc
r3f3bfe5a rcf32116 71 71 assertf( type->size() > index, "TupleIndexExpr index out of bounds: tuple size %d, requested index %d in expr %s", type->size(), index, toString( tuple ).c_str() ); 72 72 set_result( (*std::next( type->get_types().begin(), index ))->clone() ); 73 // like MemberExpr, TupleIndexExpr is always an lvalue 74 get_result()->set_lvalue( true ); 73 75 } 74 76 -
src/SynTree/Type.cc
r3f3bfe5a rcf32116 85 85 const char * Type::FuncSpecifiersNames[] = { "inline", "_Noreturn", "fortran" }; 86 86 const char * Type::StorageClassesNames[] = { "extern", "static", "auto", "register", "_Thread_local" }; 87 const char * Type::QualifiersNames[] = { "const", "restrict", "volatile", " mutex", "_Atomic" };87 const char * Type::QualifiersNames[] = { "const", "restrict", "volatile", "lvalue", "mutex", "_Atomic" }; 88 88 89 89 Type * Type::stripDeclarator() { -
src/SynTree/Type.h
r3f3bfe5a rcf32116 102 102 }; // StorageClasses 103 103 104 enum { Const = 1 << 0, Restrict = 1 << 1, Volatile = 1 << 2, Mutex = 1 << 3, Atomic = 1 << 4, NumTypeQualifier = 5};104 enum { Const = 1 << 0, Restrict = 1 << 1, Volatile = 1 << 2, Lvalue = 1 << 3, Mutex = 1 << 4, Atomic = 1 << 5, NumTypeQualifier = 6 }; 105 105 static const char * QualifiersNames[]; 106 106 union Qualifiers { 107 enum { Mask = ~ Restrict};107 enum { Mask = ~(Restrict | Lvalue) }; 108 108 unsigned int val; 109 109 struct { … … 111 111 bool is_restrict : 1; 112 112 bool is_volatile : 1; 113 bool is_lvalue : 1; 113 114 bool is_mutex : 1; 114 115 bool is_atomic : 1; … … 152 153 bool get_volatile() const { return tq.is_volatile; } 153 154 bool get_restrict() const { return tq.is_restrict; } 155 bool get_lvalue() const { return tq.is_lvalue; } 154 156 bool get_mutex() const { return tq.is_mutex; } 155 157 bool get_atomic() const { return tq.is_atomic; } … … 157 159 void set_volatile( bool newValue ) { tq.is_volatile = newValue; } 158 160 void set_restrict( bool newValue ) { tq.is_restrict = newValue; } 161 void set_lvalue( bool newValue ) { tq.is_lvalue = newValue; } 159 162 void set_mutex( bool newValue ) { tq.is_mutex = newValue; } 160 163 void set_atomic( bool newValue ) { tq.is_atomic = newValue; } -
src/SynTree/module.mk
r3f3bfe5a rcf32116 49 49 SynTree/TypeSubstitution.cc \ 50 50 SynTree/Attribute.cc \ 51 SynTree/DeclReplacer.cc 51 SynTree/DeclReplacer.cc \ 52 SynTree/TopLvalue.cc 52 53 53 54 SRC += $(SRC_SYNTREE) -
src/Tuples/TupleExpansion.cc
r3f3bfe5a rcf32116 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Oct 4 15:38:00 201913 // Update Count : 2 312 // Last Modified On : Fri Jul 19 14:39:00 2019 13 // Update Count : 22 14 14 // 15 15 … … 304 304 // produce the TupleType which aggregates the types of the exprs 305 305 std::list< Type * > types; 306 Type::Qualifiers qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type:: Atomic | Type::Mutex );306 Type::Qualifiers qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Lvalue | Type::Atomic | Type::Mutex ); 307 307 for ( Expression * expr : exprs ) { 308 308 assert( expr->get_result() ); … … 323 323 std::vector<ast::ptr<ast::Type>> types; 324 324 ast::CV::Qualifiers quals{ 325 ast::CV::Const | ast::CV::Volatile | ast::CV::Restrict | 325 ast::CV::Const | ast::CV::Volatile | ast::CV::Restrict | ast::CV::Lvalue | 326 326 ast::CV::Atomic | ast::CV::Mutex }; 327 327 -
src/main.cc
r3f3bfe5a rcf32116 60 60 #include "ResolvExpr/Resolver.h" // for resolve 61 61 #include "SymTab/Validate.h" // for validate 62 #include "SynTree/TopLvalue.h" // for assertTopLvalue, clearInn... 62 63 #include "SynTree/Declaration.h" // for Declaration 63 64 #include "SynTree/Visitor.h" // for acceptAll … … 259 260 Stats::Time::StopBlock(); 260 261 262 //std::cerr << "Post-Parse Check" << std::endl; 263 clearInnerLvalue( translationUnit ); 264 assertTopLvalue( translationUnit ); 265 261 266 // add the assignment statement after the initialization of a type parameter 262 267 PASS( "Validate", SymTab::validate( translationUnit, symtabp ) ); … … 277 282 } // if 278 283 284 assertTopLvalue( translationUnit ); 279 285 PASS( "Fix Labels", ControlStruct::fixLabels( translationUnit ) ); 286 assertTopLvalue( translationUnit ); 280 287 PASS( "Fix Names", CodeGen::fixNames( translationUnit ) ); 288 assertTopLvalue( translationUnit ); 281 289 PASS( "Gen Init", InitTweak::genInit( translationUnit ) ); 290 assertTopLvalue( translationUnit ); 282 291 PASS( "Expand Member Tuples" , Tuples::expandMemberTuples( translationUnit ) ); 292 assertTopLvalue( translationUnit ); 283 293 if ( libcfap ) { 284 294 // generate the bodies of cfa library functions … … 316 326 } // if 317 327 328 clearInnerLvalue( translationUnit ); 329 assertTopLvalue( translationUnit ); 330 318 331 // fix ObjectDecl - replaces ConstructorInit nodes 319 332 PASS( "Fix Init", InitTweak::fix( translationUnit, buildingLibrary() ) ); 333 clearInnerLvalue( translationUnit ); 334 assertTopLvalue( translationUnit ); 320 335 if ( ctorinitp ) { 321 336 dump ( translationUnit ); … … 324 339 325 340 PASS( "Expand Unique Expr", 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 341 assertTopLvalue( translationUnit ); 326 342 327 343 PASS( "Translate EHM" , ControlStruct::translateEHM( translationUnit ) ); 344 assertTopLvalue( translationUnit ); 328 345 329 346 PASS( "Gen Waitfor" , Concurrency::generateWaitFor( translationUnit ) ); 347 clearInnerLvalue( translationUnit ); 348 assertTopLvalue( translationUnit ); 330 349 331 350 PASS( "Convert Specializations", GenPoly::convertSpecializations( translationUnit ) ); // needs to happen before tuple types are expanded 351 clearInnerLvalue( translationUnit ); 352 assertTopLvalue( translationUnit ); 332 353 333 354 PASS( "Expand Tuples", Tuples::expandTuples( translationUnit ) ); // xxx - is this the right place for this? 355 assertTopLvalue( translationUnit ); 334 356 335 357 if ( tuplep ) { … … 339 361 340 362 PASS( "Virtual Expand Casts", Virtual::expandCasts( translationUnit ) ); // Must come after translateEHM 363 assertTopLvalue( translationUnit ); 341 364 342 365 PASS( "Instantiate Generics", GenPoly::instantiateGeneric( translationUnit ) ); … … 345 368 return EXIT_SUCCESS; 346 369 } // if 347 370 clearInnerLvalue( translationUnit ); 371 assertTopLvalue( translationUnit ); 348 372 PASS( "Convert L-Value", GenPoly::convertLvalue( translationUnit ) ); 373 clearInnerLvalue( translationUnit ); 374 assertTopLvalue( translationUnit ); 349 375 350 376 if ( bboxp ) { … … 353 379 } // if 354 380 PASS( "Box", GenPoly::box( translationUnit ) ); 381 clearInnerLvalue( translationUnit ); 382 assertTopLvalue( translationUnit ); 355 383 356 384 if ( bcodegenp ) { … … 364 392 365 393 CodeTools::fillLocations( translationUnit ); 394 assertTopLvalue( translationUnit ); 366 395 PASS( "Code Gen", CodeGen::generate( translationUnit, *output, ! genproto, prettycodegenp, true, linemarks ) ); 367 396
Note:
See TracChangeset
for help on using the changeset viewer.