[llvm] r193660 - Debug Info: code clean up.
Manman Ren
manman.ren at gmail.com
Tue Oct 29 16:14:15 PDT 2013
Author: mren
Date: Tue Oct 29 18:14:15 2013
New Revision: 193660
URL: http://llvm.org/viewvc/llvm-project?rev=193660&view=rev
Log:
Debug Info: code clean up.
Use EmitLabelOffsetDifference for handling on darwin platform when
non-darwin platforms use EmitLabelPlusOffset.
Also fix a bug in EmitLabelOffsetDifference where the size is hard-coded
to 4 even though Size is passed in as an argument.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=193660&r1=193659&r2=193660&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Oct 29 18:14:15 2013
@@ -1423,12 +1423,12 @@ void AsmPrinter::EmitLabelOffsetDifferen
OutContext);
if (!MAI->hasSetDirective())
- OutStreamer.EmitValue(Diff, 4);
+ OutStreamer.EmitValue(Diff, Size);
else {
// Otherwise, emit with .set (aka assignment).
MCSymbol *SetLabel = GetTempSymbol("set", SetCounter++);
OutStreamer.EmitAssignment(SetLabel, Diff);
- OutStreamer.EmitSymbolValue(SetLabel, 4);
+ OutStreamer.EmitSymbolValue(SetLabel, Size);
}
}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=193660&r1=193659&r2=193660&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Oct 29 18:14:15 2013
@@ -2082,7 +2082,9 @@ void DwarfDebug::emitDIE(DIE *Die, std::
Asm->EmitLabelPlusOffset(DwarfInfoSectionSym, Addr,
DIEEntry::getRefAddrSize(Asm));
else
- Asm->OutStreamer.EmitIntValue(Addr, DIEEntry::getRefAddrSize(Asm));
+ Asm->EmitLabelOffsetDifference(DwarfInfoSectionSym, Addr,
+ DwarfInfoSectionSym,
+ DIEEntry::getRefAddrSize(Asm));
} else {
Asm->EmitInt32(Addr);
}
More information about the llvm-commits
mailing list