ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change
on this file since ef5b828 was
cdcddfe1,
checked in by Peter A. Buhr <pabuhr@…>, 6 years ago
|
add signedness to cost model and _FloatNN
|
-
Property mode set to
100644
|
File size:
1.8 KB
|
Rev | Line | |
---|
[0dd3a2f] | 1 | // |
---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo |
---|
| 3 | // |
---|
| 4 | // The contents of this file are covered under the licence agreement in the |
---|
| 5 | // file "LICENCE" distributed with Cforall. |
---|
| 6 | // |
---|
[50377a4] | 7 | // BasicType.cc -- |
---|
[0dd3a2f] | 8 | // |
---|
| 9 | // Author : Richard C. Bilson |
---|
| 10 | // Created On : Mon May 18 07:44:20 2015 |
---|
[c0aa336] | 11 | // Last Modified By : Peter A. Buhr |
---|
[cdcddfe1] | 12 | // Last Modified On : Thu Jan 31 21:37:36 2019 |
---|
| 13 | // Update Count : 12 |
---|
[0dd3a2f] | 14 | // |
---|
[51b7345] | 15 | |
---|
[ea6332d] | 16 | #include <cassert> // for assert |
---|
| 17 | #include <list> // for list |
---|
| 18 | #include <ostream> // for operator<<, ostream |
---|
| 19 | |
---|
| 20 | #include "Type.h" // for BasicType, Type, BasicType::Kind, BasicType::Kind... |
---|
| 21 | |
---|
| 22 | class Attribute; |
---|
[51b7345] | 23 | |
---|
[c0aa336] | 24 | BasicType::BasicType( const Type::Qualifiers &tq, Kind bt, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), kind( bt ) {} |
---|
[51b7345] | 25 | |
---|
[50377a4] | 26 | void BasicType::print( std::ostream &os, Indenter indent ) const { |
---|
[0dd3a2f] | 27 | Type::print( os, indent ); |
---|
[de9285f] | 28 | os << BasicType::typeNames[ kind ]; |
---|
[51b7345] | 29 | } |
---|
| 30 | |
---|
[17cd4eb] | 31 | bool BasicType::isInteger() const { |
---|
[cdcddfe1] | 32 | return kind <= UnsignedInt128; |
---|
| 33 | #if 0 |
---|
[0dd3a2f] | 34 | 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: |
---|
[201aeb9] | 47 | case SignedInt128: |
---|
| 48 | case UnsignedInt128: |
---|
[0dd3a2f] | 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: |
---|
[4ee3b0c1] | 59 | case Float80: |
---|
| 60 | case Float128: |
---|
[0dd3a2f] | 61 | return false; |
---|
| 62 | case NUMBER_OF_BASIC_TYPES: |
---|
| 63 | assert( false ); |
---|
| 64 | } // switch |
---|
[51b7345] | 65 | assert( false ); |
---|
[0dd3a2f] | 66 | return false; |
---|
[cdcddfe1] | 67 | #endif |
---|
[51b7345] | 68 | } |
---|
| 69 | |
---|
| 70 | |
---|
[0dd3a2f] | 71 | // Local Variables: // |
---|
| 72 | // tab-width: 4 // |
---|
| 73 | // mode: c++ // |
---|
| 74 | // compile-command: "make install" // |
---|
| 75 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.