summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-11-07 09:18:38 +0000
committerEric Christopher <echristo@apple.com>2011-11-07 09:18:38 +0000
commita7b6189071014c059791b36d64580f93c1c22b51 (patch)
treefec5a9873097ae6f9b51aa9e74a2118c948f01a9 /llvm/lib/CodeGen
parent6abc9c5aaa9e115ea6ad8568db3c286fb48d365f (diff)
downloadbcm5719-llvm-a7b6189071014c059791b36d64580f93c1c22b51.tar.gz
bcm5719-llvm-a7b6189071014c059791b36d64580f93c1c22b51.zip
Expose a way to get the beginning of the dwarf string section.
llvm-svn: 143920
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp31
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h4
2 files changed, 23 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index d1e4ca4b5fa..037b4ace026 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -136,6 +136,18 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
DwarfDebug::~DwarfDebug() {
}
+/// EmitSectionSym - Switch to the specified MCSection and emit an assembler
+/// temporary label to it if SymbolStem is specified.
+static MCSymbol *EmitSectionSym(AsmPrinter *Asm, const MCSection *Section,
+ const char *SymbolStem = 0) {
+ Asm->OutStreamer.SwitchSection(Section);
+ if (!SymbolStem) return 0;
+
+ MCSymbol *TmpSym = Asm->GetTempSymbol(SymbolStem);
+ Asm->OutStreamer.EmitLabel(TmpSym);
+ return TmpSym;
+}
+
MCSymbol *DwarfDebug::getStringPool() {
return Asm->GetTempSymbol("section_str");
}
@@ -148,6 +160,13 @@ MCSymbol *DwarfDebug::getStringPoolEntry(StringRef Str) {
return Entry.first = Asm->GetTempSymbol("string", Entry.second);
}
+MCSymbol *DwarfDebug::getDwarfStrSectionSym(void) {
+ if (DwarfStrSectionSym) return DwarfStrSectionSym;
+ DwarfStrSectionSym =
+ EmitSectionSym(Asm, Asm->getObjFileLowering().getDwarfStrSection(),
+ "section_str");
+ return DwarfStrSectionSym;
+}
/// assignAbbrevNumber - Define a unique number for the abbreviation.
///
@@ -1465,18 +1484,6 @@ void DwarfDebug::computeSizeAndOffsets() {
}
}
-/// EmitSectionSym - Switch to the specified MCSection and emit an assembler
-/// temporary label to it if SymbolStem is specified.
-static MCSymbol *EmitSectionSym(AsmPrinter *Asm, const MCSection *Section,
- const char *SymbolStem = 0) {
- Asm->OutStreamer.SwitchSection(Section);
- if (!SymbolStem) return 0;
-
- MCSymbol *TmpSym = Asm->GetTempSymbol(SymbolStem);
- Asm->OutStreamer.EmitLabel(TmpSym);
- return TmpSym;
-}
-
/// EmitSectionLabels - Emit initial Dwarf sections with a label at
/// the start of each one.
void DwarfDebug::EmitSectionLabels() {
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index d5ce6969e8b..7bcc5b42074 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -513,6 +513,10 @@ public:
/// getStringPoolEntry - returns an entry into the string pool with the given
/// string text.
MCSymbol *getStringPoolEntry(StringRef Str);
+
+ /// getDwarfStrSectionSym - returns the symbol that starts the dwarf string
+ /// section.
+ MCSymbol *getDwarfStrSectionSym();
};
} // End of namespace llvm
OpenPOWER on IntegriCloud