For statistics that are only used in functions declared in !NDEBUG, wrap the
authorNick Lewycky <nicholas@mxc.ca>
Tue, 26 Oct 2010 00:51:57 +0000 (00:51 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Tue, 26 Oct 2010 00:51:57 +0000 (00:51 +0000)
declarations in !NDEBUG to avoid -Wunused-variable warnings. Patch by
Matt Beaumont-Gay!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117345 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index 69cdafc1b10fe4f0ed39e1493e16a2b144092d36..221e5183434508a47090aee85fe9f01d797c7872 100644 (file)
@@ -53,7 +53,9 @@ static cl::opt<bool> UnknownLocations("use-unknown-locations", cl::Hidden,
      cl::desc("Make an absense of debug location information explicit."),
      cl::init(false));
 
+#ifndef NDEBUG
 STATISTIC(BlocksWithoutLineNo, "Number of blocks without any line number");
+#endif
 
 namespace {
   const char *DWARFGroupName = "DWARF Emission";
index 7b7ea2b265a5577e7cef6ace19fc455198f4850d..26a672c03413ecec839993f40a939b51c2c9c360 100644 (file)
@@ -56,10 +56,13 @@ STATISTIC(NumFastIselFailures, "Number of instructions fast isel failed on");
 STATISTIC(NumFastIselBlocks, "Number of blocks selected entirely by fast isel");
 STATISTIC(NumDAGBlocks, "Number of blocks selected using DAG");
 STATISTIC(NumDAGIselRetries,"Number of times dag isel has to try another path");
+
+#ifndef NDEBUG
 STATISTIC(NumBBWithOutOfOrderLineInfo, 
           "Number of blocks with out of order line number info");
 STATISTIC(NumMBBWithOutOfOrderLineInfo, 
           "Number of machine blocks with out of order line number info");
+#endif
 
 static cl::opt<bool>
 EnableFastISelVerbose("fast-isel-verbose", cl::Hidden,