From 75ce62acefd0dd2ad56d081ca6551241b57a109f Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Tue, 1 Apr 2014 21:04:18 +0000 Subject: DwarfDebug: Prevent DebugLocEntry merging from coalescing two different constants into only the first one. rdar://14874886. llvm-svn: 205357 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index c8aa276b0ef..23ab7f0287f 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -117,11 +117,18 @@ public: /// labels are referenced is used to find debug_loc offset for a given DIE. bool isEmpty() const { return Begin == 0 && End == 0; } bool Merge(const DebugLocEntry &Next) { - if (!(Begin && Loc == Next.Loc && End == Next.Begin)) - return false; + if (Begin && + Loc == Next.Loc && + EntryKind == Next.EntryKind && + (!isInt() || getInt() == Next.getInt()) && + (!isConstantInt() || getConstantInt() == Next.getConstantInt()) && + (!isConstantFP() || getConstantFP() == Next.getConstantFP()) && + End == Next.Begin) { End = Next.End; return true; } + return false; + } bool isLocation() const { return EntryKind == E_Location; } bool isInt() const { return EntryKind == E_Integer; } bool isConstantFP() const { return EntryKind == E_ConstantFP; } -- cgit v1.2.3