summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-11-22 19:42:45 +0000
committerManman Ren <manman.ren@gmail.com>2013-11-22 19:42:45 +0000
commit4b7f23d885d87274441a108336b7b328284addf4 (patch)
tree4a98287d8f1042d835255105b4001c18bc5e0dbe /clang/lib/CodeGen/CodeGenModule.cpp
parentfb6439654ddbed20afe4bc9a56c7a7629f126598 (diff)
downloadbcm5719-llvm-4b7f23d885d87274441a108336b7b328284addf4.tar.gz
bcm5719-llvm-4b7f23d885d87274441a108336b7b328284addf4.zip
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 4d51fb02bb4..8240f8d38c1 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();
OpenPOWER on IntegriCloud