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