[Patch, fortran, 4.9] Use bool type instead gfc_try

Janne Blomqvist blomqvist.janne@gmail.com
Tue Mar 19 12:34:00 GMT 2013


Hi,

now that the Fortran frontend is C++ we can use the primitive bool
type instead of inventing our own. The patch is almost entirely
mechanical, apart from manually removing the definition of enum
gfc_try in gfortran.h, it has been generated with the following
script:

#!/bin/sh

for file in $(ls -1 *.c *.h)
do
    sed 's/FAILURE/false/' $file > tmp
    sed 's/SUCCESS/true/' tmp > tmp2
    sed 's/gfc_try/bool/' tmp2 > tmp
    mv tmp $file
    rm tmp2
done

Regtested on x86_64-unknown-linux-gnu. I get an XPASS on
gfortran.dg/do_1.f90, but IIRC I have encountered this before so it
should not be caused by this patch. Ok for trunk (4.9)?

2013-03-19  Janne Blomqvist  <jb@gcc.gnu.org>

	* gfortran.h: Remove enum gfc_try, replace gfc_try with bool type.
	* arith.c: Replace gfc_try with bool type.
	* array.c: Likewise.
	* check.c: Likewise.
	* class.c: Likewise.
	* cpp.c: Likewise.
	* cpp.h: Likewise.
	* data.c: Likewise.
	* data.h: Likewise.
	* decl.c: Likewise.
	* error.c: Likewise.
	* expr.c: Likewise.
	* f95-lang.c: Likewise.
	* interface.c: Likewise.
	* intrinsic.c: Likewise.
	* intrinsic.h: Likewise.
	* io.c: Likewise.
	* match.c: Likewise.
	* match.h: Likewise.
	* module.c: Likewise.
	* openmp.c: Likewise.
	* parse.c: Likewise.
	* parse.h: Likewise.
	* primary.c: Likewise.
	* resolve.c: Likewise.
	* scanner.c: Likewise.
	* simplify.c: Likewise.
	* symbol.c: Likewise.
	* trans-intrinsic.c: Likewise.
	* trans-openmp.c: Likewise.
	* trans-stmt.c: Likewise.
	* trans-types.c: Likewise.


-- 
Janne Blomqvist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: boolfront.diff.gz
Type: application/x-gzip
Size: 121497 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130319/14839ef3/attachment.bin>


More information about the Gcc-patches mailing list