Changeset 157a816 for src


Ignore:
Timestamp:
May 29, 2019, 11:22:31 AM (5 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
f57dd25
Parents:
eba615c
Message:

Convert supports SymTab::dereferenceOperator and some sue declarations return the proper type now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    reba615c r157a816  
    1010// Created On       : Thu May 09 15::37::05 2019
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tue May 28 12:00:00 2019
    13 // Update Count     : 7
     12// Last Modified On : Wed May 29 11:05:00 2019
     13// Update Count     : 8
    1414//
    1515
     
    2525#include "AST/TypeSubstitution.hpp"
    2626
     27#include "SymTab/Autogen.h"
    2728#include "SynTree/Attribute.h"
    2829#include "SynTree/Declaration.h"
     
    4041        }
    4142};
     43
     44//================================================================================================
     45namespace {
     46
     47// This is to preserve the SymTab::dereferenceOperator hack. It does not (and perhaps should not)
     48// allow us to use the same stratagy in the new ast.
     49ast::FunctionDecl * dereferenceOperator = nullptr;
     50
     51}
    4252
    4353//================================================================================================
     
    159169                );
    160170                decl->withExprs = get<Expression>().acceptL( node->withExprs );
     171                if ( dereferenceOperator == node ) {
     172                        SymTab::dereferenceOperator = decl;
     173                }
    161174                return declWithTypePostamble( decl, node );
    162175        }
     
    14391452
    14401453                this->node = decl;
     1454
     1455                if ( SymTab::dereferenceOperator == old ) {
     1456                        dereferenceOperator = decl;
     1457                }
    14411458        }
    14421459
     
    14841501        virtual void visit( EnumDecl * old ) override final {
    14851502                if ( inCache( old ) ) return;
    1486                 auto decl = new ast::UnionDecl(
     1503                auto decl = new ast::EnumDecl(
    14871504                        old->location,
    14881505                        old->name,
     
    15041521        virtual void visit( TraitDecl * old ) override final {
    15051522                if ( inCache( old ) ) return;
    1506                 auto decl = new ast::UnionDecl(
     1523                auto decl = new ast::TraitDecl(
    15071524                        old->location,
    15081525                        old->name,
Note: See TracChangeset for help on using the changeset viewer.