ADT
        aaron-thesis
        arm-eh
        ast-experimental
        cleanup-dtors
        deferred_resn
        demangler
        enum
        forall-pointer-decay
        jacob/cs343-translation
        jenkins-sandbox
        new-ast
        new-ast-unique-expr
        new-env
        no_list
        persistent-indexer
        pthread-emulation
        qualifiedEnum
        resolv-new
        with_gc
      
      
        
          | 
            Last change
 on this file since ed9c0a8 was             9335ecc, checked in by Peter A. Buhr <pabuhr@…>, 8 years ago           | 
        
        
          | 
             
update internal names for renamed files 
 
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            1.0 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 | // parserutility.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 : Wed Jun 28 22:11:32 2017
 | 
|---|
| 13 | // Update Count     : 7
 | 
|---|
| 14 | //
 | 
|---|
| 15 | 
 | 
|---|
| 16 | #include "parserutility.h"
 | 
|---|
| 17 | #include "SynTree/Type.h"
 | 
|---|
| 18 | #include "SynTree/Expression.h"
 | 
|---|
| 19 | 
 | 
|---|
| 20 | // rewrite
 | 
|---|
| 21 | //    if ( x ) ...
 | 
|---|
| 22 | // as
 | 
|---|
| 23 | //    if ( (int)(x != 0) ) ...
 | 
|---|
| 24 | 
 | 
|---|
| 25 | Expression *notZeroExpr( Expression *orig ) {
 | 
|---|
| 26 |         UntypedExpr *comparison = new UntypedExpr( new NameExpr( "?!=?" ) );
 | 
|---|
| 27 |         comparison->get_args().push_back( orig );
 | 
|---|
| 28 |         comparison->get_args().push_back( new ConstantExpr( Constant( new ZeroType( emptyQualifiers ), "0", (unsigned long long int)0 ) ) );
 | 
|---|
| 29 |         return new CastExpr( comparison, new BasicType( Type::Qualifiers(), BasicType::SignedInt ) );
 | 
|---|
| 30 | }
 | 
|---|
| 31 | 
 | 
|---|
| 32 | // Local Variables: //
 | 
|---|
| 33 | // tab-width: 4 //
 | 
|---|
| 34 | // mode: c++ //
 | 
|---|
| 35 | // compile-command: "make install" //
 | 
|---|
| 36 | // End: //
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.