[llvm] 83d1976 - [gn build] Add gn flag to force enable stats

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 28 14:33:43 PDT 2023


Author: Arthur Eubanks
Date: 2023-04-28T14:33:23-07:00
New Revision: 83d1976c70d7509d510e736ff42143b27eaedcac

URL: https://github.com/llvm/llvm-project/commit/83d1976c70d7509d510e736ff42143b27eaedcac
DIFF: https://github.com/llvm/llvm-project/commit/83d1976c70d7509d510e736ff42143b27eaedcac.diff

LOG: [gn build] Add gn flag to force enable stats

Added: 
    

Modified: 
    llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
index 393744f2d6c53..07fdcfa908677 100644
--- a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
@@ -49,6 +49,9 @@ declare_args() {
   # Iterate unordered llvm containers in reverse.
   llvm_enable_reverse_iteration = false
 
+  # Force enable statistics.
+  llvm_force_enable_stats = false
+
   # glibc is at least 2.33 which has mallinfo2.
   # TODO: remove this once nobody using the gn build is building against an old glibc.
   llvm_have_mallinfo2 = current_os == "linux"
@@ -321,7 +324,6 @@ write_cmake_config("llvm-config") {
     "LLVM_ENABLE_DUMP=",
     "LLVM_ENABLE_HTTPLIB=",
     "LLVM_ENABLE_ZSTD=",
-    "LLVM_FORCE_ENABLE_STATS=",
     "LLVM_FORCE_USE_OLD_TOOLCHAIN=",
     "LLVM_HAS_ATOMICS=1",
     "LLVM_HAVE_TFLITE=",
@@ -403,6 +405,12 @@ write_cmake_config("llvm-config") {
   } else {
     values += [ "LLVM_ENABLE_CURL=" ]
   }
+
+  if (llvm_force_enable_stats) {
+    values += [ "LLVM_FORCE_ENABLE_STATS=1" ]
+  } else {
+    values += [ "LLVM_FORCE_ENABLE_STATS=" ]
+  }
 }
 
 ##############################################################################


        


More information about the llvm-commits mailing list