diff options
author | Paul Robinson <paul.robinson@sony.com> | 2018-05-22 17:27:31 +0000 |
---|---|---|
committer | Paul Robinson <paul.robinson@sony.com> | 2018-05-22 17:27:31 +0000 |
commit | 543c0e1d508807c6d0e82cca0748e6b8ccc66948 (patch) | |
tree | 596bf4046ad8a0f3e6d91d82fecfeb33198880b1 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | |
parent | 9bfe932c541cdbe8978f399e79ec95bb61e94f71 (diff) | |
download | bcm5719-llvm-543c0e1d508807c6d0e82cca0748e6b8ccc66948.tar.gz bcm5719-llvm-543c0e1d508807c6d0e82cca0748e6b8ccc66948.zip |
[DWARFv5] Put the DWO ID in its place.
In DWARF v5, the DWO ID is in the (split/skeleton) CU header, not an
attribute on the CU DIE.
This changes the size of those headers, so use the parsed size whenever
we have one, for simplicitly.
Differential Revision: https://reviews.llvm.org/D47158
llvm-svn: 333004
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index 60821c2cc99..5aea16acdc1 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -83,6 +83,9 @@ class DwarfCompileUnit final : public DwarfUnit { DenseMap<const MDNode *, DIE *> AbstractSPDies; DenseMap<const MDNode *, std::unique_ptr<DbgVariable>> AbstractVariables; + /// DWO ID for correlating skeleton and split units. + uint64_t DWOId = 0; + /// Construct a DIE for the given DbgVariable without initializing the /// DbgVariable's DIE reference. DIE *constructVariableDIEImpl(const DbgVariable &DV, bool Abstract); @@ -219,6 +222,13 @@ public: /// Set the skeleton unit associated with this unit. void setSkeleton(DwarfCompileUnit &Skel) { Skeleton = &Skel; } + unsigned getHeaderSize() const override { + // DWARF v5 added the DWO ID to the header for split/skeleton units. + unsigned DWOIdSize = + DD->getDwarfVersion() >= 5 && DD->useSplitDwarf() ? sizeof(uint64_t) + : 0; + return DwarfUnit::getHeaderSize() + DWOIdSize; + } unsigned getLength() { return sizeof(uint32_t) + // Length field getHeaderSize() + getUnitDie().getSize(); @@ -290,6 +300,9 @@ public: void setBaseAddress(const MCSymbol *Base) { BaseAddress = Base; } const MCSymbol *getBaseAddress() const { return BaseAddress; } + uint64_t getDWOId() const { return DWOId; } + void setDWOId(uint64_t DwoId) { DWOId = DwoId; } + bool hasDwarfPubSections() const; }; |