From f8bea6806bdc68af3cdad9cb30c6dd11fc837a27 Mon Sep 17 00:00:00 2001 From: Mathieu Baudet Date: Sat, 17 Dec 2016 18:23:24 -0800 Subject: [PATCH] fbcode: remove unused includes from .cpp files with no #if and #define Summary: This is a first diff to remove the "easiest" unused includes in fbcode. * For safety, we only touch .cpp files without #if and #define, * We do not try to remove redundant systems headers (aka. "packing"). The diff was generated as follows: ``` foundation/scripts/ls-cpp-dirs | grep -v '^\(\.\.\|external/\|.*/external\)' | xargs ffmr -o /tmp/ffmr-diff-1 codegraph/scripts/ffmr/analyze_includes_no_headers_no_packing_skipping_ifdefs.sh cat /tmp/ffmr-diff-1/*.diff | patch -p2 hg commit -m something arc diff --prepare --nolint --nounit --less-context --excuse refactoring ``` Note: `grep -v` is just an optimization. The actual configuration is in these two files: diffusion/FBS/browse/master/fbcode/codegraph/analysis/config.py diffusion/FBS/browse/master/fbcode/codegraph/scripts/ffmr/analyze_includes_no_headers_no_packing_skipping_ifdefs.sh See the task for more context, and the recent "safety" improvements on the tool. depends on D4317825 for very few cases where `nolint` had to be manually added. Reviewed By: igorsugak Differential Revision: D4312617 fbshipit-source-id: ecc1f0addfd0651fa4770fcc43cd1314661a311a --- src/dictionary.cc | 1 - src/fasttext.cc | 1 - src/utils.cc | 1 - 3 files changed, 3 deletions(-) diff --git a/src/dictionary.cc b/src/dictionary.cc index c0cd2c683..54b38dac7 100644 --- a/src/dictionary.cc +++ b/src/dictionary.cc @@ -15,7 +15,6 @@ #include #include #include -#include namespace fasttext { diff --git a/src/fasttext.cc b/src/fasttext.cc index b85ec3544..026c50b80 100644 --- a/src/fasttext.cc +++ b/src/fasttext.cc @@ -9,7 +9,6 @@ #include "fasttext.h" -#include #include #include diff --git a/src/utils.cc b/src/utils.cc index a0b261304..ea8726794 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -9,7 +9,6 @@ #include "utils.h" -#include #include namespace fasttext {