source: src/SynTree/BasicType.cc @ ef2eade

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprno_listpersistent-indexerpthread-emulationqualifiedEnum
Last change on this file since ef2eade was 4ee3b0c1, checked in by Rob Schluntz <rschlunt@…>, 6 years ago

Push float80/float128 through the system

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[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
[201aeb9]12// Last Modified On : Mon Sep 25 14:14:03 2017
13// Update Count     : 11
[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
22class Attribute;
[51b7345]23
[c0aa336]24BasicType::BasicType( const Type::Qualifiers &tq, Kind bt, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), kind( bt ) {}
[51b7345]25
[50377a4]26void BasicType::print( std::ostream &os, Indenter indent ) const {
[0dd3a2f]27        Type::print( os, indent );
[de9285f]28        os << BasicType::typeNames[ kind ];
[51b7345]29}
30
[17cd4eb]31bool BasicType::isInteger() const {
[0dd3a2f]32        switch ( kind ) {
33          case Bool:
34          case Char:
35          case SignedChar:
36          case UnsignedChar:
37          case ShortSignedInt:
38          case ShortUnsignedInt:
39          case SignedInt:
40          case UnsignedInt:
41          case LongSignedInt:
42          case LongUnsignedInt:
43          case LongLongSignedInt:
44          case LongLongUnsignedInt:
[201aeb9]45          case SignedInt128:
46          case UnsignedInt128:
[0dd3a2f]47                return true;
48          case Float:
49          case Double:
50          case LongDouble:
51          case FloatComplex:
52          case DoubleComplex:
53          case LongDoubleComplex:
54          case FloatImaginary:
55          case DoubleImaginary:
56          case LongDoubleImaginary:
[4ee3b0c1]57          case Float80:
58          case Float128:
[0dd3a2f]59                return false;
60          case NUMBER_OF_BASIC_TYPES:
61                assert( false );
62        } // switch
[51b7345]63        assert( false );
[0dd3a2f]64        return false;
[51b7345]65}
66
67
[0dd3a2f]68// Local Variables: //
69// tab-width: 4 //
70// mode: c++ //
71// compile-command: "make install" //
72// End: //
Note: See TracBrowser for help on using the repository browser.