Changeset 357390f
- Timestamp:
- Aug 5, 2019, 7:34:04 AM (5 years ago)
- 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:
- f1da02c
- Parents:
- 05c27fc
- Location:
- src/SynTree
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/BasicType.cc
r05c27fc r357390f 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jan 31 21:37:36201913 // Update Count : 1 212 // Last Modified On : Sun Aug 4 21:07:44 2019 13 // Update Count : 13 14 14 // 15 15 … … 31 31 bool BasicType::isInteger() const { 32 32 return kind <= UnsignedInt128; 33 #if 034 switch ( kind ) {35 case Bool:36 case Char:37 case SignedChar:38 case UnsignedChar:39 case ShortSignedInt:40 case ShortUnsignedInt:41 case SignedInt:42 case UnsignedInt:43 case LongSignedInt:44 case LongUnsignedInt:45 case LongLongSignedInt:46 case LongLongUnsignedInt:47 case SignedInt128:48 case UnsignedInt128:49 return true;50 case Float:51 case Double:52 case LongDouble:53 case FloatComplex:54 case DoubleComplex:55 case LongDoubleComplex:56 case FloatImaginary:57 case DoubleImaginary:58 case LongDoubleImaginary:59 case Float80:60 case Float128:61 return false;62 case NUMBER_OF_BASIC_TYPES:63 assert( false );64 } // switch65 assert( false );66 return false;67 #endif68 33 } 69 34 -
src/SynTree/Type.cc
r05c27fc r357390f 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Fri Jul 12 15:48:00201913 // Update Count : 4 411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Aug 4 21:05:07 2019 13 // Update Count : 45 14 14 // 15 15 #include "Type.h" … … 24 24 using namespace std; 25 25 26 const char *BasicType::typeNames[] = { 27 #if 0 28 "_Bool", 29 "char", 30 "signed char", 31 "unsigned char", 32 "signed short int", 33 "unsigned short int", 34 "signed int", 35 "unsigned int", 36 "signed long int", 37 "unsigned long int", 38 "signed long long int", 39 "unsigned long long int", 40 "float", 41 "double", 42 "long double", 43 "float _Complex", 44 "double _Complex", 45 "long double _Complex", 46 "float _Imaginary", 47 "double _Imaginary", 48 "long double _Imaginary", 49 "__int128", 50 "unsigned __int128", 51 "__float80", 52 "__float128", 53 "_Float16", 54 "_Float32", 55 "_Float32x", 56 "_Float64", 57 "_Float64x", 58 "_Float128", 59 "_Float128x", 60 "_Float16 _Complex", 61 "_Float32 _Complex", 62 "_Float32x _Complex", 63 "_Float64 _Complex", 64 "_Float64x _Complex", 65 "_Float128 _Complex", 66 "_Float128x _Complex", 67 #endif 26 const char * BasicType::typeNames[] = { 68 27 "_Bool", 69 28 "char", … … 107 66 }; 108 67 static_assert( 109 sizeof(BasicType::typeNames) /sizeof(BasicType::typeNames[0]) == BasicType::NUMBER_OF_BASIC_TYPES,68 sizeof(BasicType::typeNames) / sizeof(BasicType::typeNames[0]) == BasicType::NUMBER_OF_BASIC_TYPES, 110 69 "Each basic type name should have a corresponding kind enum value" 111 70 ); … … 152 111 TypeSubstitution Type::genericSubstitution() const { assertf( false, "Non-aggregate type: %s", toCString( this ) ); } 153 112 154 void Type::print( std::ostream & os, Indenter indent ) const {113 void Type::print( std::ostream & os, Indenter indent ) const { 155 114 if ( ! forall.empty() ) { 156 115 os << "forall" << std::endl;
Note: See TracChangeset
for help on using the changeset viewer.