File tree 1 file changed +6
-2
lines changed
compiler/rustc_llvm/llvm-wrapper
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -740,14 +740,18 @@ LLVMRustOptimize(
740
740
741
741
if (InstrumentCoverage) {
742
742
PipelineStartEPCallbacks.push_back (
743
- [InstrProfileOutput](ModulePassManager &MPM, OptimizationLevel Level) {
743
+ [InstrProfileOutput, TargetTriple ](ModulePassManager &MPM, OptimizationLevel Level) {
744
744
InstrProfOptions Options;
745
745
if (InstrProfileOutput) {
746
746
Options.InstrProfileOutput = InstrProfileOutput;
747
747
}
748
748
// cargo run tests in multhreading mode by default
749
749
// so use atomics for coverage counters
750
- Options.Atomic = true ;
750
+ // This only works on platforms that support 64 bit atomic operations
751
+ // So, don't do it on 32 bit platforms
752
+ if (TargetTriple.isArch64Bit ()){
753
+ Options.Atomic = true ;
754
+ }
751
755
MPM.addPass (InstrProfiling (Options, false ));
752
756
}
753
757
);
You can’t perform that action at this time.
0 commit comments