aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-12-02 01:17:51 +0000
committerDevang Patel <dpatel@apple.com>2010-12-02 01:17:51 +0000
commit6a13ddbd9b2159303996db44db6045730d0fe479 (patch)
tree349c2be3cf78d25af2b0b55f6f0511dc8e0ede70
parent0613516b16466a92c68d60734801221506c85e86 (diff)
If tehre are not any line entry then do not try to emit .debug_line section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120637 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/MC/MCContext.h3
-rw-r--r--lib/MC/MCAsmStreamer.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/include/llvm/MC/MCContext.h b/include/llvm/MC/MCContext.h
index ae502baa1d..60d5c0fae1 100644
--- a/include/llvm/MC/MCContext.h
+++ b/include/llvm/MC/MCContext.h
@@ -180,6 +180,9 @@ namespace llvm {
bool hasDwarfFiles(void) {
return MCDwarfFiles.size() != 0;
}
+ bool hasDwarfLines(void) {
+ return MCLineSectionOrder.size() != 0;
+ }
const std::vector<MCDwarfFile *> &getMCDwarfFiles() {
return MCDwarfFiles;
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index c03f969e85..02b666235e 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/lib/MC/MCAsmStreamer.cpp
@@ -876,7 +876,7 @@ void MCAsmStreamer::EmitRawText(StringRef String) {
void MCAsmStreamer::Finish() {
// Dump out the dwarf file & directory tables and line tables.
- if (getContext().hasDwarfFiles() && TLOF) {
+ if (getContext().hasDwarfFiles() && getContext().hasDwarfLines() && TLOF) {
MCDwarfFileTable::Emit(this, TLOF->getDwarfLineSection(), NULL,
PointerSize);
}