about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorridwanabdillahi <91507758+ridwanabdillahi@users.noreply.github.com>2022-08-10 09:16:20 -0700
committerridwanabdillahi <91507758+ridwanabdillahi@users.noreply.github.com>2022-08-11 16:04:08 -0700
commit100882296e065526cfd055380e14334738da4158 (patch)
tree46a23fbb6d11ff7b1a113c77880bd5d30b53ff21 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent20ffea6938b5839c390252e07940b99e3b6a889a (diff)
downloadrust-100882296e065526cfd055380e14334738da4158.tar.gz
rust-100882296e065526cfd055380e14334738da4158.zip
Add support for generating unique *.profraw files by default when using the `-C instrument-coverage` flag.
Respond to PR comments.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
index 0a6bd49992d..bdf2a852507 100644
--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
@@ -822,7 +822,8 @@ LLVMRustOptimizeWithNewPassManager(
     bool DisableSimplifyLibCalls, bool EmitLifetimeMarkers,
     LLVMRustSanitizerOptions *SanitizerOptions,
     const char *PGOGenPath, const char *PGOUsePath,
-    bool InstrumentCoverage, bool InstrumentGCOV,
+    bool InstrumentCoverage, const char *InstrProfileOutput,
+    bool InstrumentGCOV,
     const char *PGOSampleUsePath, bool DebugInfoForProfiling,
     void* LlvmSelfProfiler,
     LLVMRustSelfProfileBeforePassCallback BeforePassCallback,
@@ -922,8 +923,11 @@ LLVMRustOptimizeWithNewPassManager(
 
   if (InstrumentCoverage) {
     PipelineStartEPCallbacks.push_back(
-      [](ModulePassManager &MPM, OptimizationLevel Level) {
+      [InstrProfileOutput](ModulePassManager &MPM, OptimizationLevel Level) {
         InstrProfOptions Options;
+        if (InstrProfileOutput) {
+          Options.InstrProfileOutput = InstrProfileOutput;
+        }
         MPM.addPass(InstrProfiling(Options, false));
       }
     );