This is an archive of the discontinued LLVM Phabricator instance.

[flang] Make runtimes headers independent of the main llvm headers
ClosedPublic

Authored by mstorsjo on Jul 22 2022, 5:06 AM.

Details

Summary

llvm/Support/Compiler.h requires llvm-config.h, i.e. to include it,
you'd need to actually set up building llvm for that target.

If using flang to cross compile code for a different target, we need
the runtimes built for that target, but we might not want to build
llvm itself for that target.

This is one out of two essential steps for building the flang runtimes
for a foreign target, i.e. setting up cross compiling with flang.

Diff Detail

Event Timeline

mstorsjo created this revision.Jul 22 2022, 5:06 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
mstorsjo requested review of this revision.Jul 22 2022, 5:06 AM
clementval added inline comments.
flang/include/flang/Common/idioms.h
37
mstorsjo updated this revision to Diff 446797.Jul 22 2022, 5:21 AM
mstorsjo marked an inline comment as done.

Applied the suggested style fix

rovka added a subscriber: rovka.Jul 25 2022, 2:03 AM
rovka added inline comments.
flang/include/flang/Common/idioms.h
44

Nitpick: Can we just use C++17's maybe_unused attribute instead? (This header is already requiring C++17)

mstorsjo updated this revision to Diff 448029.Jul 27 2022, 7:12 AM

Use C++17 [[maybe_unused]].

flang/include/flang/Common/idioms.h
44

Thanks, that’s much nicer!

Ping @rovka - does this seem ok now?

Adding a few more reviewers here - is someone of you willing to have a look at this?

LGTM. Please wait on @rovka as well.

awarzynski accepted this revision.Aug 22 2022, 4:18 AM

Sorry about the delay ("holiday season"), makes sense to me. Thanks for contributing!

You've already addressed Diana's comment and have "+1" from 2 other reviewers. I would just land it if there are no new comments today.

This revision is now accepted and ready to land.Aug 22 2022, 4:18 AM