[PATCH] D14356: Sancov in C++.

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 10 13:38:03 PST 2015


kcc added inline comments.

================
Comment at: lib/sanitizer_common/sancov.cc:164
@@ +163,3 @@
+    return std::unique_ptr<CoverageData>(new CoverageData(std::move(Addrs)));
+  }
+
----------------
First, speed is not important here, code simplicity is much more so. 

Second, I actually think it might be faster in case you need to merge lots of coverage files.
Your current code reserves vector for the total combined size of all the files. 
Using set you will only need memory proportional to the result (yes, with a large multiplicative constant). 

================
Comment at: lib/sanitizer_common/sancov.cc:218
@@ +217,3 @@
+        FileLoc Loc = { FileName.str(), Line };
+        Fns[Loc] = FunctionName;
+      }
----------------
Sometimes you may need to pass this further to some scripts and there is no way to un-demangle function names back. 
Sometimes the fully demangled names are too long and we need "short names"


http://reviews.llvm.org/D14356





More information about the llvm-commits mailing list