clang/Makefile | 6 ----- clang/README | 17 ++++++++++++--- clang/bin/find-unprefixed-members-wrapper | 32 ++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 9 deletions(-)
New commits: commit e57224b5556cc7a6d5183d17e2525880955e3fb1 Author: Jan Holesovsky <ke...@collabora.com> Date: Mon Nov 16 10:17:04 2015 +0100 clang: Make the find-unprefixed-members-wrapper a bit more user friendly. Change-Id: I2ed72bde4c452462e811345c36eae95c55f68df7 diff --git a/clang/Makefile b/clang/Makefile index b4ee7c3..1aa8d51 100644 --- a/clang/Makefile +++ b/clang/Makefile @@ -3,7 +3,7 @@ CLANGWARNS=-Werror -Wall -Wno-missing-braces -Wnon-virtual-dtor -Wendif-labels - CLANGFLAGS = $(CLANGDEFS) $(CLANGWARNS) -g -std=c++11 CLANGLIBS = -lLLVMSupport -lclangAST -lclangBasic -lclangFrontend -lclangRewrite -lclangTooling -all: bin/rename bin/find-unprefixed-members bin/find-unprefixed-members-wrapper +all: bin/rename bin/find-unprefixed-members bin/rename: rename.cxx Makefile clang++ $(CLANGFLAGS) $(CLANGLIBS) -o $@ $< @@ -11,10 +11,6 @@ bin/rename: rename.cxx Makefile bin/find-unprefixed-members: find-unprefixed-members.cxx Makefile clang++ $(CLANGFLAGS) $(CLANGLIBS) -o $@ $< -bin/find-unprefixed-members-wrapper: bin/rename-wrapper Makefile - sed 's/rename/find-unprefixed-members/' $< > $@ - chmod a+x $@ - test: test.cxx test.hxx Makefile clang++ -o test test.cxx diff --git a/clang/README b/clang/README index df6f0fb..d50be49 100644 --- a/clang/README +++ b/clang/README @@ -33,11 +33,20 @@ ln -s /usr/lib64 == Searching for the members to rename -Use the find-unprefixed-members to create the CSV: +Build the LibreOffice build with some additional parameters, like: ----- -bin/find-unprefixed-members -class-name=C test.cxx -- ----- +----- +make <build-param> COMPILER_EXTERNAL_TOOL=1 CXX='<full-path>/bin/find-unprefixed-members-wrapper /usr/bin/clang++' RENAME_ARGS="-class-name=<class-name>" +----- + +- <build-param> is what you'd normally provide to make, like sw.build or + build-nocheck. +- <class-name> is the class name you are interested in calling the 'find + uprefixed' machinery to operate on. + +The build will start, and at the first successful find of the class that has +the members to rename, it will output them, and stop the build. They are also +stored in /tmp/rename.csv. == Build system integration diff --git a/clang/bin/find-unprefixed-members-wrapper b/clang/bin/find-unprefixed-members-wrapper new file mode 100755 index 0000000..a39cf6c --- /dev/null +++ b/clang/bin/find-unprefixed-members-wrapper @@ -0,0 +1,32 @@ +#!/bin/bash + +RENAME_CSV=/tmp/rename.csv + +mydir=$(dirname $0) +if [ -h $0 ]; then + mydir=$(dirname $(readlink -f $0)) +fi + +c= +for i in "$@" +do + if [ "$i" = "-c" ]; then + c=1 + elif [ -n "$c" ]; then + file=$i + break + fi +done + +if [ -n "$c" ] && ! $mydir/find-unprefixed-members $RENAME_ARGS $file -- "$@" 2> "$RENAME_CSV" ; then + echo "Found the members to rename, please see $RENAME_CSV:" + echo + cat "$RENAME_CSV" + echo + exit 1 +fi + +# run the compiler if we did not find what we wanted (yet) +exec -- "$@" + +# vi:set shiftwidth=4 expandtab: _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits