Changeset 0d70e0d for src/SymTab/Validate.cc
- Timestamp:
- May 28, 2019, 3:35:00 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- eba615c
- Parents:
- 2c04369
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
r2c04369 r0d70e0d 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 21:50:04 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Tue May 28 11:07:00 201913 // Update Count : 3 6011 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 28 13:47:23 2017 13 // Update Count : 359 14 14 // 15 15 … … 288 288 }; 289 289 290 FunctionDecl * dereferenceOperator = nullptr; 291 struct FindSpecialDeclarations final { 292 void previsit( FunctionDecl * funcDecl ); 293 }; 294 290 295 void validate( std::list< Declaration * > &translationUnit, __attribute__((unused)) bool doDebug ) { 291 296 PassVisitor<EnumAndPointerDecay> epc; … … 294 299 PassVisitor<CompoundLiteral> compoundliteral; 295 300 PassVisitor<ValidateGenericParameters> genericParams; 301 PassVisitor<FindSpecialDeclarations> finder; 296 302 PassVisitor<LabelAddressFixer> labelAddrFixer; 297 303 PassVisitor<HoistTypeDecls> hoistDecls; … … 370 376 Stats::Time::TimeBlock("Array Length", [&]() { 371 377 ArrayLength::computeLength( translationUnit ); 378 }); 379 Stats::Time::TimeBlock("Find Special Declarations", [&]() { 380 acceptAll( translationUnit, finder ); // xxx - remove this pass soon 372 381 }); 373 382 Stats::Time::TimeBlock("Fix Label Address", [&]() { … … 1363 1372 return addrExpr; 1364 1373 } 1374 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 } 1384 } 1365 1385 } // namespace SymTab 1366 1386
Note: See TracChangeset
for help on using the changeset viewer.