From 9691f7fa356143011dc0507238368ac3ed5dadf6 Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Wed, 19 Jun 2013 01:46:49 +0000 Subject: Debug Info: support for gdwarf-2 gdwarf-3 gdwarf-4 These options will add a module flag with name "Dwarf Version". The behavior flag is currently set to Warning, so when two values disagree, a warning will be emitted. llvm-svn: 184276 --- clang/lib/CodeGen/CodeGenModule.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index d76fee5..18c56b0 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -190,6 +190,11 @@ void CodeGenModule::Release() { (Context.getLangOpts().Modules || !LinkerOptionsMetadata.empty())) { EmitModuleLinkOptions(); } + 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); SimplifyPersonality(); -- cgit v1.1