Changes in src/SymTab/Validate.cc [0d70e0d:c8e4d2f8]
- File:
-
- 1 edited
-
src/SymTab/Validate.cc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
r0d70e0d rc8e4d2f8 76 76 #include "SynTree/Visitor.h" // for Visitor 77 77 #include "Validate/HandleAttributes.h" // for handleAttributes 78 #include "Validate/FindSpecialDecls.h" // for FindSpecialDecls 78 79 79 80 class CompoundStmt; … … 288 289 }; 289 290 290 FunctionDecl * dereferenceOperator = nullptr;291 struct FindSpecialDeclarations final {292 void previsit( FunctionDecl * funcDecl );293 };294 295 291 void validate( std::list< Declaration * > &translationUnit, __attribute__((unused)) bool doDebug ) { 296 292 PassVisitor<EnumAndPointerDecay> epc; … … 299 295 PassVisitor<CompoundLiteral> compoundliteral; 300 296 PassVisitor<ValidateGenericParameters> genericParams; 301 PassVisitor<FindSpecialDeclarations> finder;302 297 PassVisitor<LabelAddressFixer> labelAddrFixer; 303 298 PassVisitor<HoistTypeDecls> hoistDecls; … … 378 373 }); 379 374 Stats::Time::TimeBlock("Find Special Declarations", [&]() { 380 acceptAll( translationUnit, finder ); // xxx - remove this pass soon375 Validate::findSpecialDecls( translationUnit ); 381 376 }); 382 377 Stats::Time::TimeBlock("Fix Label Address", [&]() { … … 943 938 if ( eliminator.pass.typedefNames.count( "size_t" ) ) { 944 939 // 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(); 946 941 } else { 947 942 // xxx - missing global typedef for size_t - default to long unsigned int, even though that may be wrong 948 943 // 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 ); 950 945 } 951 946 } … … 1335 1330 // need to resolve array dimensions early so that constructor code can correctly determine 1336 1331 // 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 ); 1338 1333 1339 1334 // must re-evaluate whether a type is a VLA, now that more information is available … … 1373 1368 } 1374 1369 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; 1384 1375 } 1385 1376 } // namespace SymTab
Note:
See TracChangeset
for help on using the changeset viewer.