This is an archive of the discontinued LLVM Phabricator instance.

[flang][driver] Fix how output filename is generated
ClosedPublic

Authored by awarzynski on Jul 7 2021, 3:52 AM.

Details

Summary

Currently, flang -c file.f generates flang_unparsed_source_file_0.o.
This is incorrect. This patch:

  • simplifies the logic around output filename generation, and
  • makes sure that file.o is produced instead of e.g. flang_unparsed_source_file_0.o when using the -c flag

The output filename generation is moved to a dedicated function. I've
also made a few minor improvements, e.g. marked variables as local,
added comments, refined error messages.

Diff Detail

Event Timeline

awarzynski created this revision.Jul 7 2021, 3:52 AM
awarzynski requested review of this revision.Jul 7 2021, 3:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2021, 3:52 AM
awarzynski added a project: Restricted Project.
sscalpone accepted this revision.Jul 7 2021, 9:39 PM

Worked for me. Thanks!

This revision is now accepted and ready to land.Jul 7 2021, 9:39 PM
Leporacanthicus accepted this revision.Jul 9 2021, 7:34 AM
This revision was automatically updated to reflect the committed changes.

I was about to complain to you after finding:

ERROR: unrecognised option format CMakeFiles/FM002.dir/FM002.f.o

In our bot logs. But you already fixed it! Now I'll have to find something else to complain about :).

I also saw some:

rm: cannot remove 'flang_unparsed_source_file_0.f90': No such file or directory

So this should go a long way toward clearing up the test suite on our flang bots.

@DavidSpickett, thanks for investigating this!

Now I'll have to find something else to complain about :).

@sscalpone has been doing a great job in this area :) See https://reviews.llvm.org/D105896.