- Timestamp:
- Jun 7, 2019, 3:30:16 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- e7f8119
- Parents:
- e16e27e1 (diff), be8518f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/AssertAcyclic.cpp
re16e27e1 r9856ca9 10 10 // Created On : Thu Jun 06 15:00:00 2019 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Thu Jun 06 15:00:00 201913 // Update Count : 012 // Last Modified On : Fri Jun 07 14:32:00 2019 13 // Update Count : 1 14 14 // 15 15 … … 20 20 namespace { 21 21 22 class NoStrongCyclesCore : public ast::WithGuards{22 class NoStrongCyclesCore { 23 23 std::vector<const ast::Node *> parents; 24 24 public: 25 void previsit 26 for (auto & p : parents) {27 assert(p != node);25 void previsit( const ast::Node * node ) { 26 for (auto & parent : parents) { 27 assert(parent != node); 28 28 } 29 29 parents.push_back(node); 30 GuardAction( [this]() { parents.pop_back(); } ); 30 } 31 void postvisit( const ast::Node * ) { 32 parents.pop_back(); 31 33 } 32 34 }; … … 36 38 namespace ast { 37 39 38 void assertAcyclic( const std::list< ast::ptr< ast::Decl > > translationUnit ) {40 void assertAcyclic( const std::list< ast::ptr< ast::Decl > > & translationUnit ) { 39 41 Pass<NoStrongCyclesCore> visitor; 40 42 for ( auto & decl : translationUnit ) { -
src/AST/AssertAcyclic.hpp
re16e27e1 r9856ca9 8 8 // 9 9 // Author : Andrew Beach 10 // Created On : Thr May6 15:00:00 201910 // Created On : Thr Jun 6 15:00:00 2019 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr May 6 15:00:00 201913 // Update Count : 012 // Last Modified On : Fri Jun 7 14:32:00 2019 13 // Update Count : 1 14 14 // 15 15 … … 25 25 namespace ast { 26 26 27 void assertAcyclic( const std::list< ast::ptr< ast::Decl > > translationUnit );27 void assertAcyclic( const std::list< ast::ptr< ast::Decl > > & translationUnit ); 28 28 29 29 } -
src/AST/Pass.hpp
re16e27e1 r9856ca9 293 293 at_cleanup( [func](void *) { func(); }, nullptr ); 294 294 } 295 296 /// When this node is finished being visited, call a member of an object. 297 template<typename T> 298 void GuardMethod( T * obj, void (T::*method)() ) { 299 at_cleanup( [ method ]( void * object ) { 300 static_cast< T * >( object )->method(); 301 }, static_cast< void * >( obj ) ); 302 } 295 303 }; 296 304 -
src/CodeGen/CodeGenerator.cc
re16e27e1 r9856ca9 116 116 } 117 117 118 CodeGenerator::CodeGenerator( std::ostream & os, bool pretty, bool genC, bool lineMarks, bool printExprTypes ) : indent( CodeGenerator::tabsize ), output( os ), printLabels( *this ), options( pretty, genC, lineMarks, printExprTypes ), endl( *this ) {}119 CodeGenerator::CodeGenerator( std::ostream & os, const Options &options ) : indent( CodeGenerator::tabsize ), output( os ), printLabels( *this ), options(options), endl( *this ) {}118 CodeGenerator::CodeGenerator( std::ostream & os, bool pretty, bool genC, bool lineMarks, bool printExprTypes ) : indent( 0, CodeGenerator::tabsize ), output( os ), printLabels( *this ), options( pretty, genC, lineMarks, printExprTypes ), endl( *this ) {} 119 CodeGenerator::CodeGenerator( std::ostream & os, const Options &options ) : indent( 0, CodeGenerator::tabsize ), output( os ), printLabels( *this ), options(options), endl( *this ) {} 120 120 121 121 string CodeGenerator::mangleName( DeclarationWithType * decl ) { -
src/Common/Indenter.h
re16e27e1 r9856ca9 23 23 unsigned int amt; ///< spaces in one level of indentation 24 24 25 Indenter( unsigned int indent = 0, unsigned int amt = tabsize ) 26 : indent( indent *amt), amt( amt ) {}27 28 Indenter & operator+=(int nlevels) { indent += amt*nlevels; return *this; }29 Indenter & operator-=(int nlevels) { indent -= amt*nlevels; return *this; }25 Indenter( unsigned int indent = 0, unsigned int amt = tabsize ) 26 : indent( indent ), amt( amt ) {} 27 28 Indenter & operator+=(int nlevels) { indent += nlevels; return *this; } 29 Indenter & operator-=(int nlevels) { indent -= nlevels; return *this; } 30 30 Indenter operator+(int nlevels) { Indenter indenter = *this; return indenter += nlevels; } 31 31 Indenter operator-(int nlevels) { Indenter indenter = *this; return indenter -= nlevels; } … … 35 35 36 36 inline std::ostream & operator<<( std::ostream & out, const Indenter & indent ) { 37 return out << std::string(indent.indent , ' ');37 return out << std::string(indent.indent * indent.amt, ' '); 38 38 } 39 39 -
src/InitTweak/FixInit.cc
re16e27e1 r9856ca9 301 301 replacement = new CastExpr( replacement, base->clone() ); 302 302 } 303 size_t replaced = DeclReplacer::replace( dtor, { std::make_pair( objDecl, replacement ) } ); 304 if(replaced == 0) { 305 objDecl->print(std::cerr); 306 std::cerr << "-----" << std::endl; 307 dtor->print(std::cerr); 308 std::cerr << "Failed to replace " << objDecl << std::endl; 309 abort(); 310 } 303 DeclReplacer::replace( dtor, { std::make_pair( objDecl, replacement ) } ); 311 304 dtorFunc->statements->push_back( strict_dynamic_cast<Statement *>( dtor ) ); 312 305
Note: See TracChangeset
for help on using the changeset viewer.