ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change
on this file since c6976ba was
ce8c12f,
checked in by Rob Schluntz <rschlunt@…>, 7 years ago
|
initial work on references: reference types passed through the system, very simple examples work
|
-
Property mode set to
100644
|
File size:
1.1 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" |
---|
| 18 | #include "Common/utility.h" |
---|
| 19 | |
---|
| 20 | ReferenceType::ReferenceType( const Type::Qualifiers &tq, Type *base, const std::list< Attribute * > & attributes ) |
---|
| 21 | : Type( tq, attributes ), base( base ) { |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | ReferenceType::ReferenceType( const ReferenceType &other ) |
---|
| 25 | : Type( other ), base( maybeClone( other.base ) ) { |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | ReferenceType::~ReferenceType() { |
---|
| 29 | delete base; |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | void ReferenceType::print( std::ostream &os, int indent ) const { |
---|
| 33 | Type::print( os, indent ); |
---|
| 34 | os << "reference to "; |
---|
| 35 | if ( base ) { |
---|
| 36 | base->print( os, indent ); |
---|
| 37 | } // if |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | // Local Variables: // |
---|
| 41 | // tab-width: 4 // |
---|
| 42 | // mode: c++ // |
---|
| 43 | // compile-command: "make install" // |
---|
| 44 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.