source: translator/SynTree/Type.cc @ 134b86a

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 134b86a was 51b7345, checked in by Peter A. Buhr <pabuhr@…>, 10 years ago

initial commit

  • Property mode set to 100644
File size: 814 bytes
Line 
1/*
2 * This file is part of the Cforall project
3 *
4 * $Id: Type.cc,v 1.6 2005/08/29 20:59:26 rcbilson Exp $
5 *
6 */
7
8#include "SynTree.h"
9#include "Visitor.h"
10#include "Type.h"
11#include "Declaration.h"
12#include "utility.h"
13
14
15Type::Type( const Qualifiers &tq )
16    : tq( tq )
17{
18}
19
20Type::Type( const Type &other )
21    : tq( other.tq )
22{
23    cloneAll( other.forall, forall );
24}
25
26Type::~Type()
27{
28    deleteAll( forall );
29}
30
31void
32Type::print( std::ostream &os, int indent ) const
33{
34    if( !forall.empty() ) {
35        os << "forall" << std::endl;
36        printAll( forall, os, indent + 4 );
37        os << std::string( indent+2, ' ' );
38    }
39    if( tq.isConst ) {
40        os << "const ";
41    }
42    if( tq.isVolatile ) {
43        os << "volatile ";
44    }
45    if( tq.isRestrict ) {
46        os << "restrict ";
47    }
48    if( tq.isLvalue ) {
49        os << "lvalue ";
50    }
51}
52
Note: See TracBrowser for help on using the repository browser.