1 #!/bin/bash 2 # 3 # Copyright 2011 Google Inc. All Rights Reserved. 4 5 function usage() { 6 echo Usage: $0 "[PATH_TO_YOUR_LLVM_DIRECTORY]" 7 echo This will generate a diff of both Clang and LLVM in the files 8 echo diff_clang.txt 9 echo diff_llvm.txt 10 } 11 12 BASE_LLVM_DIR_ONCE=0 13 BASE_LLVM_DIR=$LLVMDIR/llvm 14 15 ARGS=`getopt -o h --long help -- "$@"` 16 eval set -- "$ARGS" 17 18 while true; do 19 case "$1" in 20 -h|--help) 21 usage 22 exit 0 23 ;; 24 --) 25 shift; 26 break 27 ;; 28 *) 29 echo "Internal error!" 30 exit 1 31 ;; 32 esac 33 done 34 35 for ARG; do 36 if [ $BASE_LLVM_DIR_ONCE -eq 1 ]; then 37 usage 38 exit 1 39 fi 40 BASE_LLVM_DIR_ONCE=1 41 BASE_LLVM_DIR=$ARG 42 done 43 44 BASE_CLANG_DIR=$BASE_LLVM_DIR/tools/clang 45 echo "Using BASE_LLVM_DIR = $BASE_LLVM_DIR" 46 echo "Using BASE_CLANG_DIR = $BASE_CLANG_DIR" 47 48 ANDROID_LLVM_DIR=$PWD/../llvm 49 ANDROID_CLANG_DIR=$PWD 50 echo "Using ANDROID_LLVM_DIR = $ANDROID_LLVM_DIR" 51 echo "Using ANDROID_CLANG_DIR = $ANDROID_CLANG_DIR" 52 53 DIFF_FLAGS="-x .git -r" 54 55 diff $DIFF_FLAGS $BASE_CLANG_DIR $ANDROID_CLANG_DIR > diff_clang.txt 56 diff $DIFF_FLAGS $BASE_LLVM_DIR $ANDROID_LLVM_DIR > diff_llvm.txt 57 58 exit 0 59