aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfFile.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfFile.h')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfFile.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfFile.h b/lib/CodeGen/AsmPrinter/DwarfFile.h
index 8402027edd6f..b73d89b0e499 100644
--- a/lib/CodeGen/AsmPrinter/DwarfFile.h
+++ b/lib/CodeGen/AsmPrinter/DwarfFile.h
@@ -16,14 +16,15 @@
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
+#include "llvm/IR/Metadata.h"
#include "llvm/Support/Allocator.h"
#include <memory>
-#include <string>
#include <vector>
namespace llvm {
class AsmPrinter;
class DbgVariable;
+class DwarfCompileUnit;
class DwarfUnit;
class DIEAbbrev;
class MCSymbol;
@@ -46,7 +47,7 @@ class DwarfFile {
std::vector<DIEAbbrev *> Abbreviations;
// A pointer to all units in the section.
- SmallVector<std::unique_ptr<DwarfUnit>, 1> CUs;
+ SmallVector<std::unique_ptr<DwarfCompileUnit>, 1> CUs;
DwarfStringPool StrPool;
@@ -66,7 +67,9 @@ public:
~DwarfFile();
- const SmallVectorImpl<std::unique_ptr<DwarfUnit>> &getUnits() { return CUs; }
+ const SmallVectorImpl<std::unique_ptr<DwarfCompileUnit>> &getUnits() {
+ return CUs;
+ }
/// \brief Compute the size and offset of a DIE given an incoming Offset.
unsigned computeSizeAndOffset(DIE &Die, unsigned Offset);
@@ -74,6 +77,10 @@ public:
/// \brief Compute the size and offset of all the DIEs.
void computeSizeAndOffsets();
+ /// \brief Compute the size and offset of all the DIEs in the given unit.
+ /// \returns The size of the root DIE.
+ unsigned computeSizeAndOffsetsForUnit(DwarfUnit *TheU);
+
/// Define a unique number for the abbreviation.
///
/// Compute the abbreviation for \c Die, look up its unique number, and
@@ -81,12 +88,15 @@ public:
DIEAbbrev &assignAbbrevNumber(DIE &Die);
/// \brief Add a unit to the list of CUs.
- void addUnit(std::unique_ptr<DwarfUnit> U);
+ void addUnit(std::unique_ptr<DwarfCompileUnit> U);
/// \brief Emit all of the units to the section listed with the given
/// abbreviation section.
void emitUnits(bool UseOffsets);
+ /// \brief Emit the given unit to its section.
+ void emitUnit(DwarfUnit *U, bool UseOffsets);
+
/// \brief Emit a set of abbreviations to the specific section.
void emitAbbrevs(MCSection *);