diff options
author | Kareem Ergawy <kareem.ergawy@amd.com> | 2024-09-09 06:36:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-09 06:36:48 +0200 |
commit | b5ee4639dee0fd74c1215547e35bd9a10cfc5925 (patch) | |
tree | c7d96f8d37e22f32186ad392f56999dd8215d58e /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | f2b71491d11355c0df0c92ef7cce7d610c894660 (diff) | |
download | llvm-b5ee4639dee0fd74c1215547e35bd9a10cfc5925.zip llvm-b5ee4639dee0fd74c1215547e35bd9a10cfc5925.tar.gz llvm-b5ee4639dee0fd74c1215547e35bd9a10cfc5925.tar.bz2 |
[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`.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions