aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-profgen
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2022-12-18 17:46:01 +0000
committerDavid Blaikie <dblaikie@gmail.com>2022-12-18 17:46:01 +0000
commit09e79659bf2aeb0a5bd8ad6a9a40734b42caaf8a (patch)
treedeb221c64fef9fb08fe65f4aa98362c05ba31b44 /llvm/tools/llvm-profgen
parent8685445b3c9c6643432d24db6ffedddeb49ed8d2 (diff)
downloadllvm-09e79659bf2aeb0a5bd8ad6a9a40734b42caaf8a.zip
llvm-09e79659bf2aeb0a5bd8ad6a9a40734b42caaf8a.tar.gz
llvm-09e79659bf2aeb0a5bd8ad6a9a40734b42caaf8a.tar.bz2
llvm-profgen: Fix use of stats to be under LLVM_ENABLE_STATS
This caused a -Wunused-variable warning in a without-assert+with-stats build (because the stats were included but their use was not). Stat use is meant to be gated by LLVM_ENABLE_STATS which can be set independently of assertions.
Diffstat (limited to 'llvm/tools/llvm-profgen')
-rw-r--r--llvm/tools/llvm-profgen/MissingFrameInferrer.cpp2
-rw-r--r--llvm/tools/llvm-profgen/MissingFrameInferrer.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/llvm/tools/llvm-profgen/MissingFrameInferrer.cpp b/llvm/tools/llvm-profgen/MissingFrameInferrer.cpp
index 4a37945..4127fdc 100644
--- a/llvm/tools/llvm-profgen/MissingFrameInferrer.cpp
+++ b/llvm/tools/llvm-profgen/MissingFrameInferrer.cpp
@@ -269,7 +269,7 @@ bool MissingFrameInferrer::inferMissingFrames(
assert(UniquePath.back() == From && "broken path");
}
-#ifndef NDEBUG
+#if LLVM_ENABLE_STATS
if (NumPaths == 1) {
if (ReachableViaUniquePaths.insert({From, ToFRange->StartAddress}).second)
TailCallUniReachable++;
diff --git a/llvm/tools/llvm-profgen/MissingFrameInferrer.h b/llvm/tools/llvm-profgen/MissingFrameInferrer.h
index 3a50a64..4680a9a9 100644
--- a/llvm/tools/llvm-profgen/MissingFrameInferrer.h
+++ b/llvm/tools/llvm-profgen/MissingFrameInferrer.h
@@ -12,6 +12,7 @@
#include "PerfReader.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/Statistic.h"
#include <unordered_map>
#include <unordered_set>
@@ -103,7 +104,7 @@ private:
uint32_t CurSearchingDepth = 0;
-#ifndef NDEBUG
+#if LLVM_ENABLE_STATS
DenseSet<std::pair<uint64_t, uint64_t>> ReachableViaUniquePaths;
DenseSet<std::pair<uint64_t, uint64_t>> Unreachables;
DenseSet<std::pair<uint64_t, uint64_t>> ReachableViaMultiPaths;