r242591 - InstrProf: Promote this assert to a report_fatal_error

Justin Bogner mail at justinbogner.com
Fri Jul 17 16:31:21 PDT 2015


Author: bogner
Date: Fri Jul 17 18:31:21 2015
New Revision: 242591

URL: http://llvm.org/viewvc/llvm-project?rev=242591&view=rev
Log:
InstrProf: Promote this assert to a report_fatal_error

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.

Modified:
    cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp

Modified: cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp?rev=242591&r1=242590&r2=242591&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp (original)
+++ cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp Fri Jul 17 18:31:21 2015
@@ -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);
 





More information about the cfe-commits mailing list