From 681bef22a7aa4fe947564f9be77b99680251e789 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 25 Feb 2022 12:35:13 +0100 Subject: [PATCH] Fix generation of qsimd_x86 files to require no hand-editing Recent fixes to include the "We mean it" comment in the header also lead to that comment appearing in the generated .cpp file, which also lacked the "This is a generated file. DO NOT EDIT." comment. The generated header also lacked a blank line after the "We mean it" comment, so include that (and take it out, too, in the .cpp). The "Please see" line of the "DO NOT EDIT" comment also used the name of the generator script as seen from the Makefile that drives the regeneration; replace this with the README.md file that actually explains how to regenerate the files in corelib/global/. This amends commit 71af0d7059d47a199e1d26de6573d6a5038caa30 and commit b852584556bec3750bad7fac984b6fc5af4c870f Change-Id: I4b5b4dbef5954819632bb625d1914a9ec46e15d9 Reviewed-by: Thiago Macieira --- src/corelib/global/qsimd_x86.cpp | 2 ++ src/corelib/global/qsimd_x86_p.h | 2 +- util/x86simdgen/Makefile | 9 +++++++-- util/x86simdgen/header | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/corelib/global/qsimd_x86.cpp b/src/corelib/global/qsimd_x86.cpp index 9609f21ec48..f29708396c8 100644 --- a/src/corelib/global/qsimd_x86.cpp +++ b/src/corelib/global/qsimd_x86.cpp @@ -37,6 +37,8 @@ ** ****************************************************************************/ +// This is a generated file. DO NOT EDIT. +// Please see util/x86simdgen/README.md #include "qsimd_x86_p.h" static const char features_string[] = diff --git a/src/corelib/global/qsimd_x86_p.h b/src/corelib/global/qsimd_x86_p.h index 0e188f0189a..96210b403ac 100644 --- a/src/corelib/global/qsimd_x86_p.h +++ b/src/corelib/global/qsimd_x86_p.h @@ -49,7 +49,7 @@ // // This is a generated file. DO NOT EDIT. -// Please see 3rdparty/x86simd_generate.pl +// Please see util/x86simdgen/README.md #ifndef QSIMD_X86_P_H #define QSIMD_X86_P_H diff --git a/util/x86simdgen/Makefile b/util/x86simdgen/Makefile index a727af42178..5caa0cf7e6c 100644 --- a/util/x86simdgen/Makefile +++ b/util/x86simdgen/Makefile @@ -11,9 +11,14 @@ all: $(TARGETDIR)/$(TARGETHEADER) $(TARGETDIR)/$(TARGETCPP) $(TARGETHEADER): $(CONF_FILES) | $(GENERATOR) cat $^ | perl $(GENERATOR) /dev/stdin $@ > $@ $(TARGETDIR)/$(TARGETHEADER): header $(TARGETHEADER) - sed '/-- implementation start --/,/-- implementation end --/d' $^ > $@ + sed '/-- implementation start --/,/-- implementation end --/d' $^ | \ + sed 's!3rdparty/x86simd_generate\.pl!util/x86simdgen/README.md!' > $@ $(TARGETDIR)/$(TARGETCPP): $(TARGETHEADER) header - (cat header; echo '#include "$(TARGETHEADER)"'; sed '1,/-- implementation start --/d;/-- implementation end --/,$$d' $<) > $@ + (cat header | grep -v '^//' | grep .; echo; \ + echo '// This is a generated file. DO NOT EDIT.'; \ + echo '// Please see util/x86simdgen/README.md'; \ + echo '#include "$(TARGETHEADER)"'; \ + sed '1,/-- implementation start --/d;/-- implementation end --/,$$d' $<) > $@ clean: -$(RM) $(TARGETHEADER) diff --git a/util/x86simdgen/header b/util/x86simdgen/header index 7d0ace15bb9..062400adce4 100644 --- a/util/x86simdgen/header +++ b/util/x86simdgen/header @@ -47,3 +47,4 @@ // // We mean it. // +