Changeset 17cd4eb for translator/SynTree/Type.cc
- Timestamp:
- Jan 7, 2015, 6:04:42 PM (10 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/SynTree/Type.cc
rd9a0e76 r17cd4eb 1 /*2 * This file is part of the Cforall project3 *4 * $Id: Type.cc,v 1.6 2005/08/29 20:59:26 rcbilson Exp $5 *6 */7 8 1 #include "SynTree.h" 9 2 #include "Visitor.h" … … 12 5 #include "utility.h" 13 6 7 const 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 }; 14 30 15 Type::Type( const Qualifiers &tq ) 16 : tq( tq ) 17 { 18 } 31 Type::Type( const Qualifiers &tq ) : tq( tq ) {} 19 32 20 Type::Type( const Type &other ) 21 : tq( other.tq ) 22 { 33 Type::Type( const Type &other ) : tq( other.tq ) { 23 34 cloneAll( other.forall, forall ); 24 35 } 25 36 26 Type::~Type() 27 { 37 Type::~Type() { 28 38 deleteAll( forall ); 29 39 } 30 40 31 void 32 Type::print( std::ostream &os, int indent ) const 33 { 34 if( !forall.empty() ) { 41 void Type::print( std::ostream &os, int indent ) const { 42 if ( !forall.empty() ) { 35 43 os << "forall" << std::endl; 36 44 printAll( forall, os, indent + 4 ); 37 45 os << std::string( indent+2, ' ' ); 38 } 39 if ( tq.isConst ) {46 } // if 47 if ( tq.isConst ) { 40 48 os << "const "; 41 } 42 if ( tq.isVolatile ) {49 } // if 50 if ( tq.isVolatile ) { 43 51 os << "volatile "; 44 } 45 if ( tq.isRestrict ) {52 } // if 53 if ( tq.isRestrict ) { 46 54 os << "restrict "; 47 } 48 if ( tq.isLvalue ) {55 } // if 56 if ( tq.isLvalue ) { 49 57 os << "lvalue "; 50 } 58 } // if 51 59 } 52
Note: See TracChangeset
for help on using the changeset viewer.