Changes in src/Tuples/TupleExpansion.cc [d56e5bc:e4d829b]
- File:
-
- 1 edited
-
src/Tuples/TupleExpansion.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/TupleExpansion.cc
rd56e5bc re4d829b 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 21 17:35:04201713 // Update Count : 1 912 // Last Modified On : Thu Mar 16 08:05:17 2017 13 // Update Count : 15 14 14 // 15 15 … … 191 191 commaExpr->set_arg1( nullptr ); 192 192 } 193 ObjectDecl * finished = new ObjectDecl( toString( "_unq", id, "_finished_" ), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new BasicType( Type::Qualifiers(), BasicType::Bool ),194 new SingleInit( new ConstantExpr( Constant::from_int( 0 ) ), noDesignators) );193 BasicType * boolType = new BasicType( Type::Qualifiers(), BasicType::Bool ); 194 ObjectDecl * finished = new ObjectDecl( toString( "_unq", id, "_finished_" ), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new BasicType( Type::Qualifiers(), BasicType::Bool ), new SingleInit( new ConstantExpr( Constant( boolType->clone(), "0" ) ) ) ); 195 195 addDeclaration( finished ); 196 196 // (finished ? _unq_expr_N : (_unq_expr_N = <unqExpr->get_expr()>, finished = 1, _unq_expr_N)) 197 197 // This pattern ensures that each unique expression is evaluated once, regardless of evaluation order of the generated C code. 198 Expression * assignFinished = UntypedExpr::createAssign( new VariableExpr(finished), new ConstantExpr( Constant ::from_int( 1) ) );198 Expression * assignFinished = UntypedExpr::createAssign( new VariableExpr(finished), new ConstantExpr( Constant( boolType->clone(), "1" ) ) ); 199 199 ConditionalExpr * condExpr = new ConditionalExpr( new VariableExpr( finished ), var->clone(), 200 200 new CommaExpr( new CommaExpr( assignUnq, assignFinished ), var->clone() ) ); … … 354 354 maybeImpure = true; 355 355 } 356 virtual void visit( __attribute__((unused))UntypedExpr * untypedExpr ) { maybeImpure = true; }356 virtual void visit( UntypedExpr * untypedExpr ) { maybeImpure = true; } 357 357 bool maybeImpure = false; 358 358 };
Note:
See TracChangeset
for help on using the changeset viewer.