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 bdd516a was
bdd516a,
checked in by Peter A. Buhr <pabuhr@…>, 9 years ago
|
fixed sizeof type variable, find lowest cost alternative for sizeof expression, removed unused classes, added compiler flag, remove temporary file for -CFA, formatting
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[51b7345] | 1 | #include "SynTree.h" |
---|
| 2 | #include "Visitor.h" |
---|
| 3 | #include "Type.h" |
---|
| 4 | #include "Declaration.h" |
---|
| 5 | #include "utility.h" |
---|
| 6 | |
---|
[17cd4eb] | 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 | }; |
---|
[51b7345] | 30 | |
---|
[17cd4eb] | 31 | Type::Type( const Qualifiers &tq ) : tq( tq ) {} |
---|
[51b7345] | 32 | |
---|
[17cd4eb] | 33 | Type::Type( const Type &other ) : tq( other.tq ) { |
---|
[51b7345] | 34 | cloneAll( other.forall, forall ); |
---|
| 35 | } |
---|
| 36 | |
---|
[17cd4eb] | 37 | Type::~Type() { |
---|
[51b7345] | 38 | deleteAll( forall ); |
---|
| 39 | } |
---|
| 40 | |
---|
[17cd4eb] | 41 | void Type::print( std::ostream &os, int indent ) const { |
---|
| 42 | if ( !forall.empty() ) { |
---|
[51b7345] | 43 | os << "forall" << std::endl; |
---|
| 44 | printAll( forall, os, indent + 4 ); |
---|
| 45 | os << std::string( indent+2, ' ' ); |
---|
[17cd4eb] | 46 | } // if |
---|
| 47 | if ( tq.isConst ) { |
---|
[51b7345] | 48 | os << "const "; |
---|
[17cd4eb] | 49 | } // if |
---|
| 50 | if ( tq.isVolatile ) { |
---|
[51b7345] | 51 | os << "volatile "; |
---|
[17cd4eb] | 52 | } // if |
---|
| 53 | if ( tq.isRestrict ) { |
---|
[51b7345] | 54 | os << "restrict "; |
---|
[17cd4eb] | 55 | } // if |
---|
| 56 | if ( tq.isLvalue ) { |
---|
[51b7345] | 57 | os << "lvalue "; |
---|
[17cd4eb] | 58 | } // if |
---|
[bdd516a] | 59 | if ( tq.isAtomic ) { |
---|
| 60 | os << "_Atomic "; |
---|
| 61 | } // if |
---|
[51b7345] | 62 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.