Last change
on this file since 2fe64ba was
9bfc9da,
checked in by Rob Schluntz <rschlunt@…>, 6 years ago
|
Refactor makeSub into genericSubstitution
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[ce8c12f] | 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" |
---|
[9bfc9da] | 18 | #include "TypeSubstitution.h" |
---|
[ce8c12f] | 19 | #include "Common/utility.h" |
---|
| 20 | |
---|
| 21 | ReferenceType::ReferenceType( const Type::Qualifiers &tq, Type *base, const std::list< Attribute * > & attributes ) |
---|
[e6cee92] | 22 | : Type( tq, attributes ), base( base ) { |
---|
| 23 | assertf( base, "Reference Type with a null base created." ); |
---|
[ce8c12f] | 24 | } |
---|
| 25 | |
---|
| 26 | ReferenceType::ReferenceType( const ReferenceType &other ) |
---|
[e6cee92] | 27 | : Type( other ), base( maybeClone( other.base ) ) { |
---|
[ce8c12f] | 28 | } |
---|
| 29 | |
---|
| 30 | ReferenceType::~ReferenceType() { |
---|
[e6cee92] | 31 | delete base; |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | int ReferenceType::referenceDepth() const { |
---|
| 35 | return base->referenceDepth()+1; |
---|
[ce8c12f] | 36 | } |
---|
| 37 | |
---|
[9bfc9da] | 38 | TypeSubstitution ReferenceType::genericSubstitution() const { return base->genericSubstitution(); } |
---|
| 39 | |
---|
[50377a4] | 40 | void ReferenceType::print( std::ostream &os, Indenter indent ) const { |
---|
[e6cee92] | 41 | Type::print( os, indent ); |
---|
| 42 | os << "reference to "; |
---|
| 43 | if ( base ) { |
---|
| 44 | base->print( os, indent ); |
---|
| 45 | } // if |
---|
[ce8c12f] | 46 | } |
---|
| 47 | |
---|
| 48 | // Local Variables: // |
---|
| 49 | // tab-width: 4 // |
---|
| 50 | // mode: c++ // |
---|
| 51 | // compile-command: "make install" // |
---|
| 52 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.