Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    r0d70e0d rc8e4d2f8  
    7676#include "SynTree/Visitor.h"           // for Visitor
    7777#include "Validate/HandleAttributes.h" // for handleAttributes
     78#include "Validate/FindSpecialDecls.h" // for FindSpecialDecls
    7879
    7980class CompoundStmt;
     
    288289        };
    289290
    290         FunctionDecl * dereferenceOperator = nullptr;
    291         struct FindSpecialDeclarations final {
    292                 void previsit( FunctionDecl * funcDecl );
    293         };
    294 
    295291        void validate( std::list< Declaration * > &translationUnit, __attribute__((unused)) bool doDebug ) {
    296292                PassVisitor<EnumAndPointerDecay> epc;
     
    299295                PassVisitor<CompoundLiteral> compoundliteral;
    300296                PassVisitor<ValidateGenericParameters> genericParams;
    301                 PassVisitor<FindSpecialDeclarations> finder;
    302297                PassVisitor<LabelAddressFixer> labelAddrFixer;
    303298                PassVisitor<HoistTypeDecls> hoistDecls;
     
    378373                        });
    379374                        Stats::Time::TimeBlock("Find Special Declarations", [&]() {
    380                                 acceptAll( translationUnit, finder ); // xxx - remove this pass soon
     375                                Validate::findSpecialDecls( translationUnit );
    381376                        });
    382377                        Stats::Time::TimeBlock("Fix Label Address", [&]() {
     
    943938                if ( eliminator.pass.typedefNames.count( "size_t" ) ) {
    944939                        // grab and remember declaration of size_t
    945                         SizeType = eliminator.pass.typedefNames["size_t"].first->base->clone();
     940                        Validate::SizeType = eliminator.pass.typedefNames["size_t"].first->base->clone();
    946941                } else {
    947942                        // xxx - missing global typedef for size_t - default to long unsigned int, even though that may be wrong
    948943                        // eventually should have a warning for this case.
    949                         SizeType = new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt );
     944                        Validate::SizeType = new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt );
    950945                }
    951946        }
     
    13351330                        // need to resolve array dimensions early so that constructor code can correctly determine
    13361331                        // if a type is a VLA (and hence whether its elements need to be constructed)
    1337                         ResolvExpr::findSingleExpression( type->dimension, SymTab::SizeType->clone(), indexer );
     1332                        ResolvExpr::findSingleExpression( type->dimension, Validate::SizeType->clone(), indexer );
    13381333
    13391334                        // must re-evaluate whether a type is a VLA, now that more information is available
     
    13731368        }
    13741369
    1375         void FindSpecialDeclarations::previsit( FunctionDecl * funcDecl ) {
    1376                 if ( ! dereferenceOperator ) {
    1377                         if ( funcDecl->get_name() == "*?" && funcDecl->get_linkage() == LinkageSpec::Intrinsic ) {
    1378                                 FunctionType * ftype = funcDecl->get_functionType();
    1379                                 if ( ftype->get_parameters().size() == 1 && ftype->get_parameters().front()->get_type()->get_qualifiers() == Type::Qualifiers() ) {
    1380                                         dereferenceOperator = funcDecl;
    1381                                 }
    1382                         }
    1383                 }
     1370        const ast::Type * validateType( const ast::Type * type, const ast::SymbolTable & symtab ) {
     1371                #warning unimplemented
     1372                (void)type; (void)symtab;
     1373                assert(false);
     1374                return nullptr;
    13841375        }
    13851376} // namespace SymTab
Note: See TracChangeset for help on using the changeset viewer.