This is an archive of the discontinued LLVM Phabricator instance.

[flang] Search for #include "file" in right directory (take 2)
ClosedPublic

Authored by klausler on Jan 26 2021, 2:01 PM.

Details

Summary

Make the #include "file" preprocessing directive begin its
search in the same directory as the file containing the directive,
as other preprocessors and our Fortran INCLUDE statement do.

Avoid current working directory for all source files except the original.

Resolve tests.

Diff Detail

Event Timeline

klausler created this revision.Jan 26 2021, 2:01 PM
klausler requested review of this revision.Jan 26 2021, 2:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2021, 2:01 PM
kiranchandramohan added inline comments.
flang/test/Flang-Driver/Inputs/basictestmoduleone.mod
1–5

I am guessing this version number (v1) might need to be updated with a change in module format. Is that expected to be rare since f18 uses the parser to parse the module file?

awarzynski accepted this revision.Jan 27 2021, 7:25 AM

Thank you for re-submitting this so quickly @klausler !

These changes look good to me. I have one question about module files - is it safe to assume that modules with version information v1 are always going to be supported? I'm concerned that when we bump the version then we will also have to update the uploaded module files.

flang/test/Flang-Driver/include-module.f90
21

[nit] This and the line above are mutually exclusive, right? So this line could safely be deleted. Or replaced with:

! SINGLEINCLUDE:Source file 'basictestmoduletwo.mod' was not found
This revision is now accepted and ready to land.Jan 27 2021, 7:25 AM
tskeith accepted this revision.Jan 27 2021, 8:03 AM
This revision was landed with ongoing or failed builds.Jan 27 2021, 3:41 PM
This revision was automatically updated to reflect the committed changes.