r310019 - Revert "[coverage] Special-case calls to noreturn functions."

Vedant Kumar via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 3 21:08:23 PDT 2017


Author: vedantk
Date: Thu Aug  3 21:08:23 2017
New Revision: 310019

URL: http://llvm.org/viewvc/llvm-project?rev=310019&view=rev
Log:
Revert "[coverage] Special-case calls to noreturn functions."

This reverts commit r309995. It looks like it's responsible for breaking
the stage2 coverage build:

http://green.lab.llvm.org/green/job/clang-stage2-coverage-R_build/1402

The cfe-commits discussion re: r309995 has more context.

Modified:
    cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp
    cfe/trunk/test/CoverageMapping/switch.cpp

Modified: cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp?rev=310019&r1=310018&r2=310019&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp (original)
+++ cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp Thu Aug  3 21:08:23 2017
@@ -797,18 +797,6 @@ struct CounterCoverageMappingBuilder
     terminateRegion(S);
   }
 
-  void VisitCallExpr(const CallExpr *E) {
-    extendRegion(E);
-    for (const Stmt *Child : E->children())
-      this->Visit(Child);
-
-    // Terminate the region when we hit a noreturn function.
-    // (This is helpful dealing with switch statements.)
-    QualType CalleeType = E->getCallee()->getType();
-    if (getFunctionExtInfo(*CalleeType).getNoReturn())
-      terminateRegion(E);
-  }
-
   void VisitWhileStmt(const WhileStmt *S) {
     extendRegion(S);
 

Modified: cfe/trunk/test/CoverageMapping/switch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CoverageMapping/switch.cpp?rev=310019&r1=310018&r2=310019&view=diff
==============================================================================
--- cfe/trunk/test/CoverageMapping/switch.cpp (original)
+++ cfe/trunk/test/CoverageMapping/switch.cpp Thu Aug  3 21:08:23 2017
@@ -97,16 +97,3 @@ int fallthrough(int i) { // CHECK-NEXT:
     break;
   }
 }
-
-void abort(void) __attribute((noreturn));
-                   // CHECK: noret
-int noret(int x) { // CHECK-NEXT: File 0, [[@LINE]]:18 -> [[@LINE+9]]:2
-  switch (x) {
-  default:         // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:12
-    abort();
-  case 1:         // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:13
-    return 5;
-  case 2:         // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:14
-    return 10;
-  }
-}




More information about the cfe-commits mailing list