Add -gcodeview and -gdwarf to control which type Clang emits

Summary:
By default, 'clang' emits dwarf and 'clang-cl' emits codeview.  You can
force emission of one or both by passing -gcodeview and -gdwarf to
either driver.

Reviewers: dblaikie, hans

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D11742

llvm-svn: 244097
This commit is contained in:
Reid Kleckner
2015-08-05 18:51:13 +00:00
parent b2fda0d95c
commit 124955aade
8 changed files with 68 additions and 10 deletions

View File

@@ -369,11 +369,16 @@ void CodeGenModule::Release() {
(Context.getLangOpts().Modules || !LinkerOptionsMetadata.empty())) {
EmitModuleLinkOptions();
}
if (CodeGenOpts.DwarfVersion)
if (CodeGenOpts.DwarfVersion) {
// We actually want the latest version when there are conflicts.
// We can change from Warning to Latest if such mode is supported.
getModule().addModuleFlag(llvm::Module::Warning, "Dwarf Version",
CodeGenOpts.DwarfVersion);
}
if (CodeGenOpts.EmitCodeView) {
// Indicate that we want CodeView in the metadata.
getModule().addModuleFlag(llvm::Module::Warning, "CodeView", 1);
}
if (DebugInfo)
// We support a single version in the linked module. The LLVM
// parser will drop debug info with a different version number