This is an archive of the discontinued LLVM Phabricator instance.

Fix for https://bugs.llvm.org/show_bug.cgi?id=38839
ClosedPublic

Authored by AndreyChurbanov on Sep 5 2018, 10:41 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

jlpeyton added inline comments.Sep 5 2018, 11:12 AM
runtime/src/include/50/omp_lib.h.var
28–30 ↗(On Diff #164070)

Aren't these longer than 72 chars?

runtime/src/include/50/omp_lib.h.var
28–30 ↗(On Diff #164070)

Yes - before variables substitution, and NO - after the substitution performed during the build.
LIBOMP_OMP_YEAR_MONTH - 6 chars, LIBOMP_VERSION* - single char each.
So the built header has these lines short enough.

jlpeyton accepted this revision.Sep 5 2018, 11:25 AM

Alright, that makes sense. LGTM.

This revision is now accepted and ready to land.Sep 5 2018, 11:25 AM
pawosm01 added inline comments.
runtime/src/include/50/omp_lib.h.var
31 ↗(On Diff #164070)

It's not gonna work if someone use fixed format and extended line len, compiler will fail on this & at end.
There are omp_lib.h implementation that are

  1. fixed format
  2. yet still have lines no longer than 72 characters

so they can be always included, e.g.:
https://github.com/flang-compiler/flang/blob/master/include/omp_lib.h

I am a bit puzzled by the requirement for the file to be compilable in free or fixed form and with 72 or 132 line width, because of the line:

integer(kind=omp_control_tool_result_kind)omp_control_tool_nocallback

Not sure if it is possible at all.

Changed the style so that all lines have length less than 72 char.
The kind of the longest variable "omp_control_tool_nocallback" changed from "omp_control_tool_result_kind" to be the parent kind "omp_integer_kind", thus the declaration line fits 72 chars (could not come up with a better solution for this variable).

Alternatively tried to place continuation sign "&" to post 132 location, but this looks like a non-standard trick, though Intel compiler works with this.

AndreyChurbanov marked an inline comment as done.Sep 7 2018, 4:38 AM
pawosm01 accepted this revision.Sep 7 2018, 5:03 AM
This revision was automatically updated to reflect the committed changes.