Changeset e04b636 for src/Concurrency
- Timestamp:
- Mar 21, 2017, 12:36:01 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:
- 168c007, cb0e6de
- Parents:
- 31ce3d6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Keywords.cc
r31ce3d6 re04b636 150 150 coroutine_decl = decl; 151 151 } 152 else if ( false) {152 else if ( decl->is_coroutine() ) { 153 153 handle( decl ); 154 154 } … … 178 178 ); 179 179 180 decl->get_members().push_ front( cor );180 decl->get_members().push_back( cor ); 181 181 182 182 return cor; … … 201 201 ) 202 202 ); 203 type->get_returnVals().push_back( 204 new ObjectDecl( 205 "ret", 206 noStorage, 207 LinkageSpec::Cforall, 208 nullptr, 209 new PointerType( 210 noQualifiers, 211 new StructInstType( 212 noQualifiers, 213 coroutine_decl 214 ) 215 ), 216 nullptr 217 ) 218 ); 203 219 204 220 CompoundStmt * statement = new CompoundStmt( noLabels ); … … 206 222 new ReturnStmt( 207 223 noLabels, 208 new UntypedMemberExpr( 209 new NameExpr( "__cor" ), 210 new NameExpr( "this" ) 224 new AddressExpr( 225 new UntypedMemberExpr( 226 new NameExpr( "__cor" ), 227 new UntypedExpr( 228 new NameExpr( "*?" ), 229 { new NameExpr( "this" ) } 230 ) 231 ) 211 232 ) 212 233 ) 213 234 ); 214 235 215 declsToAddAfter.push_back( 216 new FunctionDecl( 217 "get_coroutine", 218 Type::Static, 219 LinkageSpec::Cforall, 220 type, 221 statement, 222 noAttributes, 223 Type::Inline 224 ) 225 ); 236 FunctionDecl * get_decl = new FunctionDecl( 237 "get_coroutine", 238 Type::Static, 239 LinkageSpec::Cforall, 240 type, 241 statement, 242 noAttributes, 243 Type::Inline 244 ); 245 246 declsToAddAfter.push_back( get_decl ); 247 248 get_decl->fixUniqueId(); 226 249 } 227 250 … … 285 308 286 309 //Make sure that typed isn't mutex 287 if( !base->get_mutex() ) throw SemanticError( "mutex keyword may only appear once per argument ", arg );310 if( base->get_mutex() ) throw SemanticError( "mutex keyword may only appear once per argument ", arg ); 288 311 } 289 312
Note: See TracChangeset
for help on using the changeset viewer.