https://github.com/Sockke created 
https://github.com/llvm/llvm-project/pull/146666

Should the backend's DwarfVersion be initialized like other options? 
Previously, -gdwarf-xxx did not take effect in the backend—was there a specific 
reason for this?

>From 1a402b04e60ef3c74c8a3a7ecb3ef0439415d6ec Mon Sep 17 00:00:00 2001
From: Sockke <liuke.ge...@bytedance.com>
Date: Wed, 2 Jul 2025 16:54:29 +0800
Subject: [PATCH] Init DwarfVersion of MCOptions like the other.

---
 clang/lib/CodeGen/BackendUtil.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clang/lib/CodeGen/BackendUtil.cpp 
b/clang/lib/CodeGen/BackendUtil.cpp
index 1c92ea45c7458..9cee6281a43f6 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -486,6 +486,7 @@ static bool initTargetOptions(const CompilerInstance &CI,
     break;
   }
 
+  Options.MCOptions.DwarfVersion = CodeGenOpts.DwarfVersion;
   Options.MCOptions.SplitDwarfFile = CodeGenOpts.SplitDwarfFile;
   Options.MCOptions.EmitDwarfUnwind = CodeGenOpts.getEmitDwarfUnwind();
   Options.MCOptions.EmitCompactUnwindNonCanonical =

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to