Ignore:
Timestamp:
Jun 30, 2016, 4:32:56 PM (9 years ago)
Author:
Thierry Delisle <tdelisle@…>
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, with_gc
Children:
ea29e73
Parents:
1b5c81ed (diff), 84d4d6f (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.
Message:

Merge branch 'master' into gc_noraii

Conflicts:

Jenkinsfile
src/SymTab/Validate.cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    r1b5c81ed rf80e0218  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Declaration.h -- 
     7// Declaration.h --
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar  2 17:28:11 2016
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Fri May 06 16:26:12 2016
    1313// Update Count     : 33
    1414//
     
    2222#include "Parser/LinkageSpec.h"
    2323#include "Parser/ParseNode.h"
     24#include <string>
    2425
    2526class Declaration {
     
    6768        void set_mangleName( std::string newValue ) { mangleName = newValue; }
    6869
     70        std::string get_scopedMangleName() const { return mangleName + "_" + std::to_string(scopeLevel); }
     71
     72        int get_scopeLevel() const { return scopeLevel; }
     73        void set_scopeLevel( int newValue ) { scopeLevel = newValue; }
     74
    6975        virtual DeclarationWithType *clone() const = 0;
    7076        virtual DeclarationWithType *acceptMutator( Mutator &m ) = 0;
     
    7581        // this represents the type with all types and typedefs expanded it is generated by SymTab::Validate::Pass2
    7682        std::string mangleName;
     83        // need to remember the scope level at which the variable was declared, so that
     84        // shadowed identifiers can be accessed
     85        int scopeLevel = 0;
    7786};
    7887
     
    106115        typedef DeclarationWithType Parent;
    107116  public:
    108         FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn );
     117        FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, const std::list< Attribute * > attributes = std::list< Attribute * >() );
    109118        FunctionDecl( const FunctionDecl &other );
    110119        virtual ~FunctionDecl();
     
    119128        std::list< std::string >& get_oldIdents() { return oldIdents; }
    120129        std::list< Declaration* >& get_oldDecls() { return oldDecls; }
     130        std::list< Attribute * >& get_attributes() { return attributes; }
    121131
    122132        virtual FunctionDecl *clone() const { return new FunctionDecl( *this ); }
     
    130140        std::list< std::string > oldIdents;
    131141        std::list< Declaration* > oldDecls;
     142        std::list< Attribute * > attributes;
    132143};
    133144
Note: See TracChangeset for help on using the changeset viewer.