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 | 435a7333f07394dcaadbadb85d5db9fc6f3b000d (patch) | |
| tree | 11900646f4103a1ded2eafa2cc2a910a80479289 /lib/CodeGen/AsmPrinter/AsmPrinter.cpp | |
| parent | 49318558ba975937d490250a6fde2d0ea40c41c5 (diff) | |
| download | external_llvm-435a7333f07394dcaadbadb85d5db9fc6f3b000d.zip external_llvm-435a7333f07394dcaadbadb85d5db9fc6f3b000d.tar.gz external_llvm-435a7333f07394dcaadbadb85d5db9fc6f3b000d.tar.bz2 | |
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 fe7db8e..2f80e80 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 { |
