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/Type.cc

    ra362f97 rc0aa336  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Dec 09 14:08:48 2015
    13 // Update Count     : 4
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Feb  2 11:26:24 2017
     13// Update Count     : 12
    1414//
    1515
     
    1818#include "Type.h"
    1919#include "Declaration.h"
     20#include "Attribute.h"
    2021#include "Common/utility.h"
     22
     23using namespace std;
    2124
    2225const char *BasicType::typeNames[BasicType::NUMBER_OF_BASIC_TYPES] = {
     
    4447};
    4548
    46 Type::Type( const Qualifiers &tq ) : tq( tq ) {}
     49Type::Type( const Qualifiers &tq, const std::list< Attribute * > & attributes ) : tq( tq ), attributes( attributes ) {}
    4750
    4851Type::Type( const Type &other ) : tq( other.tq ) {
    4952        cloneAll( other.forall, forall );
     53        cloneAll( other.attributes, attributes );
    5054}
    5155
    5256Type::~Type() {
    5357        deleteAll( forall );
     58        deleteAll( attributes );
    5459}
    5560
     
    7075                os << "_Atomic ";
    7176        } // if
    72         if ( isAttribute ) {
    73                 os << "__attribute(( )) ";
    74         } // if
    7577}
    7678
     
    8183                os << std::string( indent+2, ' ' );
    8284        } // if
     85
     86        if ( ! attributes.empty() ) {
     87                os << endl << string( indent+2, ' ' ) << "with attributes" << endl;
     88                printAll( attributes, os, indent+4 );
     89        } // if
     90       
    8391        tq.print( os, indent );
    8492}
     
    8997        } else {
    9098                out << "nullptr";
    91         }
     99        } // if
    92100        return out;
    93101}
Note: See TracChangeset for help on using the changeset viewer.