xref: /aosp_15_r20/external/llvm/utils/getsrcs.sh (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker#!/bin/sh
2*9880d681SAndroid Build Coastguard Worker##===- utils/getsrcs.sh - Counts Lines Of Code ---------------*- Script -*-===##
3*9880d681SAndroid Build Coastguard Worker#
4*9880d681SAndroid Build Coastguard Worker#                     The LLVM Compiler Infrastructure
5*9880d681SAndroid Build Coastguard Worker#
6*9880d681SAndroid Build Coastguard Worker# This file is distributed under the University of Illinois Open Source
7*9880d681SAndroid Build Coastguard Worker# License. See LICENSE.TXT for details.
8*9880d681SAndroid Build Coastguard Worker# details.
9*9880d681SAndroid Build Coastguard Worker#
10*9880d681SAndroid Build Coastguard Worker##===----------------------------------------------------------------------===##
11*9880d681SAndroid Build Coastguard Worker#
12*9880d681SAndroid Build Coastguard Worker# This script just prints out the path names for all the source files in LLVM.
13*9880d681SAndroid Build Coastguard Worker# The optional -topdir option can be used to specify the top LLVM source
14*9880d681SAndroid Build Coastguard Worker# directory. Without it, the llvm-config command is consulted to find the
15*9880d681SAndroid Build Coastguard Worker# top source directory.
16*9880d681SAndroid Build Coastguard Worker#
17*9880d681SAndroid Build Coastguard Worker# Note that the implementation is based on llvmdo. See that script for more
18*9880d681SAndroid Build Coastguard Worker# details.
19*9880d681SAndroid Build Coastguard Worker##===----------------------------------------------------------------------===##
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Workerif test "$1" = "-topdir" ; then
22*9880d681SAndroid Build Coastguard Worker  TOPDIR="$2"
23*9880d681SAndroid Build Coastguard Worker  shift; shift;
24*9880d681SAndroid Build Coastguard Workerelse
25*9880d681SAndroid Build Coastguard Worker  TOPDIR=`llvm-config --src-root`
26*9880d681SAndroid Build Coastguard Workerfi
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Workerif test -d "$TOPDIR" ; then
29*9880d681SAndroid Build Coastguard Worker  cd $TOPDIR
30*9880d681SAndroid Build Coastguard Worker  ./utils/llvmdo -topdir "$TOPDIR" \
31*9880d681SAndroid Build Coastguard Worker    -dirs "include lib tools utils examples projects" echo
32*9880d681SAndroid Build Coastguard Workerelse
33*9880d681SAndroid Build Coastguard Worker  echo "Can't find LLVM top directory"
34*9880d681SAndroid Build Coastguard Workerfi
35