Changeset 5809461 for src/SynTree
- Timestamp:
- Sep 1, 2017, 6:59:48 PM (7 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:
- b0dfbc4
- Parents:
- bc3127d
- Location:
- src/SynTree
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/AddressExpr.cc
rbc3127d r5809461 70 70 } 71 71 72 LabelAddressExpr::LabelAddressExpr( const Label &arg ) : arg( arg ) { 73 // label address always has type void * 74 result = new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ); 75 } 76 LabelAddressExpr::LabelAddressExpr( const LabelAddressExpr & other ) : Expression( other ), arg( other.arg ) {} 77 LabelAddressExpr::~LabelAddressExpr() {} 78 79 void LabelAddressExpr::print( std::ostream & os, int indent ) const { 80 os << "Address of label:" << std::endl << std::string( indent+2, ' ' ) << arg; 81 } 82 72 83 // Local Variables: // 73 84 // tab-width: 4 // -
src/SynTree/Expression.h
rbc3127d r5809461 24 24 #include "Constant.h" // for Constant 25 25 #include "Initializer.h" // for Designation (ptr only), Initializer 26 #include "Label.h" // for Label 26 27 #include "Mutator.h" // for Mutator 27 28 #include "SynTree.h" // for UniqueId … … 173 174 }; 174 175 175 // xxx - this doesn't appear to actually be hooked in anywhere. We should use this instead of the "&&"" UntypedExpr hack 176 // GCC &&label 177 // https://gcc.gnu.org/onlinedocs/gcc-3.4.2/gcc/Labels-as-Values.html 176 178 class LabelAddressExpr : public Expression { 177 179 public: 178 Expression *arg;179 180 LabelAddressExpr( Expression *arg );180 Label arg; 181 182 LabelAddressExpr( const Label &arg ); 181 183 LabelAddressExpr( const LabelAddressExpr & other ); 182 184 virtual ~LabelAddressExpr(); 183 184 Expression * get_arg() const { return arg; }185 void set_arg(Expression * newValue ) { arg = newValue; }186 185 187 186 virtual LabelAddressExpr * clone() const { return new LabelAddressExpr( * this ); } -
src/SynTree/Mutator.cc
rbc3127d r5809461 246 246 labelAddressExpr->set_env( maybeMutate( labelAddressExpr->get_env(), *this ) ); 247 247 labelAddressExpr->set_result( maybeMutate( labelAddressExpr->get_result(), *this ) ); 248 labelAddressExpr->set_arg( maybeMutate( labelAddressExpr->get_arg(), *this ) );249 248 return labelAddressExpr; 250 249 } -
src/SynTree/Visitor.cc
rbc3127d r5809461 205 205 void Visitor::visit( LabelAddressExpr *labAddressExpr ) { 206 206 maybeAccept( labAddressExpr->get_result(), *this ); 207 maybeAccept( labAddressExpr->get_arg(), *this );208 207 } 209 208
Note: See TracChangeset
for help on using the changeset viewer.