source: src/SynTree/ReferenceType.cc @ 7ebaa56

aaron-thesisarm-ehcleanup-dtorsdeferred_resndemanglerjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerresolv-newwith_gc
Last change on this file since 7ebaa56 was ce8c12f, checked in by Rob Schluntz <rschlunt@…>, 5 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
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 "Common/utility.h"
19
20ReferenceType::ReferenceType( const Type::Qualifiers &tq, Type *base, const std::list< Attribute * > & attributes )
21  : Type( tq, attributes ), base( base ) {
22}
23
24ReferenceType::ReferenceType( const ReferenceType &other )
25  : Type( other ), base( maybeClone( other.base ) ) {
26}
27
28ReferenceType::~ReferenceType() {
29  delete base;
30}
31
32void 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.