[asan] add statistic counter to dynamic alloca instrumentation
authorKostya Serebryany <kcc@google.com>
Fri, 21 Nov 2014 21:25:18 +0000 (21:25 +0000)
committerKostya Serebryany <kcc@google.com>
Fri, 21 Nov 2014 21:25:18 +0000 (21:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222573 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/AddressSanitizer.cpp

index e095ed5f03398ee13a5282bcaae8c875d89d976b..414fb65d6636c15382ad2ed9f65e5f6468bb10c0 100644 (file)
@@ -209,6 +209,8 @@ static cl::opt<int> ClDebugMax("asan-debug-max", cl::desc("Debug man inst"),
 
 STATISTIC(NumInstrumentedReads, "Number of instrumented reads");
 STATISTIC(NumInstrumentedWrites, "Number of instrumented writes");
+STATISTIC(NumInstrumentedDynamicAllocas,
+          "Number of instrumented dynamic allocas");
 STATISTIC(NumOptimizedAccessesToGlobalArray,
           "Number of optimized accesses to global arrays");
 STATISTIC(NumOptimizedAccessesToGlobalVar,
@@ -1942,4 +1944,5 @@ void FunctionStackPoisoner::handleDynamicAllocaCall(
   // We are done. Erase old alloca and store left, partial and right redzones
   // shadow addresses for future unpoisoning.
   AI->eraseFromParent();
+  NumInstrumentedDynamicAllocas++;
 }