Changeset 4e5e6cc for src


Ignore:
Timestamp:
Jun 7, 2019, 2:54:34 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
ef75948
Parents:
5684736
Message:

Fixed indentation and remove too strict abort

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r5684736 r4e5e6cc  
    116116        }
    117117
    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 ) {}
    120120
    121121        string CodeGenerator::mangleName( DeclarationWithType * decl ) {
  • src/Common/Indenter.h

    r5684736 r4e5e6cc  
    2323        unsigned int amt;         ///< spaces in one level of indentation
    2424
    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; }
    3030        Indenter operator+(int nlevels) { Indenter indenter = *this; return indenter += nlevels; }
    3131        Indenter operator-(int nlevels) { Indenter indenter = *this; return indenter -= nlevels; }
     
    3535
    3636inline 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, ' ');
    3838}
    3939
  • src/InitTweak/FixInit.cc

    r5684736 r4e5e6cc  
    301301                                replacement = new CastExpr( replacement, base->clone() );
    302302                        }
    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 ) } );
    311304                        dtorFunc->statements->push_back( strict_dynamic_cast<Statement *>( dtor ) );
    312305
Note: See TracChangeset for help on using the changeset viewer.