From patchwork Mon Jan 1 23:22:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 83082 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 47CC73858281 for ; Mon, 1 Jan 2024 23:23:20 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 58D053858C2F for ; Mon, 1 Jan 2024 23:22:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 58D053858C2F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 58D053858C2F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704151351; cv=none; b=dgGkAj32TE5587kBWXGjHZvR9HCaYRJlekkRYCaFZeNQTB/SRHfd0KJjRYblYt0mONDl+sYc7Ewe8yzYxRsB3rz0tMpqDDpJ/vPzw6yPvSaeF4K/HBRs6bLkfTA6hqgNBIDZFvjkbKZWEMtAXbr82NKlcV/ux/qS1fDX0ltF2Ns= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704151351; c=relaxed/simple; bh=N7l2hdGBwAXAVrdbJKOpu78q/kbRjBnFAXSHdFkrKCo=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=LHbuqvX1u5jZu1Is+xoHcKfBlkvcYk4X22OvpmAjeT4RWnD74Uj3/2gpQCShJHHXmTmQYr9uFHws8WXzr9p2mAKuZwCCXsUIRlkf2m4/8foDi0WQfSKzXxcYv2v0yU2YW6Au8YdUpQmun+HzukRY2o9Oyf+MWlqliUoF5KPPJPQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id C57763406C2; Mon, 1 Jan 2024 23:22:27 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 3/8] sim: ppc: unify igen filter_filename implementations Date: Mon, 1 Jan 2024 18:22:14 -0500 Message-ID: <20240101232219.3003-3-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240101232219.3003-1-vapier@gentoo.org> References: <20240101232219.3003-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Now that both igen implementations are in the top-level, we can unify the filter_filename implementation between them since they're the same (literally the same code). --- sim/Makefile.in | 11 ++++------- sim/ppc/Makefile.in | 3 +-- sim/ppc/filter_filename.c | 35 ----------------------------------- sim/ppc/filter_filename.h | 26 -------------------------- sim/ppc/filter_host.c | 18 ------------------ sim/ppc/local.mk | 4 ++-- sim/ppc/misc.h | 2 +- 7 files changed, 8 insertions(+), 91 deletions(-) delete mode 100644 sim/ppc/filter_filename.c delete mode 100644 sim/ppc/filter_filename.h delete mode 100644 sim/ppc/filter_host.c diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in index b8e7fbfd45f1..fc9e32453666 100644 --- a/sim/ppc/Makefile.in +++ b/sim/ppc/Makefile.in @@ -409,8 +409,7 @@ BUILT_SRC_WO_CONFIG = \ model.h model.c \ support.h support.c \ pk.h \ - hw.h hw.c \ - filter_host.c + hw.h hw.c BUILT_SRC = \ $(BUILT_SRC_WO_CONFIG) \ diff --git a/sim/ppc/filter_filename.c b/sim/ppc/filter_filename.c deleted file mode 100644 index fb2457c0b2c2..000000000000 --- a/sim/ppc/filter_filename.c +++ /dev/null @@ -1,35 +0,0 @@ -/* This file is part of the program psim. - - Copyright (C) 1994-1995, Andrew Cagney - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . - - */ - -#include "filter_filename.h" - -/* Shorten traces by eliminating the directory component to filenames. */ -extern const char * -filter_filename (const char *filename) -{ - const char *p = filename; - const char *last = filename; - int ch; - - while ((ch = *p++) != '\0' && ch != ':') - if (ch == '/') - last = p; - - return last; -} diff --git a/sim/ppc/filter_filename.h b/sim/ppc/filter_filename.h deleted file mode 100644 index 5c42e284cef2..000000000000 --- a/sim/ppc/filter_filename.h +++ /dev/null @@ -1,26 +0,0 @@ -/* This file is part of the program psim. - - Copyright (C) 1994-1995, Andrew Cagney - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . - - */ - -#ifndef _FILTER_FILENAME_H -#define _FILTER_FILENAME_H - -/* Remove directory part from filename */ -extern const char * -filter_filename(const char *filename); -#endif diff --git a/sim/ppc/filter_host.c b/sim/ppc/filter_host.c deleted file mode 100644 index 87d9bbc2e222..000000000000 --- a/sim/ppc/filter_host.c +++ /dev/null @@ -1,18 +0,0 @@ -/* Shim to share files between build & host programs. - - Copyright (C) 2024 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . */ - -#include "filter_filename.c" diff --git a/sim/ppc/local.mk b/sim/ppc/local.mk index 915642293542..c72668c69c46 100644 --- a/sim/ppc/local.mk +++ b/sim/ppc/local.mk @@ -48,7 +48,6 @@ EXTRA_LIBRARIES += %D%/libigen.a %D%/table.c \ %D%/lf.c \ %D%/misc.c \ - %D%/filter_host.c \ %D%/ld-decode.c \ %D%/ld-cache.c \ %D%/filter.c \ @@ -59,6 +58,7 @@ EXTRA_LIBRARIES += %D%/libigen.a %D%/gen-semantics.c \ %D%/gen-idecode.c \ %D%/gen-support.c +%C%_libigen_a_LIBADD = igen/filter_host.o %C%_igen_SOURCES = %D%/igen.c %C%_igen_LDADD = %D%/libigen.a @@ -78,7 +78,7 @@ SIM_ALL_RECURSIVE_DEPS += $(PPC_IGEN) $(AM_V_CCLD)$(LINK_FOR_BUILD) $(%C%_igen_OBJECTS) $(%C%_igen_LDADD) $(%C%_libigen_a_OBJECTS) $(%C%_igen_OBJECTS): %D%/%.o: %D%/%.c - $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@ + $(AM_V_CC)$(COMPILE_FOR_BUILD) -I$(srcdir)/igen -I$(srcdir)/%D% -c $< -o $@ ## Build some of the files in standalone mode for developers of igen itself. %D%/%-main.o: %D%/%.c diff --git a/sim/ppc/misc.h b/sim/ppc/misc.h index a9e97a003e5b..0073467863ad 100644 --- a/sim/ppc/misc.h +++ b/sim/ppc/misc.h @@ -26,7 +26,7 @@ #include #include "ansidecl.h" -#include "filter_filename.h" +#include "filter_host.h" extern void error (const char *msg, ...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);