Can I read llvm version through API?

Is there an API function exported from libLLVM.so that would return the version of llvm compiler used?
I would like to be able to read not only 2.8 but also the precise source version identifier, like svn revision for example. And maybe the build date.

Yuri

Hi Yuri,

Is there an API function exported from libLLVM.so that would return the
version of llvm compiler used?
I would like to be able to read not only 2.8 but also the precise source
version identifier, like svn revision for example. And maybe the build date.

maybe utils/GetSourceVersion will help.

Ciao,

Duncan.

No, I meant can I read the version from the shared library libLLVM.so?

I guess the answer is "no". So I will make a patch for this.

Yuri

Hi Yuri,

maybe utils/GetSourceVersion will help.

No, I meant can I read the version from the shared library libLLVM.so?

I guess the answer is "no". So I will make a patch for this.

I think it is already possible to get it from the API:

$ opt -version
Low Level Virtual Machine (http://llvm.org/):
   llvm version 2.8svn
   DEBUG build with assertions.
   Built Jul 21 2010 (12:40:48).
   Host: x86_64-unknown-linux-gnu
   Host CPU: core2

   Registered Targets:
     (none)

Sorry, that just gives the LLVM version, I forgot you wanted the
repository revision - my bad.

Ciao,

Duncan.