Nemanja Ivanovic via llvm-dev
2017-Jan-26 06:45 UTC
[llvm-dev] [RFC] Queries for LLVM version
This has actually come up in the context of a JIT, but I think that having the functionality in general could be useful. 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. 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: llvm::VersionPrinter in lib/Support/CommandLine.cpp already queries this data so it might make sense for it to expose the following API's (as part of VersionPrinter, accessed through the instance): llvm::cl::getVersionMajor() llvm::cl::getVersionMinor() llvm::cl::getVersionPatch() -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170126/1d321a71/attachment.html>
On 01/26/2017 12:45 AM, Nemanja Ivanovic via llvm-dev wrote:> This has actually come up in the context of a JIT, but I think that > having the functionality in general could be useful. > > 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. > > 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: > > llvm::VersionPrinter in lib/Support/CommandLine.cpp already queries > this data so it might make sense for it to expose the following API's > (as part of VersionPrinter, accessed through the instance): > llvm::cl::getVersionMajor() > llvm::cl::getVersionMinor() > llvm::cl::getVersionPatch()Makes sense to me, although I see no reason for the functions to be in the 'cl' namespace. -Hal> > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-- Hal Finkel Lead, Compiler Technology and Programming Languages Leadership Computing Facility Argonne National Laboratory -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170126/75293207/attachment.html>