Changeset 2c04369 for src/SymTab


Ignore:
Timestamp:
May 28, 2019, 12:04:43 PM (7 years ago)
Author:
Andrew Beach <ajbeach@…>
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:
0d70e0d
Parents:
a7d50b6
Message:

Fixed some problems in convert. One of which was better solved by removing the FindSpecialDeclarations hack.

Location:
src/SymTab
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Autogen.h

    ra7d50b6 r2c04369  
    99// Author           : Rob Schluntz
    1010// Created On       : Sun May 17 21:53:34 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 22 09:50:25 2017
    13 // Update Count     : 15
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tue May 28 11:04:00 2019
     13// Update Count     : 16
    1414//
    1515
     
    4040        /// such as in determining array dimension type
    4141        extern Type * SizeType;
    42 
    43         /// intrinsic dereference operator for unqualified types - set when *? function is seen in FindSpecialDeclarations.
    44         /// Useful for creating dereference ApplicationExprs without a full resolver pass.
    45         extern FunctionDecl * dereferenceOperator;
    4642
    4743        // generate the type of an assignment function for paramType
  • src/SymTab/Validate.cc

    ra7d50b6 r2c04369  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 21:50:04 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Aug 28 13:47:23 2017
    13 // Update Count     : 359
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tue May 28 11:07:00 2019
     13// Update Count     : 360
    1414//
    1515
     
    288288        };
    289289
    290         FunctionDecl * dereferenceOperator = nullptr;
    291         struct FindSpecialDeclarations final {
    292                 void previsit( FunctionDecl * funcDecl );
    293         };
    294 
    295290        void validate( std::list< Declaration * > &translationUnit, __attribute__((unused)) bool doDebug ) {
    296291                PassVisitor<EnumAndPointerDecay> epc;
     
    299294                PassVisitor<CompoundLiteral> compoundliteral;
    300295                PassVisitor<ValidateGenericParameters> genericParams;
    301                 PassVisitor<FindSpecialDeclarations> finder;
    302296                PassVisitor<LabelAddressFixer> labelAddrFixer;
    303297                PassVisitor<HoistTypeDecls> hoistDecls;
     
    376370                        Stats::Time::TimeBlock("Array Length", [&]() {
    377371                                ArrayLength::computeLength( translationUnit );
    378                         });
    379                         Stats::Time::TimeBlock("Find Special Declarations", [&]() {
    380                                 acceptAll( translationUnit, finder ); // xxx - remove this pass soon
    381372                        });
    382373                        Stats::Time::TimeBlock("Fix Label Address", [&]() {
     
    13721363                return addrExpr;
    13731364        }
    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         }
    13851365} // namespace SymTab
    13861366
Note: See TracChangeset for help on using the changeset viewer.