1#!/bin/bash 2# 3# Copyright 2011 Google Inc. All Rights Reserved. 4 5function 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 12BASE_LLVM_DIR_ONCE=0 13BASE_LLVM_DIR=$LLVMDIR/llvm 14 15ARGS=`getopt -o h --long help -- "$@"` 16eval set -- "$ARGS" 17 18while 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 33done 34 35for 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 42done 43 44BASE_CLANG_DIR=$BASE_LLVM_DIR/tools/clang 45echo "Using BASE_LLVM_DIR = $BASE_LLVM_DIR" 46echo "Using BASE_CLANG_DIR = $BASE_CLANG_DIR" 47 48ANDROID_LLVM_DIR=$PWD/../llvm 49ANDROID_CLANG_DIR=$PWD 50echo "Using ANDROID_LLVM_DIR = $ANDROID_LLVM_DIR" 51echo "Using ANDROID_CLANG_DIR = $ANDROID_CLANG_DIR" 52 53DIFF_FLAGS="-x .git -r" 54 55diff $DIFF_FLAGS $BASE_CLANG_DIR $ANDROID_CLANG_DIR > diff_clang.txt 56diff $DIFF_FLAGS $BASE_LLVM_DIR $ANDROID_LLVM_DIR > diff_llvm.txt 57 58exit 0 59