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
This commit is contained in:
Devang Patel 2010-12-02 01:17:51 +00:00
parent 0613516b16
commit 6a13ddbd9b
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);
}