[cfe-commits] r167567 - in /cfe/trunk: include/clang/Driver/Driver.h include/clang/Driver/Types.h lib/Driver/Driver.cpp lib/Driver/ToolChains.cpp lib/Driver/Tools.cpp lib/Driver/Tools.h lib/Driver/Types.cpp lib/Driver/WindowsToolChain.cpp

Hal Finkel hfinkel at anl.gov
Tue Nov 13 15:44:25 PST 2012


----- Original Message -----
> From: "Richard Smith" <richard at metafoo.co.uk>
> To: "Rafael EspĂ­ndola" <rafael.espindola at gmail.com>
> Cc: cfe-commits at cs.uiuc.edu
> Sent: Monday, November 12, 2012 9:54:15 PM
> Subject: Re: [cfe-commits] r167567 - in /cfe/trunk: include/clang/Driver/Driver.h include/clang/Driver/Types.h
> lib/Driver/Driver.cpp lib/Driver/ToolChains.cpp lib/Driver/Tools.cpp lib/Driver/Tools.h lib/Driver/Types.cpp
> lib/Driver/WindowsToolChain.cpp
> 
> On Mon, Nov 12, 2012 at 7:14 PM, Rafael EspĂ­ndola
> <rafael.espindola at gmail.com> wrote:
> >> Consider:
> >>
> >> cat << EOF > test.F
> >>       PROGRAM HELLOW
> >>       WRITE(UNIT=*, FMT=*) 'Hello World'
> >>       END
> >> EOF
> >>
> >> clang-cpp test.F
> >
> > This used to run
> > f951 test.F -cpp=/tmp/ccOj9mhO.f90 -E -quiet -v test.F -o - -m64
> > -mtune=generic -march=x86-64 -fsyntax-only
> >
> > Now it tries to run clang as a preprocessor and fails because of
> > the
> > "-x f95-cpp-input". Is the fortran preprocessor the same as the c
> > one?
> 
> It's similar, but not quite the same. There is a patch to support
> Fortran preprocessing in Clang:
> 
> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120430/057199.html

Yes, my understanding is that most Fortran compilers slightly modify their tokenization rules for Fortran preprocessing. None of this is covered by any standard, of course, so what we do would be completely up to us. For F77 codes (which is what f2c handles), it probably makes no difference, putting the preprocessor in C mode should be fine. Adding the additional file types to Clang would be easy, but as far as full Fortran support, that will probably never end up directly in Clang (I'd be happy to discuss future plans for a separate Fortran frontend, but this is not the right thread for that).

> 
> (There's also Fortran 95's coco preprocessor, which is not the same
> at
> all, but I assume that's not what's wanted here.)

That is a completely separate preprocessing layer which, to the best of my knowledge, is used by very few people (if anyone).

 -Hal

> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 

-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory




More information about the cfe-commits mailing list