• Kevin Modzelewski's avatar
    Create all FunctionMetadatas for a module at once · 7eacfcdd
    Kevin Modzelewski authored
    There are a bunch of interrelated changes in here that I couldn't really
    separate out.  Mostly the relate to saving data on the AST nodes: we store
    DerefInfo and closure info on the Name nodes, and store FunctionMetadata objects
    on AST nodes that create scopes.  And those FunctionMetadata objects now also
    store "ScopingResults", which is only the results from the ScopeInfo objects,
    not all the extra info those keep around in order to do deferred analysis.
    
    Once all this extra data is precomputed+stored, we can start freeing
    the ScopingAnalysis objects and all the related ScopeInfos.
    
    Future work:
    - Name node shouldn't store scoing info; this should be embedded in choice of BST nodes
    - Do pyc caching post-CFG
    - Memory management.
    - Continue to clean this all up.  I layered this change on top of the existing
      scoping and cfg systems, which reduced the amount of changes, but means that
      there is a potentially-unnecessary layer in the middle now.
    7eacfcdd
ast.h 57.3 KB