Changeset 58dd019 for src/SynTree
- Timestamp:
- Dec 13, 2016, 3:14:59 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 04c8bba
- Parents:
- 2ee5426
- Location:
- src/SynTree
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/SynTree/Declaration.h ¶
r2ee5426 r58dd019 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Aug 18 23:50:24201613 // Update Count : 4 012 // Last Modified On : Tue Dec 13 13:37:33 2016 13 // Update Count : 49 14 14 // 15 15 … … 69 69 70 70 std::string get_mangleName() const { return mangleName; } 71 void set_mangleName( std::string newValue ) { mangleName = newValue; }71 DeclarationWithType * set_mangleName( std::string newValue ) { mangleName = newValue; return this; } 72 72 73 73 std::string get_scopedMangleName() const { return mangleName + "_" + std::to_string(scopeLevel); } 74 74 75 75 int get_scopeLevel() const { return scopeLevel; } 76 void set_scopeLevel( int newValue ) { scopeLevel = newValue; } 76 DeclarationWithType * set_scopeLevel( int newValue ) { scopeLevel = newValue; return this; } 77 78 ConstantExpr *get_asmName() const { return asmName; } 79 DeclarationWithType * set_asmName( ConstantExpr *newValue ) { asmName = newValue; return this; } 77 80 78 81 std::list< Attribute * >& get_attributes() { return attributes; } … … 87 90 // this represents the type with all types and typedefs expanded it is generated by SymTab::Validate::Pass2 88 91 std::string mangleName; 89 // need to remember the scope level at which the variable was declared, so that 90 // shadowed identifiers can be accessed 92 // need to remember the scope level at which the variable was declared, so that shadowed identifiers can be accessed 91 93 int scopeLevel = 0; 92 94 95 ConstantExpr *asmName; 93 96 std::list< Attribute * > attributes; 94 97 }; … … 106 109 Initializer *get_init() const { return init; } 107 110 void set_init( Initializer *newValue ) { init = newValue; } 111 108 112 Expression *get_bitfieldWidth() const { return bitfieldWidth; } 109 113 void set_bitfieldWidth( Expression *newValue ) { bitfieldWidth = newValue; } -
TabularUnified src/SynTree/DeclarationWithType.cc ¶
r2ee5426 r58dd019 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Aug 18 23:50:41201613 // Update Count : 412 // Last Modified On : Tue Dec 13 14:49:43 2016 13 // Update Count : 7 14 14 // 15 15 … … 20 20 21 21 DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes ) 22 : Declaration( name, sc, linkage), attributes( attributes ) {22 : Declaration( name, sc, linkage ), asmName( nullptr ), attributes( attributes ) { 23 23 } 24 24 … … 26 26 : Declaration( other ), mangleName( other.mangleName ), scopeLevel( other.scopeLevel ) { 27 27 cloneAll( other.attributes, attributes ); 28 asmName = maybeClone( other.asmName ); 28 29 } 29 30 30 31 DeclarationWithType::~DeclarationWithType() { 31 32 deleteAll( attributes ); 33 delete asmName; 32 34 } 33 35
Note: See TracChangeset
for help on using the changeset viewer.