Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Indexer.cc

    r30f9072 rbff227f  
    1616#include "Indexer.h"
    1717
    18 #include <cassert>                 // for assert, safe_dynamic_cast
    19 #include <iostream>                // for operator<<, basic_ostream, ostream
    20 #include <string>                  // for string, operator<<, operator!=
    21 #include <unordered_map>           // for operator!=, unordered_map<>::const...
    22 #include <unordered_set>           // for unordered_set
    23 #include <utility>                 // for pair, make_pair, move
    24 
    25 #include "Common/SemanticError.h"  // for SemanticError
    26 #include "Common/utility.h"        // for cloneAll
    27 #include "InitTweak/InitTweak.h"   // for isConstructor, isCopyFunction, isC...
    28 #include "Mangler.h"               // for Mangler
    29 #include "Parser/LinkageSpec.h"    // for isMangled, isOverridable, Spec
    30 #include "ResolvExpr/typeops.h"    // for typesCompatible
    31 #include "SynTree/Constant.h"      // for Constant
    32 #include "SynTree/Declaration.h"   // for DeclarationWithType, FunctionDecl
    33 #include "SynTree/Expression.h"    // for Expression, ImplicitCopyCtorExpr
    34 #include "SynTree/Initializer.h"   // for Initializer
    35 #include "SynTree/Statement.h"     // for CompoundStmt, Statement, ForStmt (...
    36 #include "SynTree/Type.h"          // for Type, StructInstType, UnionInstType
     18#include <string>
     19#include <typeinfo>
     20#include <unordered_map>
     21#include <unordered_set>
     22#include <utility>
     23#include <algorithm>
     24
     25#include "Mangler.h"
     26
     27#include "Common/utility.h"
     28
     29#include "CodeGen/OperatorTable.h"
     30
     31#include "ResolvExpr/typeops.h"
     32
     33#include "SynTree/Declaration.h"
     34#include "SynTree/Type.h"
     35#include "SynTree/Expression.h"
     36#include "SynTree/Initializer.h"
     37#include "SynTree/Statement.h"
     38
     39#include "InitTweak/InitTweak.h"
    3740
    3841#define debugPrint(x) if ( doDebug ) { std::cout << x; }
     
    111114        void Indexer::removeSpecialOverrides( const std::string &id, std::list< DeclarationWithType * > & out ) const {
    112115                // only need to perform this step for constructors, destructors, and assignment functions
    113                 if ( ! InitTweak::isCtorDtorAssign( id ) ) return;
     116                if ( ! CodeGen::isCtorDtorAssign( id ) ) return;
    114117
    115118                // helpful data structure
     
    139142                                decls.push_back( DeclBall{ function, isUserDefinedFunc, isDefaultCtor, isDtor, isCopyFunc } );
    140143                                existsUserDefinedFunc = existsUserDefinedFunc || isUserDefinedFunc;
    141                                 existsUserDefinedCtor = existsUserDefinedCtor || (isUserDefinedFunc && InitTweak::isConstructor( function->get_name() ) );
     144                                existsUserDefinedCtor = existsUserDefinedCtor || (isUserDefinedFunc && CodeGen::isConstructor( function->get_name() ) );
    142145                                existsUserDefinedDtor = existsUserDefinedDtor || (isUserDefinedFunc && isDtor);
    143146                                existsUserDefinedCopyFunc = existsUserDefinedCopyFunc || (isUserDefinedFunc && isCopyFunc);
     
    157160                                assert( ! params.empty() );
    158161                                // use base type of pointer, so that qualifiers on the pointer type aren't considered.
    159                                 Type * base = safe_dynamic_cast< PointerType * >( params.front()->get_type() )->get_base();
     162                                Type * base = InitTweak::getPointerBase( params.front()->get_type() );
     163                                assert( base );
    160164                                funcMap[ Mangler::mangle( base ) ] += function;
    161165                        } else {
Note: See TracChangeset for help on using the changeset viewer.