about summary refs log tree commit diff
path: root/src/librustc_session
diff options
context:
space:
mode:
authorRich Kadel <richkadel@google.com>2020-06-03 21:19:34 -0700
committerRich Kadel <richkadel@google.com>2020-06-15 16:50:10 -0700
commit5068ae1ca05b2be0c2a98206a58d894aa620b312 (patch)
tree258a6eafab4eeab5d40cf776cc09d9799276787d /src/librustc_session
parent395256a5dd74ccef046083d6e025a6d046379040 (diff)
[WIP] injects llvm intrinsic instrprof.increment for coverage reports
This initial version only injects counters at the top of each function.
Rust Coverage will require injecting additional counters at each
conditional code branch.
Diffstat (limited to 'src/librustc_session')
-rw-r--r--src/librustc_session/options.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustc_session/options.rs b/src/librustc_session/options.rs
index d22c6ec9d7d..599ce595e13 100644
--- a/src/librustc_session/options.rs
+++ b/src/librustc_session/options.rs
@@ -876,6 +876,9 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
         "fix undefined behavior when a thread doesn't eventually make progress \
         (such as entering an empty infinite loop) by inserting llvm.sideeffect \
         (default: no)"),
+    instrument_coverage: bool = (false, parse_bool, [TRACKED],
+        "instrument the generated code with LLVM code region counters for \
+        generating coverage reports (default: no)"),
     instrument_mcount: bool = (false, parse_bool, [TRACKED],
         "insert function instrument code for mcount-based tracing (default: no)"),
     keep_hygiene_data: bool = (false, parse_bool, [UNTRACKED],