[llvm] 9e13d64 - [gold] Enable `MCTargetOptions::AsmVerbose` along with `emit-asm` (#71606)

via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 10 12:11:17 PST 2023


Author: Min-Yih Hsu
Date: 2023-11-10T12:11:13-08:00
New Revision: 9e13d644324335b0992e7adae1c285c1eb27490d

URL: https://github.com/llvm/llvm-project/commit/9e13d644324335b0992e7adae1c285c1eb27490d
DIFF: https://github.com/llvm/llvm-project/commit/9e13d644324335b0992e7adae1c285c1eb27490d.diff

LOG: [gold] Enable `MCTargetOptions::AsmVerbose` along with `emit-asm` (#71606)

Print comments into assembly output if we're using `emit-asm`.

Added: 
    

Modified: 
    llvm/test/tools/gold/X86/emit-asm.ll
    llvm/tools/gold/gold-plugin.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/gold/X86/emit-asm.ll b/llvm/test/tools/gold/X86/emit-asm.ll
index 40ff71f6143e2a3..4e76f45dcf2d60b 100644
--- a/llvm/test/tools/gold/X86/emit-asm.ll
+++ b/llvm/test/tools/gold/X86/emit-asm.ll
@@ -23,3 +23,6 @@ define void @f1() {
 define void @f2() {
   ret void
 }
+
+; Check if comments are emitted into assembly.
+; CHECK: -- End function

diff  --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
index d9e5983a4bacd63..257832ab7671c45 100644
--- a/llvm/tools/gold/gold-plugin.cpp
+++ b/llvm/tools/gold/gold-plugin.cpp
@@ -925,6 +925,7 @@ static std::unique_ptr<LTO> createLTO(IndexWriteCallback OnIndexWrite,
     break;
   case options::OT_ASM_ONLY:
     Conf.CGFileType = CodeGenFileType::AssemblyFile;
+    Conf.Options.MCOptions.AsmVerbose = true;
     break;
   }
 


        


More information about the llvm-commits mailing list