Changeset bff09c8


Ignore:
Timestamp:
Sep 14, 2017, 1:57:20 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
aa685db
Parents:
522363e
Message:

Convert AlternativePrinter? to PassVisitor?

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativePrinter.cc

    r522363e rbff09c8  
    2626
    2727namespace ResolvExpr {
    28         AlternativePrinter::AlternativePrinter( std::ostream &os ) : SymTab::Indexer( false ), os( os ) {}
     28        AlternativePrinter::AlternativePrinter( std::ostream &os ) : os( os ) {}
    2929
    30         void AlternativePrinter::visit( ExprStmt *exprStmt ) {
     30        void AlternativePrinter::postvisit( ExprStmt *exprStmt ) {
    3131                TypeEnvironment env;
    32                 AlternativeFinder finder( *this, env );
     32                AlternativeFinder finder( indexer, env );
    3333                finder.findWithAdjustment( exprStmt->get_expr() );
    3434                int count = 1;
  • src/ResolvExpr/AlternativePrinter.h

    r522363e rbff09c8  
    1818#include <iostream>          // for ostream
    1919
    20 #include "SymTab/Indexer.h"  // for Indexer
     20#include "Common/PassVisitor.h"
    2121
    2222class ExprStmt;
    2323
    2424namespace ResolvExpr {
    25         class AlternativePrinter final : public SymTab::Indexer {
     25        class AlternativePrinter final : public WithIndexer {
    2626          public:
    2727                AlternativePrinter( std::ostream &os );
    2828
    29                 using SymTab::Indexer::visit;
    30                 virtual void visit( ExprStmt *exprStmt ) override;
     29                void postvisit( ExprStmt *exprStmt );
    3130          private:
    3231                std::ostream &os;
  • src/main.cc

    r522363e rbff09c8  
    3535#include "CodeTools/DeclStats.h"            // for printDeclStats
    3636#include "CodeTools/TrackLoc.h"             // for fillLocations
     37#include "Common/PassVisitor.h"
    3738#include "Common/CompilerError.h"           // for CompilerError
    3839#include "Common/SemanticError.h"           // for SemanticError
     
    250251
    251252                if ( expraltp ) {
    252                         ResolvExpr::AlternativePrinter printer( cout );
     253                        PassVisitor<ResolvExpr::AlternativePrinter> printer( cout );
    253254                        acceptAll( translationUnit, printer );
    254255                        return 0;
Note: See TracChangeset for help on using the changeset viewer.