Changes in src/SymTab/Indexer.cc [bff227f:30f9072]
- File:
-
- 1 edited
-
src/SymTab/Indexer.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Indexer.cc
rbff227f r30f9072 16 16 #include "Indexer.h" 17 17 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" 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 40 37 41 38 #define debugPrint(x) if ( doDebug ) { std::cout << x; } … … 114 111 void Indexer::removeSpecialOverrides( const std::string &id, std::list< DeclarationWithType * > & out ) const { 115 112 // only need to perform this step for constructors, destructors, and assignment functions 116 if ( ! CodeGen::isCtorDtorAssign( id ) ) return;113 if ( ! InitTweak::isCtorDtorAssign( id ) ) return; 117 114 118 115 // helpful data structure … … 142 139 decls.push_back( DeclBall{ function, isUserDefinedFunc, isDefaultCtor, isDtor, isCopyFunc } ); 143 140 existsUserDefinedFunc = existsUserDefinedFunc || isUserDefinedFunc; 144 existsUserDefinedCtor = existsUserDefinedCtor || (isUserDefinedFunc && CodeGen::isConstructor( function->get_name() ) );141 existsUserDefinedCtor = existsUserDefinedCtor || (isUserDefinedFunc && InitTweak::isConstructor( function->get_name() ) ); 145 142 existsUserDefinedDtor = existsUserDefinedDtor || (isUserDefinedFunc && isDtor); 146 143 existsUserDefinedCopyFunc = existsUserDefinedCopyFunc || (isUserDefinedFunc && isCopyFunc); … … 160 157 assert( ! params.empty() ); 161 158 // use base type of pointer, so that qualifiers on the pointer type aren't considered. 162 Type * base = InitTweak::getPointerBase( params.front()->get_type() ); 163 assert( base ); 159 Type * base = safe_dynamic_cast< PointerType * >( params.front()->get_type() )->get_base(); 164 160 funcMap[ Mangler::mangle( base ) ] += function; 165 161 } else {
Note:
See TracChangeset
for help on using the changeset viewer.