Ignore:
Timestamp:
Jan 7, 2015, 6:04:42 PM (10 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:
0b8cd722
Parents:
d9a0e76
Message:

fixed restrict, fixed parameter copy, introduced name table for types, changed variable after to string

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/SynTree/Type.cc

    rd9a0e76 r17cd4eb  
    1 /*
    2  * This file is part of the Cforall project
    3  *
    4  * $Id: Type.cc,v 1.6 2005/08/29 20:59:26 rcbilson Exp $
    5  *
    6  */
    7 
    81#include "SynTree.h"
    92#include "Visitor.h"
     
    125#include "utility.h"
    136
     7const char *BasicType::typeNames[BasicType::NUMBER_OF_BASIC_TYPES] = {
     8    "_Bool",
     9    "char",
     10    "char",
     11    "unsigned char",
     12    "short",
     13    "short unsigned",
     14    "int",
     15    "unsigned int",
     16    "long int",
     17    "long unsigned int",
     18    "long long int",
     19    "long long unsigned int",
     20    "float",
     21    "double",
     22    "long double",
     23    "float _Complex",
     24    "double _Complex",
     25    "long double _Complex",
     26    "float _Imaginary",
     27    "double _Imaginary",
     28    "long double _Imaginary",
     29};
    1430
    15 Type::Type( const Qualifiers &tq )
    16     : tq( tq )
    17 {
    18 }
     31Type::Type( const Qualifiers &tq ) : tq( tq ) {}
    1932
    20 Type::Type( const Type &other )
    21     : tq( other.tq )
    22 {
     33Type::Type( const Type &other ) : tq( other.tq ) {
    2334    cloneAll( other.forall, forall );
    2435}
    2536
    26 Type::~Type()
    27 {
     37Type::~Type() {
    2838    deleteAll( forall );
    2939}
    3040
    31 void
    32 Type::print( std::ostream &os, int indent ) const
    33 {
    34     if( !forall.empty() ) {
     41void Type::print( std::ostream &os, int indent ) const {
     42    if ( !forall.empty() ) {
    3543        os << "forall" << std::endl;
    3644        printAll( forall, os, indent + 4 );
    3745        os << std::string( indent+2, ' ' );
    38     }
    39     if( tq.isConst ) {
     46    } // if
     47    if ( tq.isConst ) {
    4048        os << "const ";
    41     }
    42     if( tq.isVolatile ) {
     49    } // if
     50    if ( tq.isVolatile ) {
    4351        os << "volatile ";
    44     }
    45     if( tq.isRestrict ) {
     52    } // if
     53    if ( tq.isRestrict ) {
    4654        os << "restrict ";
    47     }
    48     if( tq.isLvalue ) {
     55    } // if
     56    if ( tq.isLvalue ) {
    4957        os << "lvalue ";
    50     }
     58    } // if
    5159}
    52 
Note: See TracChangeset for help on using the changeset viewer.