Skip to content

Commit 7e5682e

Browse files
committed
[ADT] Make TrackingStatistic's ctor constexpr
This lets clang diagnose unused statistics, so remove them.
1 parent dca5361 commit 7e5682e

File tree

4 files changed

+2
-7
lines changed

4 files changed

+2
-7
lines changed

llvm/include/llvm/ADT/Statistic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ class TrackingStatistic {
5555
std::atomic<unsigned> Value;
5656
std::atomic<bool> Initialized;
5757

58-
TrackingStatistic(const char *DebugType, const char *Name, const char *Desc)
58+
constexpr TrackingStatistic(const char *DebugType, const char *Name,
59+
const char *Desc)
5960
: DebugType(DebugType), Name(Name), Desc(Desc), Value(0),
6061
Initialized(false) {}
6162

llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,6 @@ using namespace llvm;
201201

202202
#define DEBUG_TYPE "livedebugvalues"
203203

204-
STATISTIC(NumInserted, "Number of DBG_VALUE instructions inserted");
205-
STATISTIC(NumRemoved, "Number of DBG_VALUE instructions removed");
206-
207204
// Act more like the VarLoc implementation, by propagating some locations too
208205
// far and ignoring some transfers.
209206
static cl::opt<bool> EmulateOldLDV("emulate-old-livedebugvalues", cl::Hidden,

llvm/lib/Transforms/IPO/Attributor.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ STATISTIC(NumAttributesValidFixpoint,
6363
"Number of abstract attributes in a valid fixpoint state");
6464
STATISTIC(NumAttributesManifested,
6565
"Number of abstract attributes manifested in IR");
66-
STATISTIC(NumAttributesFixedDueToRequiredDependences,
67-
"Number of abstract attributes fixed due to required dependences");
6866

6967
// TODO: Determine a good default value.
7068
//

llvm/lib/Transforms/Utils/BuildLibCalls.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ STATISTIC(NumSExtArg, "Number of arguments inferred as signext");
4444
STATISTIC(NumReadOnlyArg, "Number of arguments inferred as readonly");
4545
STATISTIC(NumNoAlias, "Number of function returns inferred as noalias");
4646
STATISTIC(NumNoUndef, "Number of function returns inferred as noundef returns");
47-
STATISTIC(NumNonNull, "Number of function returns inferred as nonnull returns");
4847
STATISTIC(NumReturnedArg, "Number of arguments inferred as returned");
4948
STATISTIC(NumWillReturn, "Number of functions inferred as willreturn");
5049

0 commit comments

Comments
 (0)