From patchwork Mon Jan 4 14:41:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 1422108 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Twu8Bnlt; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D8dcB5PDCz9sVy for ; Tue, 5 Jan 2021 01:41:29 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2925E3836C07; Mon, 4 Jan 2021 14:41:27 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by sourceware.org (Postfix) with ESMTPS id E69FA3840C2A for ; Mon, 4 Jan 2021 14:41:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E69FA3840C2A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nathanmsidwell@gmail.com Received: by mail-qk1-x72a.google.com with SMTP id z11so23528073qkj.7 for ; Mon, 04 Jan 2021 06:41:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=2fHJlKkb2BeLPZi2aVoCrD6/RZ5KpYmywfkU1pisA5E=; b=Twu8BnltA5LgTkRCKSuvAllRDm2k6CTIK1wivTqdiDREBtxd1Laf80ELGi8DNxL7B6 h0XfadcQAprUaNtXFnBq6ZOWLxmW6Js3F+ep2qAwKQGlBQ2P5vZHrwec88diddfpKoYz WSwDyvTGE9FZamYjWYHZNPSJToDprQJio7dAHewKKuGbqPDRCtshI8UEswh6O6C8fS0k xtmT/lmOqyfHgWDBLf7p5pAxJRyaJ+NhV+2YBDT1gWgXY9SR971N7MZrv2mMwx9ZlNjS /dFNqOlzkosX4PLhFa49yyc5vgUAuf82HFccAxQ1lAetHtlOb11OFscTCb2d0i7RqZ2K kgSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=2fHJlKkb2BeLPZi2aVoCrD6/RZ5KpYmywfkU1pisA5E=; b=U5B2eF9ytODMR+TXNutw/hqiFX8AjrpykjxAGl4W6TcBFTU7K6EtAnnJ8hJ9sLCtqU hI2mrMgBDPUlM9d06eAbVsPVcEg4iLkf8vWU98ZhASw4tqit+A3LKHafVJCGoJYznH4a 9La4oaAROtUeNY0UwLiarsnVID/yqkkdpNVw4bcqJ31oQz2sLL5VvbSsCbBpJYWMP0/Z oi5q+auI91YWEUfTqeRjB+zbsX3/oZnWFYHx/XZJ0zygRpipmc5zswzF4ZScZKxC5x6Q iZMCMgrwbxSW0xCoKnLg3NBJPVyDaL1SvBahdZh78TIgkjCAca4r3z2YlQ44smN2qbOa TCCA== X-Gm-Message-State: AOAM533TeJ9EgXM9QfPXWd3cuCXTv/26O7YsZfN+N5xAzJIOCo/7QyMo H7ZAwfVt7eIB6mTfpSm96Qg= X-Google-Smtp-Source: ABdhPJw/9crgUWH4LY4Wsejorbnrl9D5q5YC+LyJIzMP6m1WKWF9jk+hV5wRF3OHwNeJKClws7F7qg== X-Received: by 2002:a05:620a:483:: with SMTP id 3mr72738230qkr.328.1609771284410; Mon, 04 Jan 2021 06:41:24 -0800 (PST) Received: from ?IPv6:2620:10d:c0a8:1102:343b:6070:6188:8ca4? ([2620:10d:c091:480::1:33e5]) by smtp.googlemail.com with ESMTPSA id c28sm37167683qtv.2.2021.01.04.06.41.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Jan 2021 06:41:23 -0800 (PST) To: GCC Patches From: Nathan Sidwell Subject: [libcody] Remove some std::move [PR 98368] Message-ID: Date: Mon, 4 Jan 2021 09:41:22 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Compiling on clang showed a couple of pessimizations. Fixed thusly. libcody/ * client.cc (Client::ProcessResponse): Remove std::move inside ?: c++tools/ * resolver.cc (module_resolver::cmi_response): Remove std::move of temporary. diff --git i/c++tools/resolver.cc w/c++tools/resolver.cc index c8d31153574..ef08de53072 100644 --- i/c++tools/resolver.cc +++ w/c++tools/resolver.cc @@ -226,9 +226,7 @@ module_resolver::cmi_response (Cody::Server *s, std::string &module) auto iter = map.find (module); if (iter == map.end ()) { - std::string file; - if (default_map) - file = std::move (GetCMIName (module)); + std::string file = default_map ? GetCMIName (module) : std::string (); auto res = map.emplace (module, file); iter = res.first; } diff --git i/libcody/client.cc w/libcody/client.cc index edfe44d34b2..ae69d190cb7 100644 --- i/libcody/client.cc +++ w/libcody/client.cc @@ -122,8 +122,7 @@ Packet Client::ProcessResponse (std::vector &words, Assert (!words.empty ()); if (words[0] == u8"ERROR") return Packet (Client::PC_ERROR, - std::move (words.size () == 2 ? words[1] - : u8"malformed error response")); + words.size () == 2 ? words[1]: u8"malformed error response"); if (isLast && !read.IsAtEnd ()) return Packet (Client::PC_ERROR,