Page MenuHomePhabricator

Move special va_list handling to kmp_os.h
ClosedPublic

Authored by dim on Aug 22 2020, 6:32 AM.

Details

Summary

Instead of copying and pasting the same #ifdef expressions in multiple
places, define a type and a pair of macros in kmp_os.h, to handle
whether va_list is pointer-like or not:

  • kmp_va_list is the type to use for __kmp_fork_call()
  • kmp_va_deref() dereferences a va_list, if necessary
  • kmp_va_addr_of() takes the address of a va_list, if necessary

Also add FreeBSD to the list of OSes that has a non pointer-like
va_list. This can now be easily extended to other OSes too.

Diff Detail

Event Timeline

dim created this revision.Aug 22 2020, 6:32 AM
dim requested review of this revision.Aug 22 2020, 6:32 AM

This seems to replace D77333

AndreyChurbanov accepted this revision.Aug 24 2020, 1:21 PM

This seems to replace D77333

I'd say this is improved version of D77333.
LGTM

This revision is now accepted and ready to land.Aug 24 2020, 1:21 PM
This revision was landed with ongoing or failed builds.Aug 24 2020, 1:32 PM
This revision was automatically updated to reflect the committed changes.
dim added a comment.Aug 24 2020, 1:49 PM

Please note, I did a follow-up commit in rG47b0262d3f82, to address compile errors I received from the x86_64-linux-debian build bot:

In file included from /b/1/openmp-clang-x86_64-linux-debian/llvm.src/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.cpp:11:
/b/1/openmp-clang-x86_64-linux-debian/llvm.src/openmp/runtime/src/kmp_os.h:206:9: error: unknown type name 'va_list'
typedef va_list *kmp_va_list;
        ^

So I added a <stdarg.h> include to kmp_os.h.