diff options
author | Jacek Caban <jacek@codeweavers.com> | 2025-06-13 13:48:29 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-13 22:48:29 +0200 |
commit | be5c96bfac328fed548c532bbe1710fe23460a85 (patch) | |
tree | 70eaf2803d93bde06770cd2434d8d7067b04f4f0 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 60d000496b5485c89c51e64b2b339210d48263be (diff) | |
download | llvm-be5c96bfac328fed548c532bbe1710fe23460a85.zip llvm-be5c96bfac328fed548c532bbe1710fe23460a85.tar.gz llvm-be5c96bfac328fed548c532bbe1710fe23460a85.tar.bz2 |
[CodeGen][COFF] Always emit CodeView compiler info on Windows targets (#142970)
MSVC always emits minimal CodeView metadata with compiler information,
even when debug info is otherwise disabled. Other tools may rely on this
metadata being present. For example, linkers use it to determine whether
hotpatching is enabled for the object file.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 451792d..c036902 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -414,6 +414,11 @@ CodeGenModule::CodeGenModule(ASTContext &C, CodeGenOpts.CoverageNotesFile.size() || CodeGenOpts.CoverageDataFile.size()) DebugInfo.reset(new CGDebugInfo(*this)); + else if (getTriple().isOSWindows()) + // On Windows targets, we want to emit compiler info even if debug info is + // otherwise disabled. Use a temporary CGDebugInfo instance to emit only + // basic compiler metadata. + CGDebugInfo(*this); Block.GlobalUniqueCount = 0; @@ -1051,7 +1056,7 @@ void CodeGenModule::Release() { "StrictVTablePointersRequirement", llvm::MDNode::get(VMContext, Ops)); } - if (getModuleDebugInfo()) + if (getModuleDebugInfo() || getTriple().isOSWindows()) // We support a single version in the linked module. The LLVM // parser will drop debug info with a different version number // (and warn about it, too). |