llvm-project/openmp/runtime/cmake
Jonathan Peyton 69e596a5e7 [OMPT] Windows Support for OMPT
The problem is that the ompt_tool() function (which must be implemented by a
performance tool) should be defined in the RTL as well to cover the case when
the tool is not present in the address space of the process. This functionality
is accomplished with weak symbols in Unices. Unfortunately, Windows does not
support weak symbols.

The solution in these changes is to grab the list of all modules loaded by the
process and then search for symbol "ompt_tool()" within them. The function
ompt_tool_windows() performs the search of the ompt_tool symbol. If ompt_tool is
found, then its return value is used to initialize the tool. If ompt_tool is not
found, then ompt_tool_windows() returns NULL and OMPT is thus, disabled.

While doing these changes, the OMPT_SUPPORT detection in CMake was changed to
test for the required featuers for OMPT_SUPPORT, namely: builtin_frame_address()
existence, weak attribute existence and psapi.dll existence. For
LIBOMP_HAVE_OMPT_SUPPORT to be true, it must be that the builtin_frame_address()
intrinsic exists AND one of: either weak attributes exist or psapi.dll exists.

Also, since Process Status API is used I had to add new dependency -- psapi.dll
to the library dependency micro test.

Differential Revision: http://reviews.llvm.org/D14027

llvm-svn: 251654
2015-10-29 20:56:24 +00:00
..
LibompCheckFortranFlag.cmake Re-indent the CMake refactor to two-space indention 2015-07-15 16:57:19 +00:00
LibompCheckLinkerFlag.cmake [CMake] Fix libomp_check_linker_flag function 2015-07-23 14:41:35 +00:00
LibompDefinitions.cmake [OpenMP] [CMake] Removing expand-vars.pl in favor of CMake's configure_file() 2015-08-28 18:42:10 +00:00
LibompExports.cmake Re-indent the CMake refactor to two-space indention 2015-07-15 16:57:19 +00:00
LibompGetArchitecture.cmake Re-indent the CMake refactor to two-space indention 2015-07-15 16:57:19 +00:00
LibompHandleFlags.cmake Complex division requires libm on NetBSD, add it. 2015-09-21 20:21:02 +00:00
LibompMicroTests.cmake [OMPT] Windows Support for OMPT 2015-10-29 20:56:24 +00:00
LibompUtils.cmake Re-indent the CMake refactor to two-space indention 2015-07-15 16:57:19 +00:00
config-ix.cmake [OMPT] Windows Support for OMPT 2015-10-29 20:56:24 +00:00