File tree Expand file tree Collapse file tree
compiler/rustc_llvm/llvm-wrapper Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -740,14 +740,18 @@ LLVMRustOptimize(
740740
741741 if (InstrumentCoverage) {
742742 PipelineStartEPCallbacks.push_back (
743- [InstrProfileOutput](ModulePassManager &MPM, OptimizationLevel Level) {
743+ [InstrProfileOutput, TargetTriple ](ModulePassManager &MPM, OptimizationLevel Level) {
744744 InstrProfOptions Options;
745745 if (InstrProfileOutput) {
746746 Options.InstrProfileOutput = InstrProfileOutput;
747747 }
748748 // cargo run tests in multhreading mode by default
749749 // 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+ }
751755 MPM.addPass (InstrProfiling (Options, false ));
752756 }
753757 );
You can’t perform that action at this time.
0 commit comments