Changeset 68cd1ce for src/SymTab
- Timestamp:
- Jun 13, 2015, 8:30:25 AM (9 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, string, with_gc
- Children:
- a1d5d2a
- Parents:
- 7bcf74e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
r7bcf74e r68cd1ce 10 10 // Created On : Sun May 17 21:50:04 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jun 8 17:19:35201513 // Update Count : 2 212 // Last Modified On : Sat Jun 13 08:06:13 2015 13 // Update Count : 26 14 14 // 15 15 … … 45 45 #include "SynTree/Type.h" 46 46 #include "SynTree/Statement.h" 47 #include "SynTree/TypeSubstitution.h" 47 48 #include "Indexer.h" 48 #include "SynTree/TypeSubstitution.h"49 49 #include "FixFunction.h" 50 50 #include "ImplementationType.h" … … 506 506 if ( ! array->get_dimension() ) return; 507 507 508 ObjectDecl *index = new ObjectDecl( indexName.newName(), Declaration ::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), 0 );508 ObjectDecl *index = new ObjectDecl( indexName.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), 0 ); 509 509 *out++ = new DeclStmt( noLabels, index ); 510 510 … … 544 544 FunctionType *assignType = new FunctionType( Type::Qualifiers(), false ); 545 545 546 ObjectDecl *returnVal = new ObjectDecl( "", Declaration ::NoStorageClass, LinkageSpec::Cforall, 0, refType->clone(), 0 );546 ObjectDecl *returnVal = new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, refType->clone(), 0 ); 547 547 assignType->get_returnVals().push_back( returnVal ); 548 548 549 ObjectDecl *dstParam = new ObjectDecl( "_dst", Declaration ::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), refType->clone() ), 0 );549 ObjectDecl *dstParam = new ObjectDecl( "_dst", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), refType->clone() ), 0 ); 550 550 assignType->get_parameters().push_back( dstParam ); 551 551 552 ObjectDecl *srcParam = new ObjectDecl( "_src", Declaration ::NoStorageClass, LinkageSpec::Cforall, 0, refType, 0 );552 ObjectDecl *srcParam = new ObjectDecl( "_src", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, refType, 0 ); 553 553 assignType->get_parameters().push_back( srcParam ); 554 554 555 555 // Routines at global scope marked "static" to prevent multiple definitions is separate translation units 556 556 // because each unit generates copies of the default routines for each aggregate. 557 FunctionDecl *assignDecl = new FunctionDecl( "?=?", functionNesting > 0 ? Declaration ::NoStorageClass : Declaration::Static, LinkageSpec::AutoGen, assignType, new CompoundStmt( noLabels ), true );557 FunctionDecl *assignDecl = new FunctionDecl( "?=?", functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static, LinkageSpec::AutoGen, assignType, new CompoundStmt( noLabels ), true ); 558 558 assignDecl->fixUniqueId(); 559 559 … … 587 587 FunctionType *assignType = new FunctionType( Type::Qualifiers(), false ); 588 588 589 ObjectDecl *returnVal = new ObjectDecl( "", Declaration ::NoStorageClass, LinkageSpec::Cforall, 0, refType->clone(), 0 );589 ObjectDecl *returnVal = new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, refType->clone(), 0 ); 590 590 assignType->get_returnVals().push_back( returnVal ); 591 591 592 ObjectDecl *dstParam = new ObjectDecl( "_dst", Declaration ::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), refType->clone() ), 0 );592 ObjectDecl *dstParam = new ObjectDecl( "_dst", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), refType->clone() ), 0 ); 593 593 assignType->get_parameters().push_back( dstParam ); 594 594 595 ObjectDecl *srcParam = new ObjectDecl( "_src", Declaration ::NoStorageClass, LinkageSpec::Cforall, 0, refType, 0 );595 ObjectDecl *srcParam = new ObjectDecl( "_src", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, refType, 0 ); 596 596 assignType->get_parameters().push_back( srcParam ); 597 597 598 598 // Routines at global scope marked "static" to prevent multiple definitions is separate translation units 599 599 // because each unit generates copies of the default routines for each aggregate. 600 FunctionDecl *assignDecl = new FunctionDecl( "?=?", functionNesting > 0 ? Declaration ::NoStorageClass : Declaration::Static, LinkageSpec::AutoGen, assignType, new CompoundStmt( noLabels ), true );600 FunctionDecl *assignDecl = new FunctionDecl( "?=?", functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static, LinkageSpec::AutoGen, assignType, new CompoundStmt( noLabels ), true ); 601 601 assignDecl->fixUniqueId(); 602 602 … … 633 633 TypeInstType *typeInst = new TypeInstType( Type::Qualifiers(), typeDecl->get_name(), false ); 634 634 typeInst->set_baseType( typeDecl ); 635 ObjectDecl *src = new ObjectDecl( "_src", Declaration ::NoStorageClass, LinkageSpec::Cforall, 0, typeInst->clone(), 0 );636 ObjectDecl *dst = new ObjectDecl( "_dst", Declaration ::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), typeInst->clone() ), 0 );635 ObjectDecl *src = new ObjectDecl( "_src", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, typeInst->clone(), 0 ); 636 ObjectDecl *dst = new ObjectDecl( "_dst", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), typeInst->clone() ), 0 ); 637 637 if ( typeDecl->get_base() ) { 638 638 stmts = new CompoundStmt( std::list< Label >() ); … … 643 643 } // if 644 644 FunctionType *type = new FunctionType( Type::Qualifiers(), false ); 645 type->get_returnVals().push_back( new ObjectDecl( "", Declaration ::NoStorageClass, LinkageSpec::Cforall, 0, typeInst, 0 ) );645 type->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, typeInst, 0 ) ); 646 646 type->get_parameters().push_back( dst ); 647 647 type->get_parameters().push_back( src ); 648 FunctionDecl *func = new FunctionDecl( "?=?", Declaration ::NoStorageClass, LinkageSpec::AutoGen, type, stmts, false );648 FunctionDecl *func = new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::AutoGen, type, stmts, false ); 649 649 declsToAdd.push_back( func ); 650 650 }
Note: See TracChangeset
for help on using the changeset viewer.