From: Vedant Kumar Date: Fri, 4 Aug 2017 04:08:23 +0000 (+0000) Subject: Revert "[coverage] Special-case calls to noreturn functions." X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7989554fd76314165d3318039e070463417ae940;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310019 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CoverageMappingGen.cpp b/lib/CodeGen/CoverageMappingGen.cpp index 27d98dc60d..07d16186b6 100644 --- a/lib/CodeGen/CoverageMappingGen.cpp +++ b/lib/CodeGen/CoverageMappingGen.cpp @@ -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); diff --git a/test/CoverageMapping/switch.cpp b/test/CoverageMapping/switch.cpp index d347e663d1..8b0cf7c2fb 100644 --- a/test/CoverageMapping/switch.cpp +++ b/test/CoverageMapping/switch.cpp @@ -97,16 +97,3 @@ int fallthrough(int i) { // CHECK-NEXT: File 0, [[@LINE]]:24 -> [[@LINE+12]]:2 = 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; - } -}