diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-04 18:18:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-04 18:18:51 +0000 |
commit | 285199502b08d7d2ac5f37ce5f94cb5e68cec197 (patch) | |
tree | 11900646f4103a1ded2eafa2cc2a910a80479289 /lib/CodeGen/AsmPrinter/AsmPrinter.cpp | |
parent | dfa107e45ac6a145c03376ecc0530d8ece358238 (diff) |
inline processDebugLoc and simplify it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100339 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index fe7db8e862..2f80e80f4d 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -416,6 +416,9 @@ void AsmPrinter::EmitFunctionBody() { // Emit target-specific gunk before the function body. EmitFunctionBodyStart(); + bool ShouldPrintDebugScopes = + DW && MAI->doesSupportDebugInformation() &&DW->ShouldEmitDwarfDebug(); + // Print out code for the function. bool HasAnyRealCode = false; for (MachineFunction::const_iterator I = MF->begin(), E = MF->end(); @@ -430,8 +433,8 @@ void AsmPrinter::EmitFunctionBody() { ++EmittedInsts; - // FIXME: Clean up processDebugLoc. - processDebugLoc(II, true); + if (ShouldPrintDebugScopes) + DW->BeginScope(II); if (VerboseAsm) EmitComments(*II, OutStreamer.GetCommentOS()); @@ -456,8 +459,8 @@ void AsmPrinter::EmitFunctionBody() { break; } - // FIXME: Clean up processDebugLoc. - processDebugLoc(II, false); + if (ShouldPrintDebugScopes) + DW->EndScope(II); } } @@ -1376,21 +1379,6 @@ void AsmPrinter::PrintSpecial(const MachineInstr *MI, raw_ostream &OS, } } -/// processDebugLoc - Processes the debug information of each machine -/// instruction's DebugLoc. -void AsmPrinter::processDebugLoc(const MachineInstr *MI, - bool BeforePrintingInsn) { - if (!DW || !MAI->doesSupportDebugInformation() || !DW->ShouldEmitDwarfDebug()) - return; - - if (!BeforePrintingInsn) - // After printing instruction - DW->EndScope(MI); - else - DW->BeginScope(MI); -} - - /// EmitInlineAsm - This method formats and emits the specified machine /// instruction that is an inline asm. void AsmPrinter::EmitInlineAsm(const MachineInstr *MI) const { |