If tehre are not any line entry then do not try to emit .debug_line section.

llvm-svn: 120637
This commit is contained in:
Devang Patel 2010-12-02 01:17:51 +00:00
parent 4be0bd79a4
commit 87b9114f49
2 changed files with 4 additions and 1 deletions

View File

@ -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;

View File

@ -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);
}