Changes in src/InitTweak/FixInit.cc [0508ab3:d56e5bc]
- File:
-
- 1 edited
-
src/InitTweak/FixInit.cc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInit.cc
r0508ab3 rd56e5bc 10 10 // Created On : Wed Jan 13 16:29:30 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 17 09:13:47201713 // Update Count : 7 112 // Last Modified On : Wed Jun 21 17:35:05 2017 13 // Update Count : 74 14 14 // 15 15 … … 56 56 typedef std::unordered_map< int, int > UnqCount; 57 57 58 class InsertImplicitCalls : public WithTypeSubstitution{58 class InsertImplicitCalls { 59 59 public: 60 60 /// wrap function application expressions as ImplicitCopyCtorExpr nodes so that it is easy to identify which … … 69 69 // collects environments for relevant nodes 70 70 EnvMap & envMap; 71 TypeSubstitution * env; //Magically populated by the PassVisitor 71 72 }; 72 73 … … 191 192 }; 192 193 193 class FixInit : public WithStmtsToAdd{194 class FixInit { 194 195 public: 195 196 /// expand each object declaration to use its constructor after it is declared. … … 199 200 200 201 std::list< Declaration * > staticDtorDecls; 202 std::list< Statement * > stmtsToAddAfter; // found by PassVisitor 201 203 }; 202 204 … … 724 726 // static bool __objName_uninitialized = true 725 727 BasicType * boolType = new BasicType( Type::Qualifiers(), BasicType::Bool ); 726 SingleInit * boolInitExpr = new SingleInit( new ConstantExpr( Constant ( boolType->clone(), "1") ), noDesignators );728 SingleInit * boolInitExpr = new SingleInit( new ConstantExpr( Constant::from_int( 1 ) ), noDesignators ); 727 729 ObjectDecl * isUninitializedVar = new ObjectDecl( objDecl->get_mangleName() + "_uninitialized", Type::StorageClasses( Type::Static ), LinkageSpec::Cforall, 0, boolType, boolInitExpr ); 728 730 isUninitializedVar->fixUniqueId(); … … 731 733 UntypedExpr * setTrue = new UntypedExpr( new NameExpr( "?=?" ) ); 732 734 setTrue->get_args().push_back( new VariableExpr( isUninitializedVar ) ); 733 setTrue->get_args().push_back( new ConstantExpr( Constant ( boolType->clone(), "0") ) );735 setTrue->get_args().push_back( new ConstantExpr( Constant::from_int( 0 ) ) ); 734 736 735 737 // generate body of if
Note:
See TracChangeset
for help on using the changeset viewer.