aboutsummaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2016-04-26 13:57:33 +0000
committerLinaro Code Review <review@review.linaro.org>2016-04-26 13:57:33 +0000
commit532cfbf09bd12182a9ea3c9c74100a8e85e872a5 (patch)
treeb73314bc9cc2eb37edfae63009f1b956534963ef /helpers
parent09cd9b6b335f1d877d0f25996d0a7fc771a704d6 (diff)
parent3124fb887e6a258d4fd328ea0a8297feb63bb7f9 (diff)
downloadlinaro-scripts-532cfbf09bd12182a9ea3c9c74100a8e85e872a5.tar.gz
Merge "Add clang-tools-extra, lld and lldb to the scripts"
Diffstat (limited to 'helpers')
-rwxr-xr-xhelpers/llvm-branch47
-rwxr-xr-xhelpers/llvm-projs10
-rwxr-xr-xhelpers/llvm-reset1
-rwxr-xr-xhelpers/llvm-sync13
4 files changed, 66 insertions, 5 deletions
diff --git a/helpers/llvm-branch b/helpers/llvm-branch
index 3ed3cef..98a9504 100755
--- a/helpers/llvm-branch
+++ b/helpers/llvm-branch
@@ -79,6 +79,13 @@ if [ -d $CLANG_SRC ]; then
clang_branches=`get_branches`
fi
+CLANG_EXTRA_SRC=$LLVM_SRC/tools/clang/tools/extra
+if [ -d $CLANG_EXTRA_SRC ]; then
+ cd $CLANG_EXTRA_SRC
+ clang_extra_branch=`get_branch`
+ clang_extra_branches=`get_branches`
+fi
+
RT_SRC=$LLVM_SRC/projects/compiler-rt
if [ -d $RT_SRC ]; then
cd $RT_SRC
@@ -107,6 +114,20 @@ if [ -d $UNW_SRC ]; then
unw_branches=`get_branches`
fi
+LLD_SRC=$LLVM_SRC/tools/lld
+if [ -d $LLD_SRC ]; then
+ cd $LLD_SRC
+ lld_branch=`get_branch`
+ lld_branches=`get_branches`
+fi
+
+LLDB_SRC=$LLVM_SRC/tools/lldb
+if [ -d $LLDB_SRC ]; then
+ cd $LLDB_SRC
+ lldb_branch=`get_branch`
+ lldb_branches=`get_branches`
+fi
+
# Delete chosen branch
DEL=''
if [[ $1 = '-d' || $1 = '-D' ]]; then
@@ -124,6 +145,11 @@ if [[ $1 = '' ]]; then
print_branches $clang_branch $clang_branches
echo
fi
+ if [ -d $CLANG_EXTRA_SRC ]; then
+ echo -n "Clang tools extra branches: "
+ print_branches $clang_extra_branch $clang_extra_branches
+ echo
+ fi
if [ -d $RT_SRC ]; then
echo -n "Compiler-RT branches: "
print_branches $rt_branch $rt_branches
@@ -144,6 +170,16 @@ if [[ $1 = '' ]]; then
print_branches $unw_branch $unw_branches
echo
fi
+ if [ -d $LLD_SRC ]; then
+ echo -n "LLD branches: "
+ print_branches $lld_branch $lld_branches
+ echo
+ fi
+ if [ -d $LLDB_SRC ]; then
+ echo -n "LLDB branches: "
+ print_branches $lldb_branch $lldb_branches
+ echo
+ fi
exit
fi
@@ -158,12 +194,16 @@ fi
# Check which projects the branch is
in_llvm=`has $branch $llvm_branches`
in_clang=`has $branch $clang_branches`
+in_clang_extra=`has $branch $clang_extra_branches`
in_rt=`has $branch $rt_branches`
in_cxx=`has $branch $cxx_branches`
in_cxxabi=`has $branch $cxxabi_branches`
in_unw=`has $branch $unw_branches`
-if [[ $in_clang = 'no' && $in_llvm = 'no' && $in_rt = 'no' && \
- $in_cxx = 'no' && $in_cxxabi = 'no' && $in_unw = 'no' ]]; then
+in_lld=`has $branch $lld_branches`
+in_lldb=`has $branch $lldb_branches`
+if [[ $in_clang = 'no' && $in_clang_extra && $in_llvm = 'no' && \
+ $in_rt = 'no' && $in_cxx = 'no' && $in_cxxabi = 'no' && \
+ $in_unw = 'no' && $in_lld = 'no' && $in_lldb = 'no' ]]; then
echo "Branch $branch doesn't exist on any repository"
exit 1
fi
@@ -171,7 +211,10 @@ fi
# DO IT
switch $LLVM_SRC $branch $in_llvm
switch $CLANG_SRC $branch $in_clang
+switch $CLANG_EXTRA_SRC $branch $in_clang_extra
switch $RT_SRC $branch $in_rt
switch $CXX_SRC $branch $in_cxx
switch $CXXABI_SRC $branch $in_cxxabi
switch $UNW_SRC $branch $in_unw
+switch $LLD_SRC $branch $in_lld
+switch $LLDB_SRC $branch $in_lldb
diff --git a/helpers/llvm-projs b/helpers/llvm-projs
index e0ff2da..ac20999 100755
--- a/helpers/llvm-projs
+++ b/helpers/llvm-projs
@@ -8,7 +8,7 @@
prog=`basename $0`
syntax() {
- echo "Syntax: $prog {+/-}[clang|rt|libs|tools|test]"
+ echo "Syntax: $prog {+/-}[clang|cextra|rt|libs|tools|test]"
echo " noarg: list linked projects"
echo " {+/-}: link / unlik projects (default: link)"
}
@@ -16,6 +16,8 @@ syntax() {
# Dirs and links into LLVM
clang_dir=clang
clang_link=tools/clang
+clang_extra_dir=clang-tools-extra
+clang_extra_link=tools/clang/tools/extra
rt_dir=compiler-rt
rt_link=projects/compiler-rt
libcxx_dir=libcxx
@@ -63,6 +65,7 @@ update() {
list_all() {
echo "Projects linked:"
has $clang_link && echo " + Clang"
+ has $clang_extra_link && echo " + Clang Tools Extra"
has $rt_link && echo " + Compiler-RT"
has $libcxx_link && echo " + LibC++"
has $libcxxabi_link && echo " + LibC++abi"
@@ -83,6 +86,7 @@ fi
# Need/not need
clang=`init $clang_link`
+clang_extra=`init $clang_extra_link`
rt=`init $rt_link`
libcxx=`init $libcxx_link`
libcxxabi=`init $libcxxabi_link`
@@ -108,6 +112,9 @@ while ! test -z $1; do
clang)
clang=$flag
;;
+ cextra)
+ clang_extra=$flag
+ ;;
rt)
rt=$flag
;;
@@ -147,4 +154,5 @@ update $libcxxabi_dir $libcxxabi_link $libcxxabi
update $libcxx_dir $libcxx_link $libcxx
update $rt_dir $rt_link $rt
update $clang_dir $clang_link $clang
+update $clang_extra_dir $clang_extra_link $clang_extra
list_all
diff --git a/helpers/llvm-reset b/helpers/llvm-reset
index f219cd8..3c88eef 100755
--- a/helpers/llvm-reset
+++ b/helpers/llvm-reset
@@ -17,6 +17,7 @@ reset_git_svn() {
reset_git_svn LLVM $LLVM_SRC
reset_git_svn Clang $LLVM_SRC/../clang
+reset_git_svn ClangToolsExtra $LLVM_SRC/../clang-tools-extra
reset_git_svn Compiler-RT $LLVM_SRC/../compiler-rt
reset_git_svn Libc++ $LLVM_SRC/../libcxx
reset_git_svn Libc++abi $LLVM_SRC/../libcxxabi
diff --git a/helpers/llvm-sync b/helpers/llvm-sync
index d3e1434..5d5cb27 100755
--- a/helpers/llvm-sync
+++ b/helpers/llvm-sync
@@ -19,7 +19,8 @@ function repo_sync () {
}
prog=`basename $0`
-syntax="Syntax: $prog [-compiler(r)T] [-(l)ibs] [-Lin(k)er] [-(d)ebugger] [-(t)ests] [-(w)eb pages] [-(a)ll]"
+syntax="Syntax: $prog [-clang-tools-e(x)tra] [-compiler(r)T] [-(l)ibs] [-Lin(k)er] [-(d)ebugger] [-(t)ests] [-(w)eb pages] [-(a)ll]"
+cextra=false
rt=false
libs=false
linker=false
@@ -27,8 +28,11 @@ debug=false
tests=false
web=false
-while getopts "rlkdtwa" opt; do
+while getopts "xrlkdtwa" opt; do
case $opt in
+ x)
+ cextra=true
+ ;;
r)
rt=true
;;
@@ -48,6 +52,7 @@ while getopts "rlkdtwa" opt; do
web=true
;;
a)
+ cextra=true
rt=true
libs=true
linker=true
@@ -66,6 +71,10 @@ repo_sync LLVM $LLVM_SRC
repo_sync Clang $LLVM_SRC/../clang
# Optional updates
+if $cextra; then
+ repo_sync ClangToolsExtra $LLVM_SRC/../clang-tools-extra
+fi
+
if $rt; then
repo_sync RT $LLVM_SRC/../compiler-rt
fi