3 # FIXME: do we need a license (or whatever else) header here?
5 # This script merges libsanitizer sources from upstream.
12 svn co http
://llvm.org
/svn
/llvm-project
/compiler-rt
/trunk upstream
17 svn info |
grep Revision |
grep -o '[0-9]*'
21 (cd $1; ls *.
{cc
,h
,inc
,S
} 2> /dev
/null
)
25 change_comment_headers
() {
26 for f
in $
(list_files
$1); do
27 sed -n 3p
$1/$f |
grep -q 'The LLVM Compiler Infrastructure' ||
continue
28 changed
=$
(awk 'NR != 2 && NR != 3' < $1/$f)
29 echo "$changed" > $1/$f
33 # ARGUMENTS: upstream_path local_path
34 # This function merges changes from the directory upstream_path to
35 # the directory local_path.
37 upstream_path
=upstream
/$1
39 change_comment_headers
$upstream_path
40 echo MERGE
: $upstream_path
41 all
=$
( (list_files
$upstream_path; list_files
$local_path) |
sort |
uniq)
44 if [ -f $upstream_path/$f -a -f $local_path/$f ]; then
45 echo "FOUND IN BOTH :" $f
46 # diff -u $local_path/$f $upstream_path/$f
47 cp -v $upstream_path/$f $local_path
48 elif [ -f $upstream_path/$f ]; then
49 echo "FOUND IN UPSTREAM :" $f
50 cp -v $upstream_path/$f $local_path
51 $VCS add
$local_path/$f
52 elif [ -f $local_path/$f ]; then
53 echo "FOUND IN LOCAL :" $f
54 $VCS rm $local_path/$f
65 pwd |
grep 'libsanitizer$' || \
66 fatal
"Run this script from libsanitizer dir"
68 CUR_REV
=$
(get_current_rev
)
69 echo Current upstream revision
: $CUR_REV
70 merge include
/sanitizer include
/sanitizer
73 merge lib
/tsan
/rtl tsan
74 merge lib
/sanitizer_common sanitizer_common
75 merge lib
/interception interception
78 # Need to merge lib/builtins/assembly.h file:
80 cp -v upstream
/lib
/builtins
/assembly.h
builtins
/assembly.h
84 # Update the MERGE file.
88 The first line of this file holds the svn revision number of the
89 last merge done from the master library sources.