This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Fix line truncation in omp_lib.h
ClosedPublic

Authored by hbae on Sep 8 2021, 3:07 PM.

Details

Diff Detail

Event Timeline

hbae created this revision.Sep 8 2021, 3:07 PM
hbae requested review of this revision.Sep 8 2021, 3:07 PM
AndreyChurbanov requested changes to this revision.Sep 9 2021, 5:18 AM
AndreyChurbanov added inline comments.
openmp/runtime/src/include/omp_lib.h.var
222

I think a better way to reduce the line length is to remove optional "kind=" from the attribute. E.g.

integer(omp_allocator_handle_kind)llvm_omp_target_device_mem_alloc

will fit into 72 char length.

In general there is no reliable way to have line continuation suitable for both fixed and free source forms,
because compilers usually have an option to change default line length, possibly up to "infinite" (e.g. -ffixed-line-length-0 for gfortran).
So having & at the end of line and beginning of the next line can always fail to compile with some compiler options.
Better to avoid this "universal" continuation if possible.

This revision now requires changes to proceed.Sep 9 2021, 5:18 AM
hbae updated this revision to Diff 371573.Sep 9 2021, 6:15 AM

Applied suggested changes.

hbae marked an inline comment as done.Sep 9 2021, 6:16 AM
This revision is now accepted and ready to land.Sep 9 2021, 6:17 AM
This revision was automatically updated to reflect the committed changes.