Changes in src/SynTree/Declaration.h [4040425:7baed7d]
- File:
-
- 1 edited
-
src/SynTree/Declaration.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
r4040425 r7baed7d 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Declaration.h -- 7 // Declaration.h -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed Mar 2 17:28:11201611 // Last Modified By : Rob Schluntz 12 // Last Modified On : Fri May 06 16:26:12 2016 13 13 // Update Count : 33 14 14 // … … 22 22 #include "Parser/LinkageSpec.h" 23 23 #include "Parser/ParseNode.h" 24 #include <string> 24 25 25 26 class Declaration { … … 67 68 void set_mangleName( std::string newValue ) { mangleName = newValue; } 68 69 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 69 75 virtual DeclarationWithType *clone() const = 0; 70 76 virtual DeclarationWithType *acceptMutator( Mutator &m ) = 0; … … 75 81 // this represents the type with all types and typedefs expanded it is generated by SymTab::Validate::Pass2 76 82 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; 77 86 }; 78 87 … … 106 115 typedef DeclarationWithType Parent; 107 116 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 * >() ); 109 118 FunctionDecl( const FunctionDecl &other ); 110 119 virtual ~FunctionDecl(); … … 119 128 std::list< std::string >& get_oldIdents() { return oldIdents; } 120 129 std::list< Declaration* >& get_oldDecls() { return oldDecls; } 130 std::list< Attribute * >& get_attributes() { return attributes; } 121 131 122 132 virtual FunctionDecl *clone() const { return new FunctionDecl( *this ); } … … 130 140 std::list< std::string > oldIdents; 131 141 std::list< Declaration* > oldDecls; 142 std::list< Attribute * > attributes; 132 143 }; 133 144
Note:
See TracChangeset
for help on using the changeset viewer.