[all-commits] [llvm/llvm-project] b5ee46: [flang][driver] Add pre-processing type for Fortra...

Kareem Ergawy via All-commits all-commits at lists.llvm.org
Sun Sep 8 21:37:11 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b5ee4639dee0fd74c1215547e35bd9a10cfc5925
      https://github.com/llvm/llvm-project/commit/b5ee4639dee0fd74c1215547e35bd9a10cfc5925
  Author: Kareem Ergawy <kareem.ergawy at amd.com>
  Date:   2024-09-09 (Mon, 09 Sep 2024)

  Changed paths:
    M clang/include/clang/Driver/Types.def
    A flang/test/Driver/save-temps-use-module.f90

  Log Message:
  -----------
  [flang][driver] Add pre-processing type for Fortran pre-processed files (#104664)

When using `--save-temps`, flang-new emits (among other things) an
`<input>.i` file. These `.i` files are pre-processed Fortran files
containing information about the modules referenced by the input source
(these files are emitted by: `Parsing::EmitPreprocessedSource`).

This diff allows `.i` files emitted by flang-new to be treated as valid
files in the pre-processing phase. This, in turn, allows flang-new to
add pre-processing options (e.g. `-I`) when launching compilation jobs
for these files.

This solves a bug when using `--save-temps` with source files that
include modules from non-standard directories, for example:
```
flang-new -c --save-temps -I/tmp/module_dir -fno-integrated-as \
  /tmp/ModuleUser.f90
```
The problem was that `.i` files were treated as "binary" files and
therefore the return value for `types::getPreprocessedType(InputType)`
in `Flang::ConstructJob(...)` was `types::TY_INVALID`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list