source: translator/Parser.old/parseutility.cc@ c8ffe20b

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 c8ffe20b was 51b73452, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago

initial commit

  • Property mode set to 100644
File size: 544 bytes
Line 
1/*
2 * This file is part of the Cforall project
3 *
4 * $Id: parseutility.cc,v 1.1 2002/09/02 20:30:42 rcbilson Exp $
5 *
6 */
7
8#include "parseutility.h"
9#include "SynTree/Type.h"
10#include "SynTree/Expression.h"
11
12
13Expression *
14notZeroExpr( Expression *orig )
15{
16 UntypedExpr *comparison = new UntypedExpr( new NameExpr( "?!=?" ) );
17 comparison->get_args().push_back( orig );
18 comparison->get_args().push_back( new NameExpr( "0" ) );
19 return new CastExpr( comparison, new BasicType( Type::Qualifiers(), BasicType::SignedInt ) );
20}
Note: See TracBrowser for help on using the repository browser.