summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-05-25 23:16:12 +0000
committerReid Kleckner <rnk@google.com>2016-05-25 23:16:12 +0000
commit5d122f872d5bb9164ae58eb5f79bbed2ede3f605 (patch)
tree3b717dd9316fe539e73421ff02ce311fa030f729 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h
parentb5d7ff4fa363363aff9f27a216bd72b008089422 (diff)
downloadbcm5719-llvm-5d122f872d5bb9164ae58eb5f79bbed2ede3f605.tar.gz
bcm5719-llvm-5d122f872d5bb9164ae58eb5f79bbed2ede3f605.zip
[codeview] Use comdats for debug info describing comdat functions
Summary: This allows the linker to discard unused symbol information for comdat functions that were discarded during the link. Before this change, searching for the name of an inline function in the debugger would return multiple results, one per symbol subsection in the object file. After this change, there is only one result, the result for the function chosen by the linker. Reviewers: zturner, majnemer Subscribers: aaboud, amccarth, llvm-commits Differential Revision: http://reviews.llvm.org/D20642 llvm-svn: 270792
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h
index 53e1aa0b422..df7c85c0007 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h
@@ -101,6 +101,18 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDebug : public DebugHandlerBase {
};
FunctionInfo *CurFn;
+ /// The set of comdat .debug$S sections that we've seen so far. Each section
+ /// must start with a magic version number that must only be emitted once.
+ /// This set tracks which sections we've already opened.
+ DenseSet<MCSectionCOFF *> ComdatDebugSections;
+
+ /// Switch to the appropriate .debug$S section for GVSym. If GVSym, the symbol
+ /// of an emitted global value, is in a comdat COFF section, this will switch
+ /// to a new .debug$S section in that comdat. This method ensures that the
+ /// section starts with the magic version number on first use. If GVSym is
+ /// null, uses the main .debug$S section.
+ void switchToDebugSectionForSymbol(const MCSymbol *GVSym);
+
/// The next available function index for use with our .cv_* directives. Not
/// to be confused with type indices for LF_FUNC_ID records.
unsigned NextFuncId = 0;
@@ -148,9 +160,13 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDebug : public DebugHandlerBase {
FileToFilepathMap.clear();
}
+ /// Emit the magic version number at the start of a CodeView type or symbol
+ /// section. Appears at the front of every .debug$S or .debug$T section.
+ void emitCodeViewMagicVersion();
+
void emitTypeInformation();
- void emitInlineeFuncIdsAndLines();
+ void emitInlineeLinesSubsection();
void emitDebugInfoForFunction(const Function *GV, FunctionInfo &FI);
OpenPOWER on IntegriCloud