This is an archive of the discontinued LLVM Phabricator instance.

[flang][driver] Add support for `-mllvm`
ClosedPublic

Authored by awarzynski on Mar 10 2022, 4:27 AM.

Details

Summary

This option is added in both flang-new (the compiler driver) and
flang-new -fc1 (the frontend driver). The semantics are consistent
with clang and clang -cc1.

As Flang does not run any LLVM passes when invoked with -emit-llvm
(i.e. flang-new -S -emit-llvm <file>), the tests use
-S/-c/-emit-obj instead. These options require an LLVM backend to
be run by the driver to generate the output (this makese -mllvm
relevant here).

Diff Detail

Event Timeline

awarzynski created this revision.Mar 10 2022, 4:27 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
Herald added a subscriber: dang. · View Herald Transcript
awarzynski requested review of this revision.Mar 10 2022, 4:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2022, 4:27 AM
xbolva00 added inline comments.
flang/test/Driver/mllvm.f90
2

mllvm

LGTM (will let others review as this includes changes to clang too and I am not familiar with it)

awarzynski added inline comments.Mar 10 2022, 6:18 AM
flang/test/Driver/mllvm.f90
2

Does it matter? -mllvm is consistent with other tests in this directory (e.g. https://github.com/llvm/llvm-project/blob/main/flang/test/Driver/emit-llvm.f90#L1).

xbolva00 added inline comments.Mar 10 2022, 6:28 AM
flang/test/Driver/mllvm.f90
2

Just typo “mlvm”

awarzynski added inline comments.Mar 10 2022, 6:31 AM
flang/test/Driver/mllvm.f90
2

Sorry, I misread that :/ I thought that you meant mllvm instead of -mllvm. My bad, thanks for pointing this out! :)

Fix option spelling in test

schweitz accepted this revision.Mar 15 2022, 12:25 PM
This revision is now accepted and ready to land.Mar 15 2022, 12:25 PM
This revision was automatically updated to reflect the committed changes.