Ignore:
Timestamp:
Feb 6, 2017, 4:19:41 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
b4d65c7
Parents:
a362f97
Message:

third attempt at gcc attributes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/ReferenceToType.cc

    ra362f97 rc0aa336  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jul 13 18:03:30 2016
    13 // Update Count     : 9
     12// Last Modified On : Thu Feb  2 17:45:07 2017
     13// Update Count     : 23
    1414//
    1515
     
    2323#include "Common/utility.h"
    2424
    25 ReferenceToType::ReferenceToType( const Type::Qualifiers &tq, const std::string &name ) : Type( tq ), name( name ) {
     25ReferenceToType::ReferenceToType( const Type::Qualifiers &tq, const std::string &name, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), name( name ) {
    2626}
    2727
     
    5555} // namespace
    5656
    57 StructInstType::StructInstType( const Type::Qualifiers & tq, StructDecl * baseStruct ) : Parent( tq, baseStruct->get_name() ), baseStruct( baseStruct ) {}
     57StructInstType::StructInstType( const Type::Qualifiers & tq, StructDecl * baseStruct, const std::list< Attribute * > & attributes ) :
     58                Parent( tq, baseStruct->get_name(), attributes ), baseStruct( baseStruct ) {}
    5859
    5960std::string StructInstType::typeString() const { return "struct"; }
     
    6465}
    6566
    66 bool StructInstType::isComplete() const { return baseStruct->has_body(); }
     67bool StructInstType::isComplete() const { return baseStruct ? baseStruct->has_body() : false; }
    6768
    6869void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
     
    8586}
    8687
     88
     89UnionInstType::UnionInstType( const Type::Qualifiers & tq, UnionDecl * baseUnion, const std::list< Attribute * > & attributes ) :
     90                Parent( tq, baseUnion->get_name(), attributes ), baseUnion( baseUnion ) {}
     91
    8792std::string UnionInstType::typeString() const { return "union"; }
    8893
    89 std::list<TypeDecl*>* UnionInstType::get_baseParameters() {
     94std::list< TypeDecl * > * UnionInstType::get_baseParameters() {
    9095        if ( ! baseUnion ) return NULL;
    9196        return &baseUnion->get_parameters();
    9297}
    9398
    94 bool UnionInstType::isComplete() const { return baseUnion->has_body(); }
     99bool UnionInstType::isComplete() const { return baseUnion ? baseUnion->has_body() : false; }
    95100
    96101void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
     
    113118}
    114119
     120
     121EnumInstType::EnumInstType( const Type::Qualifiers & tq, EnumDecl * baseEnum, const std::list< Attribute * > & attributes ) :
     122                Parent( tq, baseEnum->get_name(), attributes ), baseEnum( baseEnum ) {}
     123
    115124std::string EnumInstType::typeString() const { return "enum"; }
     125
     126bool EnumInstType::isComplete() const { return baseEnum ? baseEnum->has_body() : false; }
    116127
    117128std::string TraitInstType::typeString() const { return "trait"; }
     
    127138bool TraitInstType::isComplete() const { assert( false ); }
    128139
    129 TypeInstType::TypeInstType( const Type::Qualifiers &tq, const std::string &name, TypeDecl *baseType ) : Parent( tq, name ) {
     140TypeInstType::TypeInstType( const Type::Qualifiers &tq, const std::string &name, TypeDecl *baseType, const std::list< Attribute * > & attributes ) : Parent( tq, name, attributes ) {
    130141        set_baseType( baseType );
    131142}
    132143
    133 TypeInstType::TypeInstType( const Type::Qualifiers &tq, const std::string &name, bool isFtype ) : Parent( tq, name ), baseType( 0 ), isFtype( isFtype ) {
     144TypeInstType::TypeInstType( const Type::Qualifiers &tq, const std::string &name, bool isFtype, const std::list< Attribute * > & attributes ) : Parent( tq, name, attributes ), baseType( 0 ), isFtype( isFtype ) {
    134145}
    135146
Note: See TracChangeset for help on using the changeset viewer.