<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 01/26/2017 12:45 AM, Nemanja
      Ivanovic via llvm-dev wrote:<br>
    </div>
    <blockquote
cite="mid:CAObEeNi34BV52uVpgAOpn=ZkK6CM_6JcFjvMsgDf_MryOJ5Chg@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div dir="ltr">
        <div>
          <div>
            <div>This has actually come up in the context of a JIT, but
              I think that having the functionality in general could be
              useful.<br>
              <br>
            </div>
            Currently, there does not appear to be an API in LLVM to
            query for LLVM version information. In the particular
            context where this came up, LLVM is used as a shared library
            and various functionality (and bug fixes) used by the JIT is
            available in various LLVM versions. So it would be quite
            convenient to be able to dynamically determine the version
            that happens to be loaded.<br>
            <br>
          </div>
          Honestly, I am not completely clear on what the best place for
          something like this would be, but it appears that the
          following seems like a natural choice:<br>
          <br>
        </div>
        <span style="font-family:monospace,monospace">llvm::VersionPrinter</span>
        in <span style="font-family:monospace,monospace">lib/Support/CommandLine.cpp</span>
        already queries this data so it might make sense for it to
        expose the following API's (as part of <span
          style="font-family:monospace,monospace">VersionPrinter</span>,
        accessed through the instance):<br>
        <span style="font-family:monospace,monospace">llvm::cl::getVersionMajor()</span><br>
        <span style="font-family:monospace,monospace">llvm::cl::getVersionMinor()<br>
        </span><span style="font-family:monospace,monospace">llvm::cl::getVersionPatch()</span><br>
      </div>
    </blockquote>
    <br>
    Makes sense to me, although I see no reason for the functions to be
    in the 'cl' namespace.<br>
    <br>
     -Hal<br>
    <br>
    <blockquote
cite="mid:CAObEeNi34BV52uVpgAOpn=ZkK6CM_6JcFjvMsgDf_MryOJ5Chg@mail.gmail.com"
      type="cite">
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
  </body>
</html>