From owner-svn-src-head@freebsd.org Tue Jan 30 16:41:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ACE4ED4B15; Tue, 30 Jan 2018 16:41:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA8E375470; Tue, 30 Jan 2018 16:41:38 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C45B219BCC; Tue, 30 Jan 2018 16:41:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0UGfcKS073357; Tue, 30 Jan 2018 16:41:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0UGfcG6073352; Tue, 30 Jan 2018 16:41:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201801301641.w0UGfcG6073352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 30 Jan 2018 16:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328594 - in head/contrib/llvm: include/llvm/MC lib/MC X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/contrib/llvm: include/llvm/MC lib/MC X-SVN-Commit-Revision: 328594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jan 2018 16:41:39 -0000 Author: emaste Date: Tue Jan 30 16:41:38 2018 New Revision: 328594 URL: https://svnweb.freebsd.org/changeset/base/328594 Log: Pull in r322108 from upstream llvm trunk (by Rafael EspĂ­ndola): Make one of the emitFill methods non virtual. NFC. This is just preparatory work to fix [LLVM] PR35858. Modified: head/contrib/llvm/include/llvm/MC/MCObjectStreamer.h head/contrib/llvm/include/llvm/MC/MCStreamer.h head/contrib/llvm/lib/MC/MCAsmStreamer.cpp head/contrib/llvm/lib/MC/MCObjectStreamer.cpp head/contrib/llvm/lib/MC/MCStreamer.cpp Modified: head/contrib/llvm/include/llvm/MC/MCObjectStreamer.h ============================================================================== --- head/contrib/llvm/include/llvm/MC/MCObjectStreamer.h Tue Jan 30 16:34:56 2018 (r328593) +++ head/contrib/llvm/include/llvm/MC/MCObjectStreamer.h Tue Jan 30 16:41:38 2018 (r328594) @@ -161,7 +161,6 @@ class MCObjectStreamer : public MCStreamer { (public) bool EmitRelocDirective(const MCExpr &Offset, StringRef Name, const MCExpr *Expr, SMLoc Loc) override; using MCStreamer::emitFill; - void emitFill(uint64_t NumBytes, uint8_t FillValue) override; void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc = SMLoc()) override; void emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr, Modified: head/contrib/llvm/include/llvm/MC/MCStreamer.h ============================================================================== --- head/contrib/llvm/include/llvm/MC/MCStreamer.h Tue Jan 30 16:34:56 2018 (r328593) +++ head/contrib/llvm/include/llvm/MC/MCStreamer.h Tue Jan 30 16:41:38 2018 (r328594) @@ -662,7 +662,7 @@ class MCStreamer { (public) /// \brief Emit NumBytes bytes worth of the value specified by FillValue. /// This implements directives such as '.space'. - virtual void emitFill(uint64_t NumBytes, uint8_t FillValue); + void emitFill(uint64_t NumBytes, uint8_t FillValue); /// \brief Emit \p Size bytes worth of the value specified by \p FillValue. /// Modified: head/contrib/llvm/lib/MC/MCAsmStreamer.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCAsmStreamer.cpp Tue Jan 30 16:34:56 2018 (r328593) +++ head/contrib/llvm/lib/MC/MCAsmStreamer.cpp Tue Jan 30 16:41:38 2018 (r328594) @@ -192,9 +192,6 @@ class MCAsmStreamer final : public MCStreamer { (publi void EmitGPRel32Value(const MCExpr *Value) override; - - void emitFill(uint64_t NumBytes, uint8_t FillValue) override; - void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc = SMLoc()) override; @@ -965,17 +962,12 @@ void MCAsmStreamer::EmitGPRel32Value(const MCExpr *Val EmitEOL(); } -/// emitFill - Emit NumBytes bytes worth of the value specified by -/// FillValue. This implements directives such as '.space'. -void MCAsmStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) { - if (NumBytes == 0) return; - - const MCExpr *E = MCConstantExpr::create(NumBytes, getContext()); - emitFill(*E, FillValue); -} - void MCAsmStreamer::emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc) { + int64_t IntNumBytes; + if (NumBytes.evaluateAsAbsolute(IntNumBytes) && IntNumBytes == 0) + return; + if (const char *ZeroDirective = MAI->getZeroDirective()) { // FIXME: Emit location directives OS << ZeroDirective; Modified: head/contrib/llvm/lib/MC/MCObjectStreamer.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCObjectStreamer.cpp Tue Jan 30 16:34:56 2018 (r328593) +++ head/contrib/llvm/lib/MC/MCObjectStreamer.cpp Tue Jan 30 16:41:38 2018 (r328594) @@ -577,11 +577,6 @@ bool MCObjectStreamer::EmitRelocDirective(const MCExpr return false; } -void MCObjectStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) { - assert(getCurrentSectionOnly() && "need a section"); - insert(new MCFillFragment(FillValue, NumBytes)); -} - void MCObjectStreamer::emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc) { MCDataFragment *DF = getOrCreateDataFragment(); @@ -593,12 +588,13 @@ void MCObjectStreamer::emitFill(const MCExpr &NumBytes return; } - if (IntNumBytes <= 0) { + if (IntNumBytes < 0) { getContext().reportError(Loc, "invalid number of bytes"); return; } - emitFill(IntNumBytes, FillValue); + assert(getCurrentSectionOnly() && "need a section"); + insert(new MCFillFragment(FillValue, IntNumBytes)); } void MCObjectStreamer::emitFill(const MCExpr &NumValues, int64_t Size, Modified: head/contrib/llvm/lib/MC/MCStreamer.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCStreamer.cpp Tue Jan 30 16:34:56 2018 (r328593) +++ head/contrib/llvm/lib/MC/MCStreamer.cpp Tue Jan 30 16:41:38 2018 (r328594) @@ -184,8 +184,7 @@ void MCStreamer::EmitGPRel32Value(const MCExpr *Value) /// Emit NumBytes bytes worth of the value specified by FillValue. /// This implements directives such as '.space'. void MCStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) { - for (uint64_t i = 0, e = NumBytes; i != e; ++i) - EmitIntValue(FillValue, 1); + emitFill(*MCConstantExpr::create(NumBytes, getContext()), FillValue); } void MCStreamer::emitFill(uint64_t NumValues, int64_t Size, int64_t Expr) {