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 643a2e1 was 51b73452, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
851 bytes
|
Line | |
---|
1 | /*
|
---|
2 | * This file is part of the Cforall project
|
---|
3 | *
|
---|
4 | * $Id: AddressExpr.cc,v 1.6 2005/08/29 20:59:25 rcbilson Exp $
|
---|
5 | *
|
---|
6 | */
|
---|
7 |
|
---|
8 | #include "Expression.h"
|
---|
9 | #include "Type.h"
|
---|
10 | #include "utility.h"
|
---|
11 |
|
---|
12 |
|
---|
13 | AddressExpr::AddressExpr( Expression *arg, Expression *_aname )
|
---|
14 | : Expression( _aname ), arg( arg )
|
---|
15 | {
|
---|
16 | for( std::list< Type* >::const_iterator i = arg->get_results().begin(); i != arg->get_results().end(); ++i ) {
|
---|
17 | get_results().push_back( new PointerType( Type::Qualifiers(), (*i)->clone() ) );
|
---|
18 | }
|
---|
19 | }
|
---|
20 |
|
---|
21 | AddressExpr::AddressExpr( const AddressExpr &other )
|
---|
22 | : Expression( other ), arg( maybeClone( other.arg ) )
|
---|
23 | {
|
---|
24 | }
|
---|
25 |
|
---|
26 | AddressExpr::~AddressExpr()
|
---|
27 | {
|
---|
28 | delete arg;
|
---|
29 | }
|
---|
30 |
|
---|
31 | void
|
---|
32 | AddressExpr::print( std::ostream &os, int indent ) const
|
---|
33 | {
|
---|
34 | os << std::string( indent, ' ' ) << "Address of:" << std::endl;
|
---|
35 | if( arg ) {
|
---|
36 | arg->print( os, indent+2 );
|
---|
37 | }
|
---|
38 | }
|
---|
39 |
|
---|
40 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.