From 4b7f23d885d87274441a108336b7b328284addf4 Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Fri, 22 Nov 2013 19:42:45 +0000 Subject: Debug Info: add a "Debug Info Version" module flag to output the current debug info version number. Will error out when modules have different version numbers. llvm-svn: 195495 --- 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 4d51fb02..8240f8d 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -258,6 +258,11 @@ void CodeGenModule::Release() { // We can change from Warning to Latest if such mode is supported. 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. + getModule().addModuleFlag(llvm::Module::Error, "Debug Info Version", + llvm::dwarf::DEBUG_INFO_VERSION); SimplifyPersonality(); -- cgit v1.1