<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - OMPT runtime msvc support"
   href="https://bugs.llvm.org/show_bug.cgi?id=36574">36574</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>OMPT runtime msvc support
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Runtime Library
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>trass3r@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The OMPT part of the OpenMP runtime does have a PSAPI based implementation for
Windows but does not currently support msvc as a compiler.

I attached a patch which gets it to compile and link, but is only for
reference.
Some parts of it like removing the non-standard VLA and the ompt-specific.h
change may be of general interest.

The OMPT_GET_*_ADDRESS hacks were just for testing.
These macros are only called with values of 0 or 1 (though the documentation at
<a href="https://gcc.gnu.org/onlinedocs/gcc/Return-Address.html">https://gcc.gnu.org/onlinedocs/gcc/Return-Address.html</a> for
__builtin_frame_address warns that "calling this function with a nonzero
argument can have unpredictable effects, including crashing the calling
program.")

The zero case may work with the given msvc intrinsics (not tested) but the
other one is not so easy to solve, may require assembly.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>