[llvm] r222307 - Expose LLVM version string via macro in llvm-config.h, and modify Go bindings

Peter Collingbourne peter at pcc.me.uk
Tue Nov 18 19:34:17 PST 2014


Author: pcc
Date: Tue Nov 18 21:34:17 2014
New Revision: 222307

URL: http://llvm.org/viewvc/llvm-project?rev=222307&view=rev
Log:
Expose LLVM version string via macro in llvm-config.h, and modify Go bindings
to make use of it.

Modified:
    llvm/trunk/autoconf/configure.ac
    llvm/trunk/bindings/go/build.sh
    llvm/trunk/bindings/go/llvm/version.go
    llvm/trunk/configure
    llvm/trunk/include/llvm/Config/config.h.in
    llvm/trunk/include/llvm/Config/llvm-config.h.cmake
    llvm/trunk/include/llvm/Config/llvm-config.h.in

Modified: llvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=222307&r1=222306&r2=222307&view=diff
==============================================================================
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Tue Nov 18 21:34:17 2014
@@ -42,6 +42,7 @@ LLVM_VERSION_SUFFIX=svn
 AC_DEFINE_UNQUOTED([LLVM_VERSION_MAJOR], $LLVM_VERSION_MAJOR, [Major version of the LLVM API])
 AC_DEFINE_UNQUOTED([LLVM_VERSION_MINOR], $LLVM_VERSION_MINOR, [Minor version of the LLVM API])
 AC_DEFINE_UNQUOTED([LLVM_VERSION_PATCH], $LLVM_VERSION_PATCH, [Patch version of the LLVM API])
+AC_DEFINE_UNQUOTED([LLVM_VERSION_STRING], "$PACKAGE_VERSION", [LLVM version string])
 
 AC_SUBST([LLVM_VERSION_MAJOR])
 AC_SUBST([LLVM_VERSION_MINOR])

Modified: llvm/trunk/bindings/go/build.sh
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/go/build.sh?rev=222307&r1=222306&r2=222307&view=diff
==============================================================================
--- llvm/trunk/bindings/go/build.sh (original)
+++ llvm/trunk/bindings/go/build.sh Tue Nov 18 21:34:17 2014
@@ -26,6 +26,3 @@ else
 fi
 
 $llvm_go print-config > $gollvmdir/llvm_config.go
-
-llvm_version="$($llvm_config --version)"
-printf "package llvm\n\nconst Version = \"%s\"\n" "$llvm_version" > $gollvmdir/version.go

Modified: llvm/trunk/bindings/go/llvm/version.go
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/go/llvm/version.go?rev=222307&r1=222306&r2=222307&view=diff
==============================================================================
--- llvm/trunk/bindings/go/llvm/version.go (original)
+++ llvm/trunk/bindings/go/llvm/version.go Tue Nov 18 21:34:17 2014
@@ -1,3 +1,21 @@
+//===- version.go - LLVM version info -------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines LLVM version information.
+//
+//===----------------------------------------------------------------------===//
+
 package llvm
 
-const Version = "3.6.0svn"
+/*
+#include "llvm/Config/llvm-config.h"
+*/
+import "C"
+
+const Version = C.LLVM_VERSION_STRING

Modified: llvm/trunk/configure
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=222307&r1=222306&r2=222307&view=diff
==============================================================================
--- llvm/trunk/configure (original)
+++ llvm/trunk/configure Tue Nov 18 21:34:17 2014
@@ -1941,6 +1941,11 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+cat >>confdefs.h <<_ACEOF
+#define LLVM_VERSION_STRING "$PACKAGE_VERSION"
+_ACEOF
+
+
 
 
 

Modified: llvm/trunk/include/llvm/Config/config.h.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.in?rev=222307&r1=222306&r2=222307&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Config/config.h.in (original)
+++ llvm/trunk/include/llvm/Config/config.h.in Tue Nov 18 21:34:17 2014
@@ -543,6 +543,9 @@
 /* Patch version of the LLVM API */
 #undef LLVM_VERSION_PATCH
 
+/* LLVM version string */
+#undef LLVM_VERSION_STRING
+
 /* The shared library extension */
 #undef LTDL_SHLIB_EXT
 

Modified: llvm/trunk/include/llvm/Config/llvm-config.h.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/llvm-config.h.cmake?rev=222307&r1=222306&r2=222307&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Config/llvm-config.h.cmake (original)
+++ llvm/trunk/include/llvm/Config/llvm-config.h.cmake Tue Nov 18 21:34:17 2014
@@ -92,6 +92,9 @@
 /* Minor version of the LLVM API */
 #cmakedefine LLVM_VERSION_MINOR ${LLVM_VERSION_MINOR}
 
+/* LLVM version string */
+#define LLVM_VERSION_STRING "${PACKAGE_VERSION}"
+
 /* Define if we link Polly to the tools */
 #cmakedefine LINK_POLLY_INTO_TOOLS
 

Modified: llvm/trunk/include/llvm/Config/llvm-config.h.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/llvm-config.h.in?rev=222307&r1=222306&r2=222307&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Config/llvm-config.h.in (original)
+++ llvm/trunk/include/llvm/Config/llvm-config.h.in Tue Nov 18 21:34:17 2014
@@ -92,4 +92,7 @@
 /* Minor version of the LLVM API */
 #undef LLVM_VERSION_MINOR
 
+/* LLVM version string */
+#undef LLVM_VERSION_STRING
+
 #endif





More information about the llvm-commits mailing list