summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-06-25 23:34:47 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-06-25 23:34:47 +0000
commitc4b8e923a18ba56ecd76de5dfd7edf7f307123e3 (patch)
treec8056105066b6241eb78f125e209a55807c205b0
parent4d912b24b393fe6b7422e5502f3a330cbdc5c6b7 (diff)
clang: Derive version name from LLVM unless specified explicitly. This means
clang is now clang 2.8. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106914 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--CMakeLists.txt10
-rw-r--r--VER1
-rw-r--r--include/clang/Basic/Makefile8
-rw-r--r--test/Preprocessor/init.c6
4 files changed, 11 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6154fdb66f..1ba2a622d4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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
index cd5ac039d6..0000000000
--- a/VER
+++ /dev/null
@@ -1 +0,0 @@
-2.0
diff --git a/include/clang/Basic/Makefile b/include/clang/Basic/Makefile
index 8bbc807a09..7db3e2982a 100644
--- a/include/clang/Basic/Makefile
+++ b/include/clang/Basic/Makefile
@@ -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" \
diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c
index 28ead97c57..8a3e89e49a 100644
--- a/test/Preprocessor/init.c
+++ b/test/Preprocessor/init.c
@@ -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
//