Author: adrian Date: Mon May 19 18:40:06 2014 New Revision: 209182 URL: http://llvm.org/viewvc/llvm-project?rev=209182&view=rev Log: Demote the "Debug Info Version" module flag to llvm::Module::Warning behavior on mismatch. The AutoUpgrader will drop incompatible debug info any way and also emit a warning diagnostic for it.
rdar://problem/16926122 Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp cfe/trunk/test/CodeGen/debug-info-version.c Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=209182&r1=209181&r2=209182&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original) +++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Mon May 19 18:40:06 2014 @@ -301,12 +301,10 @@ void CodeGenModule::Release() { getModule().addModuleFlag(llvm::Module::Warning, "Dwarf Version", CodeGenOpts.DwarfVersion); if (DebugInfo) - // We support a single version in the linked module: error out when - // modules do not have the same version. We are going to implement dropping - // debug info when the version number is not up-to-date. Once that is - // done, the bitcode linker is not going to see modules with different - // version numbers. - getModule().addModuleFlag(llvm::Module::Error, "Debug Info Version", + // 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). + getModule().addModuleFlag(llvm::Module::Warning, "Debug Info Version", llvm::DEBUG_METADATA_VERSION); SimplifyPersonality(); Modified: cfe/trunk/test/CodeGen/debug-info-version.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/debug-info-version.c?rev=209182&r1=209181&r2=209182&view=diff ============================================================================== --- cfe/trunk/test/CodeGen/debug-info-version.c (original) +++ cfe/trunk/test/CodeGen/debug-info-version.c Mon May 19 18:40:06 2014 @@ -4,5 +4,5 @@ int main (void) { return 0; } -// CHECK: metadata !{i32 1, metadata !"Debug Info Version", i32 1} +// CHECK: metadata !{i32 2, metadata !"Debug Info Version", i32 1} // NO_DEBUG-NOT: metadata !"Debug Info Version" _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits