Minor fixes to scripts interfaces
* Remove all references to clang-tools-extra in helpers
We do not support clang tools extra in the python scripts, since it's
too complicated and nobody is working on it yet. Therefore, clean up all
references to it in the helpers as well, to avoid any confusion.
* Add a bit more info to llvm.py --help
Change-Id: I5990925cebafce182b081227a4d33aecead7b4ac
diff --git a/helpers/.llvm-env-remove b/helpers/.llvm-env-remove
index fba6deb..c68530a 100755
--- a/helpers/.llvm-env-remove
+++ b/helpers/.llvm-env-remove
@@ -29,7 +29,6 @@
# worktrees are removed too, so we only need to prune the repos)
safe_run remove_worktree $llvm_repo_dir $llvm_worktree_dir
safe_run remove_worktree $llvm_repo_dir/../clang
-safe_run remove_worktree $llvm_repo_dir/../clang-tools-extra
safe_run remove_worktree $llvm_repo_dir/../compiler-rt
safe_run remove_worktree $llvm_repo_dir/../lld
safe_run remove_worktree $llvm_repo_dir/../libcxx
diff --git a/helpers/llvm-branch b/helpers/llvm-branch
index 5343914..4952141 100755
--- a/helpers/llvm-branch
+++ b/helpers/llvm-branch
@@ -71,13 +71,6 @@
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
@@ -149,11 +142,6 @@
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
@@ -203,10 +191,6 @@
echo "Cannot delete $branch - it is checked out in clang"
exit 2
fi
- if [[ $branch = $clang_extra_branch ]]; then
- echo "Cannot delete $branch - it is checked out in clang tools extra"
- exit 2
- fi
if [[ $branch = $rt_branch ]]; then
echo "Cannot delete $branch - it is checked out in compiler rt"
exit 2
@@ -236,7 +220,6 @@
# Check which projects have the branch
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`
@@ -244,7 +227,7 @@
in_lld=`has $branch $lld_branches`
in_lldb=`has $branch $lldb_branches`
if [[ $CREATE = '' ]]; then
- if [[ $in_clang = 'no' && $in_clang_extra && $in_llvm = 'no' && \
+ if [[ $in_clang = 'no' && $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"
@@ -256,7 +239,6 @@
# 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
diff --git a/helpers/llvm-prepare b/helpers/llvm-prepare
index 4f57447..04f2a34 100755
--- a/helpers/llvm-prepare
+++ b/helpers/llvm-prepare
@@ -42,10 +42,6 @@
echo " + Setting up Clang"
prepare $llvm_repos/clang $gitroot/clang $svnroot/cfe/trunk
-echo " + Setting up Clang Tools Extra"
-prepare $llvm_repos/clang-tools-extra \
- $gitroot/clang-tools-extra $svnroot/clang-tools-extra/trunk
-
echo " + Setting up Compiler-RT"
prepare $llvm_repos/compiler-rt $gitroot/compiler-rt $svnroot/compiler-rt/trunk
diff --git a/helpers/llvm-projs b/helpers/llvm-projs
index bbcaf0a..190f379 100755
--- a/helpers/llvm-projs
+++ b/helpers/llvm-projs
@@ -6,18 +6,17 @@
prog=$(basename $0)
progdir=$(dirname $0)
syntax() {
- echo "Syntax: $prog [clang|lldb|lld|rt|libs|all|none] {+/-}[c|x|r|k|d|l|a|u|t]"
+ echo "Syntax: $prog [clang|lldb|lld|rt|libs|all|none] {+/-}[c|r|k|d|l|a|u|t]"
echo " no args: List linked projects"
- echo " clang: Clang + Clang Tools Extra"
+ echo " clang: Clang"
echo " lldb: Clang + lldb"
echo " lld: Clang + lld"
echo " rt: Clang + compiler-rt"
echo " libs: Clang + libcxx + libcxxabi + libunwind"
echo " all: Link all projects"
echo " none: Unlink all projects"
- echo " {+/-}: link / unlink projects (default: link)"
+ echo " {+/-}: enable / disable projects"
echo " c Clang"
- echo " x Clang Tools Extra"
echo " r Compiler-rt"
echo " k lld"
echo " d lldb"
@@ -31,7 +30,6 @@
need_all() {
need=$1
clang=$need
- clang_extra=$need
rt=$need
libcxx=$need
libcxxabi=$need
@@ -65,7 +63,6 @@
clang)
need_all OFF
clang=ON
- clang_extra=ON
shift
;;
lldb)
@@ -133,9 +130,6 @@
c)
clang=$flag
;;
- x)
- clang_extra=$flag
- ;;
r)
rt=$flag
;;
@@ -164,14 +158,6 @@
shift
done
-# clang and clang-tools-extra have a special relationship: we can't enable
-# clang-tools-extra without enabling clang, and we also can't disable clang
-# without also disabling clang-tools-extra
-if [ "$clang_extra" = ON -a "$clang" = OFF ]; then
- echo "Can't have Clang Tools Extra without Clang! Try to add +c or -x"
- exit
-fi
-
add=""
remove=""
diff --git a/helpers/llvm-reset b/helpers/llvm-reset
index 37a1b00..a031589 100755
--- a/helpers/llvm-reset
+++ b/helpers/llvm-reset
@@ -19,7 +19,6 @@
reset_git_svn LLVM $llvm_repos/llvm
reset_git_svn Clang $llvm_repos/clang
-reset_git_svn ClangToolsExtra $llvm_repos/clang-tools-extra
reset_git_svn Compiler-RT $llvm_repos/compiler-rt
reset_git_svn Libc++ $llvm_repos/libcxx
reset_git_svn Libc++abi $llvm_repos/libcxxabi
diff --git a/helpers/llvm-sync b/helpers/llvm-sync
index 9784006..ee3c16d 100755
--- a/helpers/llvm-sync
+++ b/helpers/llvm-sync
@@ -38,7 +38,6 @@
prog=`basename $0`
clang=false
-cextra=false
rt=false
libcxx=false
libcxxabi=false
@@ -49,7 +48,6 @@
web=false
clang_workdir=$LLVM_SRC/tools/clang
-extra_workdir=$LLVM_SRC/tools/clang/tools/extra
rt_workdir=$LLVM_SRC/projects/compiler-rt
libcxx_workdir=$LLVM_SRC/projects/libcxx
libcxxabi_workdir=$LLVM_SRC/projects/libcxxabi
@@ -59,7 +57,6 @@
test_workdir=$LLVM_SRC/projects/test-suite
if [ -d $clang_workdir ]; then clang=true; fi
-if [ -d $extra_workdir ]; then cextra=true; fi
if [ -d $rt_workdir ]; then rt=true; fi
if [ -d $libcxx_workdir ]; then libcxx=true; fi
if [ -d $libcxxabi_workdir ]; then libcxxabi=true; fi
@@ -75,7 +72,6 @@
;;
a)
clang=true
- cextra=true
rt=true
libcxx=true
libcxxabi=true
@@ -104,10 +100,6 @@
fi
# Optional updates
-if $cextra; then
- repo_sync ClangToolsExtra $llvm_repos/clang-tools-extra $extra_workdir
-fi
-
if $rt; then
repo_sync RT $llvm_repos/compiler-rt $rt_workdir
fi
diff --git a/scripts/llvm.py b/scripts/llvm.py
index 3244bde..4b18560 100644
--- a/scripts/llvm.py
+++ b/scripts/llvm.py
@@ -105,12 +105,19 @@
help="Path to the environment to update.")
options.add_argument(
'--repos', required=True,
- help="Path to the directory containing the repositories for all LLVM subprojects.")
+ help="Path to the directory containing the repositories for all LLVM "
+ "subprojects.")
subcommands = options.add_subparsers()
# Subcommand for adding / removing subprojects
-projs = subcommands.add_parser("projects", help="Add/remove LLVM subprojects.")
+projs = subcommands.add_parser(
+ "projects", help="Add/remove LLVM subprojects.\n"
+ "Adding a subproject will create a worktree for it "
+ "somewhere in the LLVM source tree, on the same git "
+ "branch as LLVM itself.\n"
+ "Removing a subproject will remove the worktree, but "
+ "not the underlying git branch.")
projs.set_defaults(run_command=projects)
# TODO: Overwriting previous values is not necessarily what users expect (so for
@@ -123,19 +130,20 @@
nargs='+',
choices=valid_subprojects,
metavar='subproject',
- help="Link given subprojects. Valid values are:\n\t{}\n".format(
+ help="Enable given subprojects. Valid values are:\n\t{}\n".format(
"\n\t".join(valid_subprojects)))
projs.add_argument(
'-r', '--remove',
nargs='+',
choices=valid_subprojects,
metavar='subproject',
- help="Unlink given subprojects.")
+ help="Disable given subprojects.")
# Subcommand for pushing the current branch to origin
push = subcommands.add_parser(
"push",
- help="Push current branch to origin linaro-local/<user>/<branch>, for all linked subprojects.")
+ help="Push current branch to origin linaro-local/<user>/<branch>, "
+ "for all enabled subprojects.")
push.set_defaults(run_command=push_current_branch)
args = options.parse_args()