summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-03-18 01:17:26 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-03-18 01:17:26 +0000
commit4a2f95f60ee386dc87d29d5f763fa4fb046550ff (patch)
tree4dc2f624e58e405c9fb6e133613d6d1ee8000a27 /llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
parentcf9e671f5c909334ae5f6e0402e33162282c82fd (diff)
downloadbcm5719-llvm-4a2f95f60ee386dc87d29d5f763fa4fb046550ff.tar.gz
bcm5719-llvm-4a2f95f60ee386dc87d29d5f763fa4fb046550ff.zip
DebugInfo: Implement debug_line.dwo for file names used in type units during -gsplit-dwarf
This removes an attribute (and more importantly, a relocation) from skeleton type units and removes some unnecessary file names from the debug_line section that remains in the .o (and linked executable) file. There's still a few places we could shave off some more space here: * use compilation dir of the underlying compilation unit (since all the type units share that compilation dir - though this would be more complicated in LTO cases where they don't (keep a map of compilation dir->line table header?)) * Remove some of the unnecessary header fields from the line table since they're not needed in this situation (about 12 bytes per table). llvm-svn: 204099
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
index 705c95bf28a..68954dc5548 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
@@ -23,6 +23,7 @@
#include "llvm/IR/DebugInfo.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCSection.h"
+#include "llvm/MC/MCDwarf.h"
namespace llvm {
@@ -511,6 +512,10 @@ protected:
/// getOrCreateStaticMemberDIE - Create new static data member DIE.
DIE *getOrCreateStaticMemberDIE(DIDerivedType DT);
+ /// Look up the source ID with the given directory and source file names. If
+ /// none currently exists, create a new ID and insert it in the line table.
+ virtual unsigned getOrCreateSourceID(StringRef File, StringRef Directory) = 0;
+
private:
/// constructTypeDIE - Construct basic type die from DIBasicType.
void constructTypeDIE(DIE &Buffer, DIBasicType BTy);
@@ -603,9 +608,7 @@ public:
DwarfCompileUnit &getCU() override { return *this; }
- /// Look up the source ID with the given directory and source file names. If
- /// none currently exists, create a new ID and insert it in the line table.
- unsigned getOrCreateSourceID(StringRef FileName, StringRef DirName);
+ unsigned getOrCreateSourceID(StringRef FileName, StringRef DirName) override;
};
class DwarfTypeUnit : public DwarfUnit {
@@ -613,10 +616,12 @@ private:
uint64_t TypeSignature;
const DIE *Ty;
DwarfCompileUnit &CU;
+ MCDwarfLineTableHeader *SplitLineTable;
public:
DwarfTypeUnit(unsigned UID, DIE *D, DwarfCompileUnit &CU, AsmPrinter *A,
- DwarfDebug *DW, DwarfFile *DWU);
+ DwarfDebug *DW, DwarfFile *DWU,
+ MCDwarfLineTableHeader *SplitLineTable = nullptr);
void setTypeSignature(uint64_t Signature) { TypeSignature = Signature; }
uint64_t getTypeSignature() const { return TypeSignature; }
@@ -631,6 +636,9 @@ public:
}
void initSection(const MCSection *Section);
DwarfCompileUnit &getCU() override { return CU; }
+
+protected:
+ unsigned getOrCreateSourceID(StringRef File, StringRef Directory) override;
};
} // end llvm namespace
#endif
OpenPOWER on IntegriCloud