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