Changeset e4d829b for src/InitTweak
- Timestamp:
- Jun 20, 2017, 1:19:53 PM (9 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:
- 579263a
- Parents:
- c6d2e93
- git-author:
- Rob Schluntz <rschlunt@…> (06/20/17 13:16:13)
- git-committer:
- Rob Schluntz <rschlunt@…> (06/20/17 13:19:53)
- Location:
- src/InitTweak
- Files:
-
- 2 edited
-
FixInit.cc (modified) (1 diff)
-
InitTweak.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInit.cc
rc6d2e93 re4d829b 726 726 // static bool __objName_uninitialized = true 727 727 BasicType * boolType = new BasicType( Type::Qualifiers(), BasicType::Bool ); 728 SingleInit * boolInitExpr = new SingleInit( new ConstantExpr( Constant( boolType->clone(), "1" ) ) , noDesignators);728 SingleInit * boolInitExpr = new SingleInit( new ConstantExpr( Constant( boolType->clone(), "1" ) ) ); 729 729 ObjectDecl * isUninitializedVar = new ObjectDecl( objDecl->get_mangleName() + "_uninitialized", Type::StorageClasses( Type::Static ), LinkageSpec::Cforall, 0, boolType, boolInitExpr ); 730 730 isUninitializedVar->fixUniqueId(); -
src/InitTweak/InitTweak.cc
rc6d2e93 re4d829b 14 14 public: 15 15 bool hasDesignations = false; 16 template<typename Init> 17 void handleInit( Init * init ) { 18 if ( ! init->get_designators().empty() ) hasDesignations = true; 19 else Visitor::visit( init ); 20 } 21 virtual void visit( SingleInit * singleInit ) { handleInit( singleInit); } 22 virtual void visit( ListInit * listInit ) { handleInit( listInit); } 16 virtual void visit( Designation * des ) { 17 if ( ! des->get_designators().empty() ) hasDesignations = true; 18 else Visitor::visit( des ); 19 } 23 20 }; 24 21
Note:
See TracChangeset
for help on using the changeset viewer.