diff options
Diffstat (limited to 'src/passes')
-rw-r--r-- | src/passes/DebugLocationPropagation.cpp | 4 | ||||
-rw-r--r-- | src/passes/Print.cpp | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/passes/DebugLocationPropagation.cpp b/src/passes/DebugLocationPropagation.cpp index 07ae53faa..e2d1ac50f 100644 --- a/src/passes/DebugLocationPropagation.cpp +++ b/src/passes/DebugLocationPropagation.cpp @@ -64,6 +64,10 @@ struct DebugLocationPropagation if (auto it = locs.find(previous); it != locs.end()) { locs[curr] = it->second; } + } else if (self->getFunction()->prologLocation.size()) { + // Instructions may inherit their locations from the function + // prolog. + locs[curr] = *self->getFunction()->prologLocation.begin(); } } expressionStack.push_back(curr); diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index b30a1180d..1ecf382d9 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -3025,8 +3025,7 @@ void PrintSExpression::visitDefinedFunction(Function* curr) { // Print the stack IR. printStackIR(curr->stackIR.get(), *this); } - if (currFunction->epilogLocation.size() && - lastPrintedLocation != *currFunction->epilogLocation.begin()) { + if (currFunction->epilogLocation.size()) { // Print last debug location: mix of decIndent and printDebugLocation // logic. doIndent(o, indent); |