Changeset 39d8950 for src/AST


Ignore:
Timestamp:
Mar 16, 2022, 4:41:01 PM (3 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
f7496c5
Parents:
9d8124f
Message:

Thread global information through resolution. Non-top-level calls to the resolver have a bit of a hack but improvements would require changes to the Pass helpers.

Location:
src/AST
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r9d8124f r39d8950  
    99// Author           : Thierry Delisle
    1010// Created On       : Thu May 09 15::37::05 2019
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb  2 13:19:22 2022
    13 // Update Count     : 41
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Mar 16 15:01:00 2022
     13// Update Count     : 42
    1414//
    1515
     
    4949//================================================================================================
    5050namespace ast {
    51 
    52 // This is to preserve the FindSpecialDecls hack. It does not (and perhaps should not)
    53 // allow us to use the same stratagy in the new ast.
    54 // xxx - since convert back pass works, this concern seems to be unnecessary.
    55 
    56 // these need to be accessed in new FixInit now
    57 ast::ptr<ast::Type> sizeType = nullptr;
    58 const ast::FunctionDecl * dereferenceOperator = nullptr;
    59 const ast::StructDecl   * dtorStruct = nullptr;
    60 const ast::FunctionDecl * dtorStructDestroy = nullptr;
     51// These are the shared local information used by ConverterNewToOld and
     52// ConverterOldToNew to update the global information in the two versions.
     53
     54static ast::ptr<ast::Type> sizeType = nullptr;
     55static const ast::FunctionDecl * dereferenceOperator = nullptr;
     56static const ast::StructDecl   * dtorStruct = nullptr;
     57static const ast::FunctionDecl * dtorStructDestroy = nullptr;
    6158
    6259}
  • src/AST/Fwd.hpp

    r9d8124f r39d8950  
    141141
    142142class TranslationUnit;
    143 // TODO: Get from the TranslationUnit:
    144 extern ptr<Type> sizeType;
    145 extern const FunctionDecl * dereferenceOperator;
    146 extern const StructDecl   * dtorStruct;
    147 extern const FunctionDecl * dtorStructDestroy;
     143class TranslationGlobal;
    148144
    149145}
  • src/AST/TranslationUnit.hpp

    r9d8124f r39d8950  
    1010// Created On       : Tue Jun 11 15:30:00 2019
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tue Jun 11 15:42:00 2019
    13 // Update Count     : 0
     12// Last Modified On : Tue Mar 11 11:19:00 2022
     13// Update Count     : 1
    1414//
    1515
     
    2323namespace ast {
    2424
     25class TranslationGlobal {
     26public:
     27        std::map< UniqueId, Decl * > idMap;
     28
     29        ptr<Type> sizeType;
     30        const FunctionDecl * dereference;
     31        const StructDecl * dtorStruct;
     32        const FunctionDecl * dtorDestroy;
     33};
     34
    2535class TranslationUnit {
    2636public:
    2737        std::list< ptr< Decl > > decls;
    28 
    29         struct Global {
    30                 std::map< UniqueId, Decl * > idMap;
    31 
    32                 ptr<Type> sizeType;
    33                 const FunctionDecl * dereference;
    34                 const StructDecl * dtorStruct;
    35                 const FunctionDecl * dtorDestroy;
    36         } global;
     38        TranslationGlobal global;
    3739};
    3840
Note: See TracChangeset for help on using the changeset viewer.