diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2017-09-12 21:50:41 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-09-12 21:50:41 +0000 |
commit | 76221cbae00c7d6152ea694e095b7aa2c47f58d2 (patch) | |
tree | 0dcae3f2220b00accb23bc25c1e352f8f1550bf7 /lib/IR | |
parent | bfd98b8dcc694fbbcada03014246d424a2c99d3d (diff) |
IR: Represent -ggnu-pubnames with a flag on the DICompileUnit.
This allows the flag to be persisted through to LTO.
Differential Revision: https://reviews.llvm.org/D37655
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313078 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR')
-rw-r--r-- | lib/IR/AsmWriter.cpp | 1 | ||||
-rw-r--r-- | lib/IR/DIBuilder.cpp | 4 | ||||
-rw-r--r-- | lib/IR/DebugInfo.cpp | 2 | ||||
-rw-r--r-- | lib/IR/DebugInfoMetadata.cpp | 11 |
4 files changed, 9 insertions, 9 deletions
diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp index 3443c6a3d78..f351aa1d615 100644 --- a/lib/IR/AsmWriter.cpp +++ b/lib/IR/AsmWriter.cpp @@ -1742,6 +1742,7 @@ static void writeDICompileUnit(raw_ostream &Out, const DICompileUnit *N, Printer.printBool("splitDebugInlining", N->getSplitDebugInlining(), true); Printer.printBool("debugInfoForProfiling", N->getDebugInfoForProfiling(), false); + Printer.printBool("gnuPubnames", N->getGnuPubnames(), false); Out << ")"; } diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp index 87edc563eba..1a40d5ce13d 100644 --- a/lib/IR/DIBuilder.cpp +++ b/lib/IR/DIBuilder.cpp @@ -127,7 +127,7 @@ DICompileUnit *DIBuilder::createCompileUnit( unsigned Lang, DIFile *File, StringRef Producer, bool isOptimized, StringRef Flags, unsigned RunTimeVer, StringRef SplitName, DICompileUnit::DebugEmissionKind Kind, uint64_t DWOId, - bool SplitDebugInlining, bool DebugInfoForProfiling) { + bool SplitDebugInlining, bool DebugInfoForProfiling, bool GnuPubnames) { assert(((Lang <= dwarf::DW_LANG_Fortran08 && Lang >= dwarf::DW_LANG_C89) || (Lang <= dwarf::DW_LANG_hi_user && Lang >= dwarf::DW_LANG_lo_user)) && @@ -137,7 +137,7 @@ DICompileUnit *DIBuilder::createCompileUnit( CUNode = DICompileUnit::getDistinct( VMContext, Lang, File, Producer, isOptimized, Flags, RunTimeVer, SplitName, Kind, nullptr, nullptr, nullptr, nullptr, nullptr, DWOId, - SplitDebugInlining, DebugInfoForProfiling); + SplitDebugInlining, DebugInfoForProfiling, GnuPubnames); // Create a named metadata so that it is easier to find cu in a module. NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.cu"); diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index 1b24af105bb..1dc6c5bdd51 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -473,7 +473,7 @@ private: CU->getSplitDebugFilename(), DICompileUnit::LineTablesOnly, EnumTypes, RetainedTypes, GlobalVariables, ImportedEntities, CU->getMacros(), CU->getDWOId(), CU->getSplitDebugInlining(), - CU->getDebugInfoForProfiling()); + CU->getDebugInfoForProfiling(), CU->getGnuPubnames()); } DILocation *getReplacementMDLocation(DILocation *MLD) { diff --git a/lib/IR/DebugInfoMetadata.cpp b/lib/IR/DebugInfoMetadata.cpp index 005aac821f9..9ef8c35dbd0 100644 --- a/lib/IR/DebugInfoMetadata.cpp +++ b/lib/IR/DebugInfoMetadata.cpp @@ -391,7 +391,7 @@ DICompileUnit *DICompileUnit::getImpl( unsigned EmissionKind, Metadata *EnumTypes, Metadata *RetainedTypes, Metadata *GlobalVariables, Metadata *ImportedEntities, Metadata *Macros, uint64_t DWOId, bool SplitDebugInlining, bool DebugInfoForProfiling, - StorageType Storage, bool ShouldCreate) { + bool GnuPubnames, StorageType Storage, bool ShouldCreate) { assert(Storage != Uniqued && "Cannot unique DICompileUnit"); assert(isCanonical(Producer) && "Expected canonical MDString"); assert(isCanonical(Flags) && "Expected canonical MDString"); @@ -401,11 +401,10 @@ DICompileUnit *DICompileUnit::getImpl( File, Producer, Flags, SplitDebugFilename, EnumTypes, RetainedTypes, GlobalVariables, ImportedEntities, Macros}; - return storeImpl(new (array_lengthof(Ops)) - DICompileUnit(Context, Storage, SourceLanguage, - IsOptimized, RuntimeVersion, EmissionKind, - DWOId, SplitDebugInlining, - DebugInfoForProfiling, Ops), + return storeImpl(new (array_lengthof(Ops)) DICompileUnit( + Context, Storage, SourceLanguage, IsOptimized, + RuntimeVersion, EmissionKind, DWOId, SplitDebugInlining, + DebugInfoForProfiling, GnuPubnames, Ops), Storage); } |