[PATCH] D25985: [analyzer] Export coverage information from the analyzer.

Anna Zaks via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 26 14:01:30 PDT 2016


zaks.anna added a comment.

Please, add multi-file tests and tests where a line is covered more than once.



================
Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:262
+
+static void dumpCoverageInfo(llvm::SmallVectorImpl<char> &Path,
+                             SourceManager &SM) {
----------------
Can this be a debug checker?


================
Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:274
+    if (Invalid)
+      continue;
+    std::ofstream OutFile(FilePath.c_str());
----------------
Would it be better to break if the buffer is invalid?
Should this be hoisted out of the loop?


================
Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:277
+    if (!OutFile) {
+      llvm::errs() << FilePath << " Fuck!\n";
+      continue;
----------------
Please, come up with constructive error messages.


================
Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:281
+    llvm::raw_os_ostream Out(OutFile);
+    Out << "-:0:Source:" << FE->getName() << '\n';
+    Out << "-:0:Runs:1\n";
----------------
What does '-' mean in this case? Why is it needed?


================
Comment at: test/Analysis/record-coverage.cpp.expected:2
+// CHECK:      -:4:int main() {
+// CHECK-NEXT: -:5:  int i = 2;
+// CHECK-NEXT: 1:6:  ++i;
----------------
Does '-' mean not covered? If so, why the first 2 statements are not covered?


https://reviews.llvm.org/D25985





More information about the cfe-commits mailing list