summaryrefslogtreecommitdiff
path: root/lib/MC/MCDwarf.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-03-13 21:47:12 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-03-13 21:47:12 +0000
commit91d5586086b9459d8b615da2a37f3dddbb9eff50 (patch)
tree04e094d7a68c8e7343b00904e5c288a5884fd25f /lib/MC/MCDwarf.cpp
parent303d39f1c4d244d2b16fb23eefb6e2fb881baea9 (diff)
downloadllvm-91d5586086b9459d8b615da2a37f3dddbb9eff50.tar.gz
llvm-91d5586086b9459d8b615da2a37f3dddbb9eff50.tar.bz2
llvm-91d5586086b9459d8b615da2a37f3dddbb9eff50.tar.xz
MCDwarf: Extract the DWARF line table header handling into its own type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203856 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCDwarf.cpp')
-rw-r--r--lib/MC/MCDwarf.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/MC/MCDwarf.cpp b/lib/MC/MCDwarf.cpp
index 5b633ebf8d..81ba40e964 100644
--- a/lib/MC/MCDwarf.cpp
+++ b/lib/MC/MCDwarf.cpp
@@ -224,11 +224,9 @@ const MCSymbol *MCDwarfFileTable::Emit(MCStreamer *MCOS) {
return LineStartSym;
}
-const MCSymbol *MCDwarfFileTable::EmitCU(MCStreamer *MCOS) const {
+std::pair<MCSymbol *, MCSymbol *> MCDwarfLineTableHeader::Emit(MCStreamer *MCOS) const {
MCContext &context = MCOS->getContext();
-
-
// Create a symbol at the beginning of the line table.
MCSymbol *LineStartSym = Label;
if (!LineStartSym)
@@ -302,6 +300,14 @@ const MCSymbol *MCDwarfFileTable::EmitCU(MCStreamer *MCOS) const {
// end of the prologue (that was used in a previous expression).
MCOS->EmitLabel(ProEndSym);
+ return std::make_pair(LineStartSym, LineEndSym);
+}
+
+const MCSymbol *MCDwarfFileTable::EmitCU(MCStreamer *MCOS) const {
+ MCSymbol *LineStartSym;
+ MCSymbol *LineEndSym;
+ std::tie(LineStartSym, LineEndSym) = Header.Emit(MCOS);
+
// Put out the line tables.
for (const auto &LineSec : MCLineSections.getMCLineEntries())
EmitDwarfLineTable(MCOS, LineSec.first, LineSec.second);
@@ -326,6 +332,10 @@ const MCSymbol *MCDwarfFileTable::EmitCU(MCStreamer *MCOS) const {
}
unsigned MCDwarfFileTable::getFile(StringRef Directory, StringRef FileName, unsigned FileNumber) {
+ return Header.getFile(Directory, FileName, FileNumber);
+}
+
+unsigned MCDwarfLineTableHeader::getFile(StringRef Directory, StringRef FileName, unsigned FileNumber) {
// Make space for this FileNumber in the MCDwarfFiles vector if needed.
MCDwarfFiles.resize(FileNumber + 1);