From owner-svn-src-projects@freebsd.org Sat Jan 16 18:04:24 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27A5CA85DFC for ; Sat, 16 Jan 2016 18:04:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03B6C10C6; Sat, 16 Jan 2016 18:04:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0GI4Nv5056071; Sat, 16 Jan 2016 18:04:23 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0GI4M3B056069; Sat, 16 Jan 2016 18:04:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601161804.u0GI4M3B056069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 16 Jan 2016 18:04:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r294179 - projects/clang380-import/contrib/llvm/lib/CodeGen/AsmPrinter X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2016 18:04:24 -0000 Author: dim Date: Sat Jan 16 18:04:22 2016 New Revision: 294179 URL: https://svnweb.freebsd.org/changeset/base/294179 Log: Pull in r257977 from upstream llvm trunk, by Keno Fischer: [DwarfDebug] Move MergeValues to .cpp, NFC Pull in r257979 from upstream llvm trunk, by Keno Fischer: [DwarfDebug] Don't merge DebugLocEntries if their pieces overlap Summary: Later in DWARF emission we check that DebugLocEntries have non-overlapping pieces, so we should create any such entries by merging here. Fixes PR26163. Reviewers: aprantl Differential Revision: http://reviews.llvm.org/D16249 Again, these will be merged to the official release_38 branch soon, but we need them ASAP. Modified: projects/clang380-import/contrib/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h projects/clang380-import/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Modified: projects/clang380-import/contrib/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h ============================================================================== --- projects/clang380-import/contrib/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h Sat Jan 16 18:03:12 2016 (r294178) +++ projects/clang380-import/contrib/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h Sat Jan 16 18:04:22 2016 (r294179) @@ -93,18 +93,7 @@ public: /// variable, merge them by appending Next's values to the current /// list of values. /// Return true if the merge was successful. - bool MergeValues(const DebugLocEntry &Next) { - if (Begin == Next.Begin) { - auto *Expr = cast_or_null(Values[0].Expression); - auto *NextExpr = cast_or_null(Next.Values[0].Expression); - if (Expr->isBitPiece() && NextExpr->isBitPiece()) { - addValues(Next.Values); - End = Next.End; - return true; - } - } - return false; - } + bool MergeValues(const DebugLocEntry &Next); /// \brief Attempt to merge this DebugLocEntry with Next and return /// true if the merge was successful. Entries can be merged if they Modified: projects/clang380-import/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp ============================================================================== --- projects/clang380-import/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Sat Jan 16 18:03:12 2016 (r294178) +++ projects/clang380-import/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Sat Jan 16 18:04:22 2016 (r294179) @@ -805,6 +805,24 @@ static bool piecesOverlap(const DIExpres return (l1 < r2) && (l2 < r1); } +/// \brief If this and Next are describing different pieces of the same +/// variable, merge them by appending Next's values to the current +/// list of values. +/// Return true if the merge was successful. +bool DebugLocEntry::MergeValues(const DebugLocEntry &Next) { + if (Begin == Next.Begin) { + auto *Expr = cast_or_null(Values[0].Expression); + auto *NextExpr = cast_or_null(Next.Values[0].Expression); + if (Expr->isBitPiece() && NextExpr->isBitPiece() && + !piecesOverlap(Expr, NextExpr)) { + addValues(Next.Values); + End = Next.End; + return true; + } + } + return false; +} + /// Build the location list for all DBG_VALUEs in the function that /// describe the same variable. If the ranges of several independent /// pieces of the same variable overlap partially, split them up and