ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change
on this file since 0dd3a2f was
0dd3a2f,
checked in by Peter A. Buhr <pabuhr@…>, 9 years ago
|
licencing: third groups of files
|
-
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 | // |
---|
| 7 | // Type.cc -- |
---|
| 8 | // |
---|
| 9 | // Author : Richard C. Bilson |
---|
| 10 | // Created On : Mon May 18 07:44:20 2015 |
---|
| 11 | // Last Modified By : Peter A. Buhr |
---|
| 12 | // Last Modified On : Mon May 18 11:00:29 2015 |
---|
| 13 | // Update Count : 1 |
---|
| 14 | // |
---|
| 15 | |
---|
[51b7345] | 16 | #include "SynTree.h" |
---|
| 17 | #include "Visitor.h" |
---|
| 18 | #include "Type.h" |
---|
| 19 | #include "Declaration.h" |
---|
| 20 | #include "utility.h" |
---|
| 21 | |
---|
[17cd4eb] | 22 | const char *BasicType::typeNames[BasicType::NUMBER_OF_BASIC_TYPES] = { |
---|
| 23 | "_Bool", |
---|
| 24 | "char", |
---|
| 25 | "char", |
---|
| 26 | "unsigned char", |
---|
| 27 | "short", |
---|
| 28 | "short unsigned", |
---|
| 29 | "int", |
---|
| 30 | "unsigned int", |
---|
| 31 | "long int", |
---|
| 32 | "long unsigned int", |
---|
| 33 | "long long int", |
---|
| 34 | "long long unsigned int", |
---|
| 35 | "float", |
---|
| 36 | "double", |
---|
| 37 | "long double", |
---|
| 38 | "float _Complex", |
---|
| 39 | "double _Complex", |
---|
| 40 | "long double _Complex", |
---|
| 41 | "float _Imaginary", |
---|
| 42 | "double _Imaginary", |
---|
| 43 | "long double _Imaginary", |
---|
| 44 | }; |
---|
[51b7345] | 45 | |
---|
[17cd4eb] | 46 | Type::Type( const Qualifiers &tq ) : tq( tq ) {} |
---|
[51b7345] | 47 | |
---|
[17cd4eb] | 48 | Type::Type( const Type &other ) : tq( other.tq ) { |
---|
[51b7345] | 49 | cloneAll( other.forall, forall ); |
---|
| 50 | } |
---|
| 51 | |
---|
[17cd4eb] | 52 | Type::~Type() { |
---|
[51b7345] | 53 | deleteAll( forall ); |
---|
| 54 | } |
---|
| 55 | |
---|
[17cd4eb] | 56 | void Type::print( std::ostream &os, int indent ) const { |
---|
[a32b204] | 57 | if ( ! forall.empty() ) { |
---|
[0dd3a2f] | 58 | os << "forall" << std::endl; |
---|
| 59 | printAll( forall, os, indent + 4 ); |
---|
| 60 | os << std::string( indent+2, ' ' ); |
---|
[17cd4eb] | 61 | } // if |
---|
| 62 | if ( tq.isConst ) { |
---|
[0dd3a2f] | 63 | os << "const "; |
---|
[17cd4eb] | 64 | } // if |
---|
| 65 | if ( tq.isVolatile ) { |
---|
[0dd3a2f] | 66 | os << "volatile "; |
---|
[17cd4eb] | 67 | } // if |
---|
| 68 | if ( tq.isRestrict ) { |
---|
[0dd3a2f] | 69 | os << "restrict "; |
---|
[17cd4eb] | 70 | } // if |
---|
| 71 | if ( tq.isLvalue ) { |
---|
[0dd3a2f] | 72 | os << "lvalue "; |
---|
[17cd4eb] | 73 | } // if |
---|
[bdd516a] | 74 | if ( tq.isAtomic ) { |
---|
[0dd3a2f] | 75 | os << "_Atomic "; |
---|
[bdd516a] | 76 | } // if |
---|
[51b7345] | 77 | } |
---|
[0dd3a2f] | 78 | |
---|
| 79 | // Local Variables: // |
---|
| 80 | // tab-width: 4 // |
---|
| 81 | // mode: c++ // |
---|
| 82 | // compile-command: "make install" // |
---|
| 83 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.