]> granicus.if.org Git - clang/commitdiff
InstrProf: Promote this assert to a report_fatal_error
authorJustin Bogner <mail@justinbogner.com>
Fri, 17 Jul 2015 23:31:21 +0000 (23:31 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 17 Jul 2015 23:31:21 +0000 (23:31 +0000)
If this assert does fire, the no-asserts behaviour is an infinite
loop. It's better to crash in this case so we get a crash report and
stop wasting the user's cpu cycles.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242591 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CoverageMappingGen.cpp

index eca91590e60204c78a32339be9bc550e568d3290..63ad56bea2d1a7d5b9ab89e35d199157a004d334 100644 (file)
@@ -413,8 +413,8 @@ struct CounterCoverageMappingBuilder
           SourceRegions.emplace_back(Region.getCounter(), NestedLoc, EndLoc);
 
           EndLoc = getPreciseTokenLocEnd(getIncludeOrExpansionLoc(EndLoc));
-          assert(!EndLoc.isInvalid() &&
-                 "File exit was not handled before popRegions");
+          if (EndLoc.isInvalid())
+            llvm::report_fatal_error("File exit not handled before popRegions");
         }
         Region.setEndLoc(EndLoc);