summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/llvm/MC/MCDwarf.h38
1 files changed, 21 insertions, 17 deletions
diff --git a/include/llvm/MC/MCDwarf.h b/include/llvm/MC/MCDwarf.h
index 6dc381d5dc..951cd6bd1f 100644
--- a/include/llvm/MC/MCDwarf.h
+++ b/include/llvm/MC/MCDwarf.h
@@ -23,6 +23,7 @@
#include <map>
#include <vector>
#include <string>
+#include <utility>
namespace llvm {
class MCAsmBackend;
@@ -174,38 +175,49 @@ public:
}
};
-class MCDwarfFileTable {
+struct MCDwarfLineTableHeader {
MCSymbol *Label;
SmallVector<std::string, 3> MCDwarfDirs;
SmallVector<MCDwarfFile, 3> MCDwarfFiles;
+ unsigned getFile(StringRef Directory, StringRef FileName, unsigned FileNumber);
+ std::pair<MCSymbol *, MCSymbol *> Emit(MCStreamer *MCOS) const;
+};
+
+class MCDwarfFileTable {
+ MCDwarfLineTableHeader Header;
MCLineSection MCLineSections;
public:
- //
// This emits the Dwarf file and the line tables for all Compile Units.
- //
static const MCSymbol *Emit(MCStreamer *MCOS);
- //
+
// This emits the Dwarf file and the line tables for a given Compile Unit.
- //
const MCSymbol *EmitCU(MCStreamer *MCOS) const;
unsigned getFile(StringRef Directory, StringRef FileName, unsigned FileNumber);
+ MCSymbol *getLabel() const {
+ return Header.Label;
+ }
+
+ void setLabel(MCSymbol *Label) {
+ Header.Label = Label;
+ }
+
const SmallVectorImpl<std::string> &getMCDwarfDirs() const {
- return MCDwarfDirs;
+ return Header.MCDwarfDirs;
}
SmallVectorImpl<std::string> &getMCDwarfDirs() {
- return MCDwarfDirs;
+ return Header.MCDwarfDirs;
}
const SmallVectorImpl<MCDwarfFile> &getMCDwarfFiles() const {
- return MCDwarfFiles;
+ return Header.MCDwarfFiles;
}
SmallVectorImpl<MCDwarfFile> &getMCDwarfFiles() {
- return MCDwarfFiles;
+ return Header.MCDwarfFiles;
}
const MCLineSection &getMCLineSections() const {
@@ -214,14 +226,6 @@ public:
MCLineSection &getMCLineSections() {
return MCLineSections;
}
-
- MCSymbol *getLabel() const {
- return Label;
- }
-
- void setLabel(MCSymbol *Label) {
- this->Label = Label;
- }
};
class MCDwarfLineAddr {