From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 60C11380F3DB; Wed, 8 Jun 2022 12:15:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60C11380F3DB Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] Check if this constant item might already be compiled X-Act-Checkin: gcc X-Git-Author: Philip Herron X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: 366c53371ad40025984a98e01b02d452d49816aa X-Git-Newrev: 7a3c935c0f220835c001307944587a84c5af0192 Message-Id: <20220608121552.60C11380F3DB@sourceware.org> Date: Wed, 8 Jun 2022 12:15:52 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2022 12:15:52 -0000 https://gcc.gnu.org/g:7a3c935c0f220835c001307944587a84c5af0192 commit 7a3c935c0f220835c001307944587a84c5af0192 Author: Philip Herron Date: Fri Mar 4 13:45:34 2022 +0000 Check if this constant item might already be compiled Diff: --- gcc/rust/backend/rust-compile-item.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/rust/backend/rust-compile-item.cc b/gcc/rust/backend/rust-compile-item.cc index d42cc1ef998..21cbb1ce905 100644 --- a/gcc/rust/backend/rust-compile-item.cc +++ b/gcc/rust/backend/rust-compile-item.cc @@ -73,6 +73,10 @@ CompileItem::visit (HIR::StaticItem &var) void CompileItem::visit (HIR::ConstantItem &constant) { + if (ctx->lookup_const_decl (constant.get_mappings ().get_hirid (), + &reference)) + return; + // resolve the type TyTy::BaseType *resolved_type = nullptr; bool ok