Skip to content

Commit f8eb6a1

Browse files
committedJan 16, 2016
[DwarfDebug] Move MergeValues to .cpp, NFC
llvm-svn: 257977
1 parent 12b094d commit f8eb6a1

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed
 

‎llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h

+1-12
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,7 @@ class DebugLocEntry {
9393
/// variable, merge them by appending Next's values to the current
9494
/// list of values.
9595
/// Return true if the merge was successful.
96-
bool MergeValues(const DebugLocEntry &Next) {
97-
if (Begin == Next.Begin) {
98-
auto *Expr = cast_or_null<DIExpression>(Values[0].Expression);
99-
auto *NextExpr = cast_or_null<DIExpression>(Next.Values[0].Expression);
100-
if (Expr->isBitPiece() && NextExpr->isBitPiece()) {
101-
addValues(Next.Values);
102-
End = Next.End;
103-
return true;
104-
}
105-
}
106-
return false;
107-
}
96+
bool MergeValues(const DebugLocEntry &Next);
10897

10998
/// \brief Attempt to merge this DebugLocEntry with Next and return
11099
/// true if the merge was successful. Entries can be merged if they

‎llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,23 @@ static bool piecesOverlap(const DIExpression *P1, const DIExpression *P2) {
805805
return (l1 < r2) && (l2 < r1);
806806
}
807807

808+
/// \brief If this and Next are describing different pieces of the same
809+
/// variable, merge them by appending Next's values to the current
810+
/// list of values.
811+
/// Return true if the merge was successful.
812+
bool DebugLocEntry::MergeValues(const DebugLocEntry &Next) {
813+
if (Begin == Next.Begin) {
814+
auto *Expr = cast_or_null<DIExpression>(Values[0].Expression);
815+
auto *NextExpr = cast_or_null<DIExpression>(Next.Values[0].Expression);
816+
if (Expr->isBitPiece() && NextExpr->isBitPiece()) {
817+
addValues(Next.Values);
818+
End = Next.End;
819+
return true;
820+
}
821+
}
822+
return false;
823+
}
824+
808825
/// Build the location list for all DBG_VALUEs in the function that
809826
/// describe the same variable. If the ranges of several independent
810827
/// pieces of the same variable overlap partially, split them up and

0 commit comments

Comments
 (0)
Please sign in to comment.