summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2024-06-21 14:01:15 -0500
committerTrevor Gross <tmgross@umich.edu>2024-07-02 21:41:59 -0400
commit64a3bd84d83a6138b6e7db82a53199246f292e53 (patch)
treedfcd3fb1a474a3edc7acbb6759e3aa17f1d0d604 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent6292b2af620dbd771ebb687c3a93c69ba8f97268 (diff)
downloadrust-64a3bd84d83a6138b6e7db82a53199246f292e53.tar.gz
rust-64a3bd84d83a6138b6e7db82a53199246f292e53.zip
Always preserve user-written comments in assembly
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
index c4cfc0b6dc6..a868c56c4e6 100644
--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
@@ -436,7 +436,8 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
   Options.FunctionSections = FunctionSections;
   Options.UniqueSectionNames = UniqueSectionNames;
   Options.MCOptions.AsmVerbose = AsmComments;
-  Options.MCOptions.PreserveAsmComments = AsmComments;
+  // Always preserve comments that were written by the user
+  Options.MCOptions.PreserveAsmComments = true;
   Options.MCOptions.ABIName = ABIStr;
   if (SplitDwarfFile) {
     Options.MCOptions.SplitDwarfFile = SplitDwarfFile;