Repository: kudu
Updated Branches:
  refs/heads/master b198ed8ff -> 1e5d334ad


[thirdparty]: added include-what-you-use

Build the include-what-you-use utility along with the LLVM toolchain.

The project URL:
  https://include-what-you-use.org/

Change-Id: I041ad9e4bbff410f1760c7abd8cd173e5e9cc564
Reviewed-on: http://gerrit.cloudera.org:8080/7593
Reviewed-by: Adar Dembo <a...@cloudera.com>
Tested-by: Alexey Serbin <aser...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/82e6e3c8
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/82e6e3c8
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/82e6e3c8

Branch: refs/heads/master
Commit: 82e6e3c8c868d5e960bb99a18bde18e7d6631047
Parents: b198ed8
Author: Alexey Serbin <aser...@cloudera.com>
Authored: Thu Aug 3 22:29:54 2017 -0700
Committer: Alexey Serbin <aser...@cloudera.com>
Committed: Tue Aug 15 21:02:43 2017 +0000

----------------------------------------------------------------------
 thirdparty/download-thirdparty.sh                 |  7 +++++--
 thirdparty/patches/llvm-add-iwyu.patch            |  7 +++++++
 thirdparty/patches/llvm-iwyu-include-picker.patch | 10 ++++++++++
 thirdparty/patches/llvm-iwyu-nocurses.patch       | 14 ++++++++++++++
 thirdparty/vars.sh                                |  3 +++
 5 files changed, 39 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/82e6e3c8/thirdparty/download-thirdparty.sh
----------------------------------------------------------------------
diff --git a/thirdparty/download-thirdparty.sh 
b/thirdparty/download-thirdparty.sh
index 6249ea2..2c27ebb 100755
--- a/thirdparty/download-thirdparty.sh
+++ b/thirdparty/download-thirdparty.sh
@@ -247,15 +247,18 @@ if [ ! -d $PYTHON_SOURCE ]; then
   fetch_and_expand python-${PYTHON_VERSION}.tar.gz
 fi
 
-LLVM_PATCHLEVEL=2
+LLVM_PATCHLEVEL=5
 delete_if_wrong_patchlevel $LLVM_SOURCE $LLVM_PATCHLEVEL
 if [ ! -d $LLVM_SOURCE ]; then
-  fetch_and_expand llvm-${LLVM_VERSION}.src.tar.gz
+  fetch_and_expand llvm-${LLVM_VERSION}-iwyu-${IWYU_VERSION}.src.tar.gz
 
   pushd $LLVM_SOURCE
   patch -p1 < $TP_DIR/patches/llvm-fix-amazon-linux.patch
   patch -p1 -d $LLVM_SOURCE/tools/clang/tools/extra \
     < 
$TP_DIR/patches/llvm-fix-readability-redundant-declaration-false-positive.patch
+  patch -p1 < $TP_DIR/patches/llvm-add-iwyu.patch
+  patch -p1 < $TP_DIR/patches/llvm-iwyu-nocurses.patch
+  patch -p1 < $TP_DIR/patches/llvm-iwyu-include-picker.patch
   touch patchlevel-$LLVM_PATCHLEVEL
   popd
   echo

http://git-wip-us.apache.org/repos/asf/kudu/blob/82e6e3c8/thirdparty/patches/llvm-add-iwyu.patch
----------------------------------------------------------------------
diff --git a/thirdparty/patches/llvm-add-iwyu.patch 
b/thirdparty/patches/llvm-add-iwyu.patch
new file mode 100644
index 0000000..961f15d
--- /dev/null
+++ b/thirdparty/patches/llvm-add-iwyu.patch
@@ -0,0 +1,7 @@
+--- a/tools/clang/tools/CMakeLists.txt 2017-08-03 20:37:25.000000000 -0700
++++ b/tools/clang/tools/CMakeLists.txt 2017-08-03 20:38:20.000000000 -0700
+@@ -30,3 +30,4 @@
+ 
+ # libclang may require clang-tidy in clang-tools-extra.
+ add_clang_subdirectory(libclang)
++add_subdirectory(include-what-you-use)

http://git-wip-us.apache.org/repos/asf/kudu/blob/82e6e3c8/thirdparty/patches/llvm-iwyu-include-picker.patch
----------------------------------------------------------------------
diff --git a/thirdparty/patches/llvm-iwyu-include-picker.patch 
b/thirdparty/patches/llvm-iwyu-include-picker.patch
new file mode 100644
index 0000000..1a2d39a
--- /dev/null
+++ b/thirdparty/patches/llvm-iwyu-include-picker.patch
@@ -0,0 +1,10 @@
+--- a/tools/clang/tools/include-what-you-use/iwyu_include_picker.cc 2017-08-07 
16:41:03.193267222 -0700
++++ b/tools/clang/tools/include-what-you-use/iwyu_include_picker.cc    
2017-08-07 16:41:12.603327180 -0700
+@@ -288,6 +288,7 @@ const IncludeMapEntry libc_include_map[] = {
+   { "<bits/param.h>", kPrivate, "<sys/param.h>", kPublic },
+   { "<bits/poll.h>", kPrivate, "<sys/poll.h>", kPrivate },
+   { "<bits/poll2.h>", kPrivate, "<sys/poll.h>", kPrivate },
++  { "<bits/local_lim.h>", kPrivate, "<limits.h>", kPublic },
+   { "<bits/posix1_lim.h>", kPrivate, "<limits.h>", kPublic },
+   { "<bits/posix2_lim.h>", kPrivate, "<limits.h>", kPublic },
+   { "<bits/posix_opt.h>", kPrivate, "<unistd.h>", kPublic },

http://git-wip-us.apache.org/repos/asf/kudu/blob/82e6e3c8/thirdparty/patches/llvm-iwyu-nocurses.patch
----------------------------------------------------------------------
diff --git a/thirdparty/patches/llvm-iwyu-nocurses.patch 
b/thirdparty/patches/llvm-iwyu-nocurses.patch
new file mode 100644
index 0000000..23dc1ec
--- /dev/null
+++ b/thirdparty/patches/llvm-iwyu-nocurses.patch
@@ -0,0 +1,14 @@
+--- a/tools/clang/tools/include-what-you-use/CMakeLists.txt 2017-08-07 
16:41:03.193267222 -0700
++++ b/tools/clang/tools/include-what-you-use/CMakeLists.txt    2017-08-07 
16:41:12.603327180 -0700
+@@ -173,11 +173,9 @@ if( WIN32 )
+     version # For clangDriver's MSVCToolchain
+   )
+ elseif( UNIX )
+-  include(FindCurses)
+   target_link_libraries(include-what-you-use
+     pthread
+     z
+-    ${CURSES_LIBRARIES}
+     ${CMAKE_DL_LIBS}
+   )
+ else()

http://git-wip-us.apache.org/repos/asf/kudu/blob/82e6e3c8/thirdparty/vars.sh
----------------------------------------------------------------------
diff --git a/thirdparty/vars.sh b/thirdparty/vars.sh
index 35d5891..1c00d13 100644
--- a/thirdparty/vars.sh
+++ b/thirdparty/vars.sh
@@ -143,6 +143,9 @@ LLVM_VERSION=4.0.0
 LLVM_NAME=llvm-$LLVM_VERSION.src
 LLVM_SOURCE=$TP_SOURCE_DIR/$LLVM_NAME
 
+# The include-what-you-use is built along with LLVM in its source tree.
+IWYU_VERSION=0.8
+
 # Python 2.7 is required to build LLVM 3.6+. It is only built and installed if
 # the system Python version is not 2.7.
 PYTHON_VERSION=2.7.13

Reply via email to