]> granicus.if.org Git - clang/commitdiff
clang: Derive version name from LLVM unless specified explicitly. This means
authorDaniel Dunbar <daniel@zuster.org>
Fri, 25 Jun 2010 23:34:47 +0000 (23:34 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 25 Jun 2010 23:34:47 +0000 (23:34 +0000)
clang is now clang 2.8.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106914 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt
VER [deleted file]
include/clang/Basic/Makefile
test/Preprocessor/init.c

index 6154fdb66f1d21c29dabfb021adcfcd34e8f9a82..1ba2a622d4e1c1ff929c3d62069de6f124f33425 100644 (file)
@@ -1,10 +1,5 @@
 # Clang version information
 
-# Make sure that CMake reconfigures when the version changes.
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/VER
-  ${CMAKE_CURRENT_BINARY_DIR}/VER)
-
 set(CLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 set(CLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
 
@@ -28,10 +23,9 @@ if( NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
   endif()
 endif()
 
-# Compute the Clang version from the contents of VER
-file(READ ${CMAKE_CURRENT_SOURCE_DIR}/VER CLANG_VERSION_DATA)
+# Compute the Clang version from the LLVM version.
 string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION 
-  ${CLANG_VERSION_DATA})
+  ${PACKAGE_VERSION})
 message(STATUS "Clang version: ${CLANG_VERSION}")
 
 string(REGEX REPLACE "([0-9]+)\\.[0-9]+(\\.[0-9]+)?" "\\1" CLANG_VERSION_MAJOR
diff --git a/VER b/VER
deleted file mode 100644 (file)
index cd5ac03..0000000
--- a/VER
+++ /dev/null
@@ -1 +0,0 @@
-2.0
index 8bbc807a09382f3447bf00f2d190ade99933158b..7db3e2982af4f7e0a8a670ca6fcad5f133df8062 100644 (file)
@@ -13,7 +13,11 @@ include $(CLANG_LEVEL)/Makefile
 
 INPUT_TDS = $(wildcard $(PROJ_SRC_DIR)/Diagnostic*.td)
 
-CLANG_VERSION := $(shell cat $(PROJ_SRC_DIR)/../../../VER)
+# Compute the Clang version from the LLVM version, unless specified explicitly.
+ifndef CLANG_VERSION
+CLANG_VERSION := $(subst svn,,$(LLVMVersion))
+endif
+
 CLANG_VERSION_COMPONENTS := $(subst ., ,$(CLANG_VERSION))
 CLANG_VERSION_MAJOR := $(word 1,$(CLANG_VERSION_COMPONENTS))
 CLANG_VERSION_MINOR := $(word 2,$(CLANG_VERSION_COMPONENTS))
@@ -41,7 +45,7 @@ $(ObjDir)/arm_neon.inc.tmp : arm_neon.td $(TBLGEN) $(ObjDir)/.dir
        $(Echo) "Building Clang arm_neon.inc with tblgen"
        $(Verb) $(TableGen) -gen-arm-neon-sema -o $(call SYSPATH, $@) $<
 
-$(ObjDir)/Version.inc.tmp : Version.inc.in $(PROJ_SRC_DIR)/../../../VER $(ObjDir)/.dir
+$(ObjDir)/Version.inc.tmp : Version.inc.in Makefile $(LLVM_OBJ_ROOT)/Makefile.config $(ObjDir)/.dir
        $(Echo) "Updating Clang version info."
        $(Verb)sed -e "s#@CLANG_VERSION@#$(CLANG_VERSION)#g" \
                   -e "s#@CLANG_VERSION_MAJOR@#$(CLANG_VERSION_MAJOR)#g" \
index 28ead97c575265fc1c6591ee9e6d69fee964bcad..8a3e89e49a65974dd0608087f5b472f1acf0c322 100644 (file)
@@ -50,9 +50,9 @@
 // COMMON:#define __STDC__ 1
 // COMMON:#define __VERSION__
 // COMMON:#define __clang__ 1
-// COMMON:#define __clang_major__ 2
-// COMMON:#define __clang_minor__ 0
-// COMMON:#define __clang_patchlevel__ 0
+// COMMON:#define __clang_major__ {{[0-9]+}}
+// COMMON:#define __clang_minor__ {{[0-9]+}}
+// COMMON:#define __clang_patchlevel__ {{[0-9]+}}
 // COMMON:#define __clang_version__
 // COMMON:#define __llvm__ 1
 //