summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-04 18:18:51 +0000
committerChris Lattner <sabre@nondot.org>2010-04-04 18:18:51 +0000
commit8ff29c523e2430ff14a96f5e3aabf7573029e72d (patch)
treeba277eb0f5323e4cf0cf1a31dd4898bbe5996306
parentc334d80b0d1adf891cb08484c14e929ecb865903 (diff)
downloadbcm5719-llvm-8ff29c523e2430ff14a96f5e3aabf7573029e72d.tar.gz
bcm5719-llvm-8ff29c523e2430ff14a96f5e3aabf7573029e72d.zip
inline processDebugLoc and simplify it.
llvm-svn: 100339
-rw-r--r--llvm/include/llvm/CodeGen/AsmPrinter.h6
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp26
2 files changed, 8 insertions, 24 deletions
diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h
index 89917f28a66..3ac229fe388 100644
--- a/llvm/include/llvm/CodeGen/AsmPrinter.h
+++ b/llvm/include/llvm/CodeGen/AsmPrinter.h
@@ -339,11 +339,7 @@ namespace llvm {
/// EmitInlineAsm - Emit a blob of inline asm to the output streamer.
void EmitInlineAsm(StringRef Str) const;
- /// processDebugLoc - Processes the debug information of each machine
- /// instruction's DebugLoc.
- void processDebugLoc(const MachineInstr *MI, bool BeforePrintingInsn);
-
- /// EmitInlineAsm - This method formats and emits the specified machine
+ /// EmitInlineAsm - This method formats and emits the specified machine
/// instruction that is an inline asm.
void EmitInlineAsm(const MachineInstr *MI) const;
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index fe7db8e862b..2f80e80f4d2 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/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 {
OpenPOWER on IntegriCloud