<div dir="ltr"><div><div>I am certainly willing to write up a patch to do this. I was hoping to get a few more responses/buy-in from the community.<br></div>And honestly, I'd be interested to know if this can be back-ported to at least 4.0 if it gets accepted.<br><br></div>Now that I see that there's more interest in this than just my own, I'll put up a patch on Phabricator.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 8, 2017 at 12:04 AM, Timothy Arceri via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 01/26/2017 12:45 AM, Nemanja Ivanovic via llvm-dev wrote:<br>
> This has actually come up in the context of a JIT, but I think that <br>
> having the functionality in general could be useful.<br>
><br>
> Currently, there does not appear to be an API in LLVM to query for <br>
> LLVM version information. In the particular context where this came <br>
> up, LLVM is used as a shared library and various functionality (and <br>
> bug fixes) used by the JIT is available in various LLVM versions. So <br>
> it would be quite convenient to be able to dynamically determine the <br>
> version that happens to be loaded.<br>
><br>
> Honestly, I am not completely clear on what the best place for <br>
> something like this would be, but it appears that the following<br>
seems <br>
> like a natural choice:<br>
><br>
> llvm::VersionPrinter in lib/Support/CommandLine.cpp already queries <br>
> this data so it might make sense for it to expose the following<br>
API's <br>
> (as part of VersionPrinter, accessed through the instance):<br>
> llvm::cl::getVersionMajor()<br>
> llvm::cl::getVersionMinor()<br>
> llvm::cl::getVersionPatch()<br>
<br>
Hi,<br>
<br>
I'm also interested in querying this at runtime. Has there been any<br>
patches submitted for this yet?<br>
<br>
Thanks,<br>
Tim<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br></div>