From owner-svn-ports-all@freebsd.org Sun Feb 21 15:05:24 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71451AB06C2; Sun, 21 Feb 2016 15:05:24 +0000 (UTC) (envelope-from koobs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4303513AF; Sun, 21 Feb 2016 15:05:24 +0000 (UTC) (envelope-from koobs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1LF5Nce073021; Sun, 21 Feb 2016 15:05:23 GMT (envelope-from koobs@FreeBSD.org) Received: (from koobs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1LF5MJn073016; Sun, 21 Feb 2016 15:05:22 GMT (envelope-from koobs@FreeBSD.org) Message-Id: <201602211505.u1LF5MJn073016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: koobs set sender to koobs@FreeBSD.org using -f From: Kubilay Kocak Date: Sun, 21 Feb 2016 15:05:22 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r409295 - in head/devel: . include-what-you-use X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2016 15:05:24 -0000 Author: koobs Date: Sun Feb 21 15:05:22 2016 New Revision: 409295 URL: https://svnweb.freebsd.org/changeset/ports/409295 Log: [NEW] devel/include-what-you-use: Clang tool to analyze #includes in C and C++ sources "Include what you use" means this: for every symbol (type, function, variable, or macro) that you use in foo.cc (or foo.cpp), either foo.cc or foo.h should include a .h file that exports the declaration of that symbol. (Similarly, for foo_test.cc, either foo_test.cc or foo.h should do the including.) Obviously symbols defined in foo.cc itself are excluded from this requirement. This puts us in a state where every file includes the headers it needs to declare the symbols that it uses. When every file includes what it uses, then it is possible to edit any file and remove unused headers, without fear of accidentally breaking the upwards dependencies of that file. It also becomes easy to automatically track and update dependencies in the source code. WWW: http://include-what-you-use.org Added: head/devel/include-what-you-use/ head/devel/include-what-you-use/Makefile (contents, props changed) head/devel/include-what-you-use/distinfo (contents, props changed) head/devel/include-what-you-use/pkg-descr (contents, props changed) Modified: head/devel/Makefile Modified: head/devel/Makefile ============================================================================== --- head/devel/Makefile Sun Feb 21 14:59:53 2016 (r409294) +++ head/devel/Makefile Sun Feb 21 15:05:22 2016 (r409295) @@ -1034,6 +1034,7 @@ SUBDIR += idutils SUBDIR += ifd-test SUBDIR += imake + SUBDIR += include-what-you-use SUBDIR += inilib SUBDIR += iniparser SUBDIR += initutil Added: head/devel/include-what-you-use/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/include-what-you-use/Makefile Sun Feb 21 15:05:22 2016 (r409295) @@ -0,0 +1,29 @@ +# Created by: Kubilay Kocak +# $FreeBSD$ + +PORTNAME= include-what-you-use +PORTVERSION= 0.5 +CATEGORIES= devel + +MAINTAINER= koobs@FreeBSD.org +COMMENT= Tool for use with clang to analyze #includes in C and C++ source files + +LICENSE= NCSA +LICENSE_FILE= ${WRKSRC}/LICENSE.TXT + +BUILD_DEPENDS= clang37:${PORTSDIR}/lang/clang37 +RUN_DEPENDS= clang37:${PORTSDIR}/lang/clang37 + +USES= cmake:outsource ncurses python:run +USE_GITHUB= yes + +GH_TAGNAME= clang_3.7 + +CMAKE_ARGS+= -DIWYU_LLVM_INCLUDE_PATH=${LOCALBASE}/llvm37/include \ + -DIWYU_LLVM_LIB_PATH=${LOCALBASE}/llvm37/lib + +PLIST_FILES= bin/fix_includes.py \ + bin/include-what-you-use \ + bin/iwyu_tool.py + +.include Added: head/devel/include-what-you-use/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/include-what-you-use/distinfo Sun Feb 21 15:05:22 2016 (r409295) @@ -0,0 +1,2 @@ +SHA256 (include-what-you-use-include-what-you-use-0.5-clang_3.7_GH0.tar.gz) = d5ba65de1da9ccbe65f92e80f8d5b0563b0935be13a15c129d6dbdd9dac841a0 +SIZE (include-what-you-use-include-what-you-use-0.5-clang_3.7_GH0.tar.gz) = 404410 Added: head/devel/include-what-you-use/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/include-what-you-use/pkg-descr Sun Feb 21 15:05:22 2016 (r409295) @@ -0,0 +1,15 @@ +"Include what you use" means this: for every symbol (type, function, +variable, or macro) that you use in foo.cc (or foo.cpp), either foo.cc +or foo.h should include a .h file that exports the declaration of that +symbol. (Similarly, for foo_test.cc, either foo_test.cc or foo.h should +do the including.) Obviously symbols defined in foo.cc itself are +excluded from this requirement. + +This puts us in a state where every file includes the headers it needs +to declare the symbols that it uses. When every file includes what it +uses, then it is possible to edit any file and remove unused headers, +without fear of accidentally breaking the upwards dependencies of +that file. It also becomes easy to automatically track and update +dependencies in the source code. + +WWW: http://include-what-you-use.org