forked from OSchip/llvm-project
ThinLTOBitcodeWriter: Strip debug info from merged module.
This module will contain nothing but vtable definitions and (soon) available_externally function definitions, so there is no point in keeping debug info in the module. Differential Revision: https://reviews.llvm.org/D28913 llvm-svn: 294511
This commit is contained in:
parent
8a450fb140
commit
28ffd3261f
|
@ -19,6 +19,7 @@
|
|||
#include "llvm/Analysis/TypeMetadataUtils.h"
|
||||
#include "llvm/Bitcode/BitcodeWriter.h"
|
||||
#include "llvm/IR/Constants.h"
|
||||
#include "llvm/IR/DebugInfo.h"
|
||||
#include "llvm/IR/Intrinsics.h"
|
||||
#include "llvm/IR/Module.h"
|
||||
#include "llvm/IR/PassManager.h"
|
||||
|
@ -261,6 +262,7 @@ void splitAndWriteThinLTOBitcode(raw_ostream &OS, Module &M) {
|
|||
|
||||
ValueToValueMapTy VMap;
|
||||
std::unique_ptr<Module> MergedM(CloneModule(&M, VMap, IsInMergedM));
|
||||
StripDebugInfo(*MergedM);
|
||||
|
||||
filterModule(&M, [&](const GlobalValue *GV) { return !IsInMergedM(GV); });
|
||||
|
||||
|
|
|
@ -26,3 +26,10 @@ define i8* @f() {
|
|||
|
||||
; M1: !0 = !{i32 0, !"typeid"}
|
||||
!0 = !{i32 0, !"typeid"}
|
||||
|
||||
; M0: !llvm.dbg.cu
|
||||
; M1-NOT: !llvm.dbg.cu
|
||||
!llvm.dbg.cu = !{}
|
||||
|
||||
!1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
!llvm.module.flags = !{!1}
|
||||
|
|
Loading…
Reference in New Issue