[clang] 9bb9b73 - Remove HAVE_VCS_VERSION_INC, not needed

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 29 13:09:25 PDT 2020


Author: Marcel Hlopko
Date: 2020-10-29T13:09:05-07:00
New Revision: 9bb9b737c5573cf3850230bc4db8dac7be0e1e85

URL: https://github.com/llvm/llvm-project/commit/9bb9b737c5573cf3850230bc4db8dac7be0e1e85
DIFF: https://github.com/llvm/llvm-project/commit/9bb9b737c5573cf3850230bc4db8dac7be0e1e85.diff

LOG: Remove HAVE_VCS_VERSION_INC, not needed

This preprocessor define was meant to be used to conditionally include VCSVersion.inc. However, the define was always set, and it was the content of the header that was conditionally generated. Therefore HAVE_VCS_VERSION_INC should be cleaned up.

Reviewed By: gribozavr2, MaskRay

Differential Revision: https://reviews.llvm.org/D84623

Added: 
    

Modified: 
    clang/lib/Basic/CMakeLists.txt
    clang/lib/Basic/Version.cpp
    lld/Common/CMakeLists.txt
    lld/Common/Version.cpp
    lldb/source/CMakeLists.txt
    lldb/source/lldb.cpp
    llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn
    llvm/utils/gn/secondary/lld/Common/BUILD.gn

Removed: 
    


################################################################################
diff  --git a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt
index dfbe74a3f9f1..d259b951f2c2 100644
--- a/clang/lib/Basic/CMakeLists.txt
+++ b/clang/lib/Basic/CMakeLists.txt
@@ -33,9 +33,6 @@ set_source_files_properties("${version_inc}"
   PROPERTIES GENERATED TRUE
              HEADER_FILE_ONLY TRUE)
 
-set_property(SOURCE Version.cpp APPEND PROPERTY
-             COMPILE_DEFINITIONS "HAVE_VCS_VERSION_INC")
-
 add_clang_library(clangBasic
   Attributes.cpp
   Builtins.cpp

diff  --git a/clang/lib/Basic/Version.cpp b/clang/lib/Basic/Version.cpp
index 286107cab9d7..af3118b0f6da 100644
--- a/clang/lib/Basic/Version.cpp
+++ b/clang/lib/Basic/Version.cpp
@@ -17,9 +17,7 @@
 #include <cstdlib>
 #include <cstring>
 
-#ifdef HAVE_VCS_VERSION_INC
 #include "VCSVersion.inc"
-#endif
 
 namespace clang {
 

diff  --git a/lld/Common/CMakeLists.txt b/lld/Common/CMakeLists.txt
index bfa4f7b8ee58..0437d5afb8eb 100644
--- a/lld/Common/CMakeLists.txt
+++ b/lld/Common/CMakeLists.txt
@@ -26,9 +26,6 @@ set_source_files_properties("${version_inc}"
   PROPERTIES GENERATED TRUE
   HEADER_FILE_ONLY TRUE)
 
-set_property(SOURCE Version.cpp APPEND PROPERTY
-  COMPILE_DEFINITIONS "HAVE_VCS_VERSION_INC")
-
 add_lld_library(lldCommon
   Args.cpp
   DWARF.cpp

diff  --git a/lld/Common/Version.cpp b/lld/Common/Version.cpp
index cd9fcd4f4059..f3768091cd0e 100644
--- a/lld/Common/Version.cpp
+++ b/lld/Common/Version.cpp
@@ -12,9 +12,7 @@
 
 #include "lld/Common/Version.h"
 
-#ifdef HAVE_VCS_VERSION_INC
 #include "VCSVersion.inc"
-#endif
 
 // Returns a version string, e.g.:
 // lld 9.0.0 (https://github.com/llvm/llvm-project.git 9efdd7ac5e914d3c9fa1ef)

diff  --git a/lldb/source/CMakeLists.txt b/lldb/source/CMakeLists.txt
index 6dbdec5ec008..56ea8342be4e 100644
--- a/lldb/source/CMakeLists.txt
+++ b/lldb/source/CMakeLists.txt
@@ -26,9 +26,6 @@ set_source_files_properties("${version_inc}"
   PROPERTIES GENERATED TRUE
              HEADER_FILE_ONLY TRUE)
 
-set_property(SOURCE lldb.cpp APPEND PROPERTY
-             COMPILE_DEFINITIONS "HAVE_VCS_VERSION_INC")
-
 list(APPEND lldbBase_SOURCES ${version_inc})
 
 if(LLDB_VERSION_STRING)

diff  --git a/lldb/source/lldb.cpp b/lldb/source/lldb.cpp
index 4d4c636a4f9c..10fc2d7cf556 100644
--- a/lldb/source/lldb.cpp
+++ b/lldb/source/lldb.cpp
@@ -13,9 +13,7 @@ using namespace lldb_private;
 
 #include "clang/Basic/Version.h"
 
-#ifdef HAVE_VCS_VERSION_INC
 #include "VCSVersion.inc"
-#endif
 
 static const char *GetLLDBRevision() {
 #ifdef LLDB_REVISION

diff  --git a/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn b/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn
index 43767f15e1a1..2fe572ada231 100644
--- a/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn
@@ -103,5 +103,4 @@ static_library("Basic") {
     "XRayInstr.cpp",
     "XRayLists.cpp",
   ]
-  defines = [ "HAVE_VCS_VERSION_INC" ]  # For Version.cpp
 }

diff  --git a/llvm/utils/gn/secondary/lld/Common/BUILD.gn b/llvm/utils/gn/secondary/lld/Common/BUILD.gn
index 125cad30a32e..d02d950e88d2 100644
--- a/llvm/utils/gn/secondary/lld/Common/BUILD.gn
+++ b/llvm/utils/gn/secondary/lld/Common/BUILD.gn
@@ -42,5 +42,4 @@ static_library("Common") {
     "Timer.cpp",
     "Version.cpp",
   ]
-  defines = [ "HAVE_VCS_VERSION_INC" ]  # For Version.cpp
 }


        


More information about the cfe-commits mailing list