Changeset b87a5ed for translator/Parser/parseutility.cc
- Timestamp:
- May 16, 2015, 3:36:19 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- a32b204
- Parents:
- b8508a2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/Parser/parseutility.cc
rb8508a2 rb87a5ed 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 // parseutility.cc -- 8 // 9 // Author : Rodolfo G. Esteves 10 // Created On : Sat May 16 15:30:39 2015 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat May 16 15:31:33 2015 13 // Update Count : 2 14 // 15 1 16 #include "parseutility.h" 2 17 #include "SynTree/Type.h" 3 18 #include "SynTree/Expression.h" 4 19 20 Expression *notZeroExpr( Expression *orig ) { 21 UntypedExpr *comparison = new UntypedExpr( new NameExpr( "?!=?" ) ); 22 comparison->get_args().push_back( orig ); 23 comparison->get_args().push_back( new NameExpr( "0" ) ); 24 return new CastExpr( comparison, new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ); 25 } 5 26 6 Expression *notZeroExpr( Expression *orig ) { 7 UntypedExpr *comparison = new UntypedExpr( new NameExpr( "?!=?" ) ); 8 comparison->get_args().push_back( orig ); 9 comparison->get_args().push_back( new NameExpr( "0" ) ); 10 return new CastExpr( comparison, new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ); 11 } 27 // Local Variables: // 28 // tab-width: 4 // 29 // mode: c++ // 30 // compile-command: "make install" // 31 // End: //
Note: See TracChangeset
for help on using the changeset viewer.