Changeset f326f99 for src/SynTree
- Timestamp:
- Apr 11, 2016, 4:56:43 PM (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, with_gc
- Children:
- f77f12e2
- Parents:
- eab39cd
- Location:
- src/SynTree
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
reab39cd rf326f99 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Mon Apr 04 17:14:00201612 // Last Modified On : Mon Apr 11 16:55:12 2016 13 13 // Update Count : 36 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 -
src/SynTree/DeclarationWithType.cc
reab39cd rf326f99 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // DeclarationWithType.cc -- 7 // DeclarationWithType.cc -- 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 : Sat Jun 13 08:08:07 201511 // Last Modified By : Rob Schluntz 12 // Last Modified On : Mon Apr 11 15:35:27 2016 13 13 // Update Count : 3 14 14 // … … 23 23 24 24 DeclarationWithType::DeclarationWithType( const DeclarationWithType &other ) 25 : Declaration( other ), mangleName( other.mangleName ) {25 : Declaration( other ), mangleName( other.mangleName ), scopeLevel( other.scopeLevel ) { 26 26 } 27 27
Note:
See TracChangeset
for help on using the changeset viewer.