All of lore.kernel.org
 help / color / mirror / Atom feed
From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, "René Scharfe" <l.s.r@web.de>,
	"Derrick Stolee" <stolee@gmail.com>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	"SZEDER Gábor" <szeder.dev@gmail.com>
Subject: [PATCH 3/5] coccinelle: exclude sha1dc source files from static analysis
Date: Mon, 23 Jul 2018 15:50:58 +0200	[thread overview]
Message-ID: <20180723135100.24288-4-szeder.dev@gmail.com> (raw)
In-Reply-To: <20180723135100.24288-1-szeder.dev@gmail.com>

sha1dc is an external library, that we carry in-tree for convenience
or grab as a submodule, so there is no use in applying our semantic
patches to its source files.

Therefore, exclude sha1dc's source files from Coccinelle's static
analysis.

This change also makes the static analysis somewhat faster: presumably
because of the heavy use of repetitive macro declarations, applying
the semantic patches 'array.cocci' and 'swap.cocci' to 'sha1dc/sha1.c'
takes over half a minute each on my machine, which amounts to about a
third of the runtime of applying these two semantic patches to the
whole git source tree.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---
 Makefile | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 8f509576e9..73e2d16926 100644
--- a/Makefile
+++ b/Makefile
@@ -2666,10 +2666,16 @@ check: command-list.h
 	fi
 
 C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ))
-%.cocci.patch: %.cocci $(C_SOURCES)
+ifdef DC_SHA1_SUBMODULE
+COCCI_SOURCES = $(filter-out sha1collisiondetection/%,$(C_SOURCES))
+else
+COCCI_SOURCES = $(filter-out sha1dc/%,$(C_SOURCES))
+endif
+
+%.cocci.patch: %.cocci $(COCCI_SOURCES)
 	@echo '    ' SPATCH $<; \
 	ret=0; \
-	for f in $(C_SOURCES); do \
+	for f in $(COCCI_SOURCES); do \
 		$(SPATCH) --sp-file $< $$f $(SPATCH_FLAGS) || \
 			{ ret=$$?; break; }; \
 	done >$@+ 2>$@.log; \
-- 
2.18.0.408.g42635c01bc


  parent reply	other threads:[~2018-07-23 13:51 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23 13:50 [PATCH 0/5] Misc Coccinelle-related improvements SZEDER Gábor
2018-07-23 13:50 ` [PATCH 1/5] coccinelle: mark the 'coccicheck' make target as .PHONY SZEDER Gábor
2018-07-23 14:36   ` Derrick Stolee
2018-07-23 19:37   ` Junio C Hamano
2018-07-23 13:50 ` [PATCH 2/5] coccinelle: use $(addsuffix) in 'coccicheck' make target SZEDER Gábor
2018-07-23 19:37   ` Junio C Hamano
2018-07-23 13:50 ` SZEDER Gábor [this message]
2018-07-23 18:27   ` [PATCH 3/5] coccinelle: exclude sha1dc source files from static analysis Eric Sunshine
2018-07-23 18:43     ` SZEDER Gábor
2018-07-23 18:57       ` Eric Sunshine
2018-07-23 13:50 ` [PATCH 4/5] coccinelle: put sane filenames into output patches SZEDER Gábor
2018-07-23 14:34   ` Derrick Stolee
2018-07-23 13:51 ` [PATCH 5/5] coccinelle: extract dedicated make target to clean Coccinelle's results SZEDER Gábor
2018-07-23 14:38 ` [PATCH 0/5] Misc Coccinelle-related improvements Derrick Stolee
2018-07-23 15:29 ` Duy Nguyen
2018-07-23 16:30 ` René Scharfe
2018-07-23 19:40 ` Junio C Hamano
2018-08-02 11:55 ` [PoC] coccinelle: make Coccinelle-related make targets more fine-grained SZEDER Gábor
2018-08-02 13:24   ` René Scharfe
2018-08-02 18:01   ` Jeff King
2018-08-02 18:31     ` Jeff King
2018-08-03  6:21       ` Jonathan Nieder
2018-08-03 13:08         ` Jeff King
2018-08-05 23:02           ` Jonathan Nieder
2018-08-02 19:46     ` Eric Sunshine
2018-08-02 21:29       ` Jeff King
2018-08-02 21:45     ` Ævar Arnfjörð Bjarmason
2018-08-03  6:22       ` Julia Lawall
2018-08-03  6:22         ` [Cocci] " Julia Lawall
2018-08-03  6:44         ` Jonathan Nieder
2018-08-03  6:44           ` [Cocci] " Jonathan Nieder
2018-08-03  6:52           ` Julia Lawall
2018-08-03  6:52             ` [Cocci] " Julia Lawall
2018-08-03  6:25       ` Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180723135100.24288-4-szeder.dev@gmail.com \
    --to=szeder.dev@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=l.s.r@web.de \
    --cc=pclouds@gmail.com \
    --cc=stolee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.