[sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, compiler-rt part
authorKostya Serebryany <kcc@google.com>
Wed, 17 Dec 2014 21:51:07 +0000 (21:51 +0000)
committerKostya Serebryany <kcc@google.com>
Wed, 17 Dec 2014 21:51:07 +0000 (21:51 +0000)
llvm-svn: 224464

compiler-rt/lib/lsan/lsan.cc

index 1598fca..9a3314f 100644 (file)
@@ -52,6 +52,12 @@ extern "C" void __lsan_init() {
 
   if (common_flags()->detect_leaks && common_flags()->leak_check_at_exit)
     Atexit(DoLeakCheck);
+
+  if (common_flags()->coverage) {
+    __sanitizer_cov_init();
+    Atexit(__sanitizer_cov_dump);
+  }
+
   lsan_inited = true;
   lsan_init_is_running = false;
 }