summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-05-27 22:47:41 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-05-27 22:47:41 +0000
commit8a86d6da26ce399bda9acaf479fe9f920b58c7a9 (patch)
treebbc0599d9dabebe4049c2fb762a5e69e0041c939 /llvm/lib/CodeGen
parente0d9f5a41ab901d5583ed8fa53186589ae74cbd1 (diff)
downloadbcm5719-llvm-8a86d6da26ce399bda9acaf479fe9f920b58c7a9.tar.gz
bcm5719-llvm-8a86d6da26ce399bda9acaf479fe9f920b58c7a9.zip
Factor out looking for prologue end into a function
llvm-svn: 209697
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index dad44b84a15..e4e19cc91f3 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1364,6 +1364,17 @@ void DwarfDebug::identifyScopeMarkers() {
}
}
+static DebugLoc findPrologueEndLoc(const MachineFunction *MF) {
+ // First known non-DBG_VALUE and non-frame setup location marks
+ // the beginning of the function body.
+ for (const auto &MBB : *MF)
+ for (const auto &MI : MBB)
+ if (!MI.isDebugValue() && !MI.getFlag(MachineInstr::FrameSetup) &&
+ !MI.getDebugLoc().isUnknown())
+ return MI.getDebugLoc();
+ return DebugLoc();
+}
+
// Gather pre-function debug information. Assumes being called immediately
// after the function entry point has been emitted.
void DwarfDebug::beginFunction(const MachineFunction *MF) {
@@ -1401,18 +1412,6 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
// Assumes in correct section after the entry point.
Asm->OutStreamer.EmitLabel(FunctionBeginSym);
- // Collect user variables, find the end of the prologue.
- for (const auto &MBB : *MF) {
- for (const auto &MI : MBB) {
- if (!MI.isDebugValue() && !MI.getFlag(MachineInstr::FrameSetup) &&
- PrologEndLoc.isUnknown() && !MI.getDebugLoc().isUnknown()) {
- // First known non-DBG_VALUE and non-frame setup location marks
- // the beginning of the function body.
- PrologEndLoc = MI.getDebugLoc();
- }
- }
- }
-
// Calculate history for local variables.
calculateDbgValueHistory(MF, Asm->TM.getRegisterInfo(), DbgValues);
@@ -1441,6 +1440,7 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
PrevLabel = FunctionBeginSym;
// Record beginning of function.
+ PrologEndLoc = findPrologueEndLoc(MF);
if (!PrologEndLoc.isUnknown()) {
DebugLoc FnStartDL =
PrologEndLoc.getFnDebugLoc(MF->getFunction()->getContext());
OpenPOWER on IntegriCloud