Changeset b2ecd48


Ignore:
Timestamp:
Jul 4, 2023, 2:10:54 PM (11 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
7f1be01
Parents:
0ec4eb0
Message:

Changes related to invariant checking scoping, it is not ready by these are unlikely to change.

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/KeywordsNew.cpp

    r0ec4eb0 rb2ecd48  
    534534void ConcurrentSueKeyword::addGetRoutines(
    535535                const ast::ObjectDecl * field, const ast::FunctionDecl * forward ) {
     536        // Clone the signature and then build the body.
     537        ast::FunctionDecl * decl = ast::deepCopy( forward );
     538
    536539        // Say it is generated at the "same" places as the forward declaration.
    537         const CodeLocation & location = forward->location;
    538 
    539         const ast::DeclWithType * param = forward->params.front();
     540        const CodeLocation & location = decl->location;
     541
     542        const ast::DeclWithType * param = decl->params.front();
    540543        ast::Stmt * stmt = new ast::ReturnStmt( location,
    541544                new ast::AddressExpr( location,
     
    551554        );
    552555
    553         ast::FunctionDecl * decl = ast::deepCopy( forward );
    554556        decl->stmts = new ast::CompoundStmt( location, { stmt } );
    555557        declsToAddAfter.push_back( decl );
  • src/SymTab/FixFunction.cc

    r0ec4eb0 rb2ecd48  
    109109
    110110                const ast::DeclWithType * postvisit( const ast::FunctionDecl * func ) {
    111                         return new ast::ObjectDecl{
    112                                 func->location, func->name, new ast::PointerType{ func->type }, nullptr,
     111                        // Cannot handle cases with asserions.
     112                        assert( func->assertions.empty() );
     113                        return new ast::ObjectDecl{
     114                                func->location, func->name, new ast::PointerType( func->type ), nullptr,
    113115                                func->storage, func->linkage, nullptr, copy( func->attributes ) };
    114116                }
     
    117119
    118120                const ast::Type * postvisit( const ast::ArrayType * array ) {
    119                         return new ast::PointerType{ 
    120                                 array->base, array->dimension, array->isVarLen, array->isStatic, 
     121                        return new ast::PointerType{
     122                                array->base, array->dimension, array->isVarLen, array->isStatic,
    121123                                array->qualifiers };
    122124                }
Note: See TracChangeset for help on using the changeset viewer.