Ignore:
Timestamp:
Apr 13, 2016, 5:08:56 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
b11fac4
Parents:
3849857
Message:

generate implicit typedef right after sue name appears, further fixes storage allocation routines and comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypedefTable.cc

    r3849857 r45161b4d  
    1010// Created On       : Sat May 16 15:20:13 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Mar 21 18:18:58 2016
    13 // Update Count     : 23
     12// Last Modified On : Wed Apr 13 16:57:30 2016
     13// Update Count     : 24
    1414//
    1515
     
    3333}
    3434
     35int TypedefTable::isKind( const string &identifier ) const {
     36        tableType::const_iterator id_pos = table.find( identifier );
     37        // Name lookup defaults to identifier, and then the identifier's kind is set by the parser.
     38        if ( id_pos == table.end() ) return IDENTIFIER;
     39        return id_pos->second.begin()->kind;
     40}
     41
    3542void TypedefTable::changeKind( const string &identifier, kind_t kind ) {
    3643        tableType::iterator id_pos = table.find( identifier );
     
    3946}
    4047
    41 int TypedefTable::isKind( const string &identifier ) const {
    42         tableType::const_iterator id_pos = table.find( identifier );
    43         // Name lookup defaults to identifier, and then the identifier's kind is set by the parser.
    44         if ( id_pos == table.end() ) return IDENTIFIER;
    45         return id_pos->second.begin()->kind;
     48// SKULLDUGGERY: Generate a typedef for the aggregate name so the aggregate does not have to be qualified by
     49// "struct". Only generate the typedef, if the name is not in use. The typedef is implicitly (silently) removed
     50// if the name is explicitly used.
     51void TypedefTable::makeTypedef( const string &name ) {
     52        if ( ! typedefTable.exists( name ) ) {
     53                typedefTable.addToEnclosingScope( name, TypedefTable::TD );
     54        } // if
    4655}
    4756
Note: See TracChangeset for help on using the changeset viewer.