source: translator/SynTree/Type.cc@ 1ead581

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors ctor deferred_resn demangler enum forall-pointer-decay gc_noraii jacob/cs343-translation jenkins-sandbox memory new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new string with_gc
Last change on this file since 1ead581 was 51b73452, checked in by Peter A. Buhr <pabuhr@…>, 11 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.