source: src/SynTree/ReferenceType.cc @ 8d7bef2

new-envwith_gc
Last change on this file since 8d7bef2 was 68f9c43, checked in by Aaron Moss <a3moss@…>, 6 years ago

First pass at delete removal

  • Property mode set to 100644
File size: 1.3 KB
Line 
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// PointerType.cc --
8//
9// Author           : Rob Schluntz
10// Created On       : Fri May 12 18:12:15 2017
11// Last Modified By : Rob Schluntz
12// Last Modified On : Fri May 12 18:12:15 2017
13// Update Count     : 1
14//
15
16#include "Type.h"
17#include "Expression.h"
18#include "TypeSubstitution.h"
19#include "Common/utility.h"
20
21ReferenceType::ReferenceType( const Type::Qualifiers &tq, Type *base, const std::list< Attribute * > & attributes )
22        : Type( tq, attributes ), base( base ) {
23        assertf( base, "Reference Type with a null base created." );
24}
25
26ReferenceType::ReferenceType( const ReferenceType &other )
27        : Type( other ), base( maybeClone( other.base ) ) {
28}
29
30int ReferenceType::referenceDepth() const {
31        return base->referenceDepth()+1;
32}
33
34TypeSubstitution ReferenceType::genericSubstitution() const { return base->genericSubstitution(); }
35
36void ReferenceType::print( std::ostream &os, Indenter indent ) const {
37        Type::print( os, indent );
38        os << "reference to ";
39        if ( base ) {
40                base->print( os, indent );
41        } // if
42}
43
44// Local Variables: //
45// tab-width: 4 //
46// mode: c++ //
47// compile-command: "make install" //
48// End: //
Note: See TracBrowser for help on using the repository browser.