fbcode: remove unused includes from .cpp files with no #if and #define v2016.12.19.00
authorMathieu Baudet <mathieubaudet@fb.com>
Sun, 18 Dec 2016 02:23:24 +0000 (18:23 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sun, 18 Dec 2016 02:33:03 +0000 (18:33 -0800)
commitd0856c87e70789282667a63015ac8c0509cf3e52
tree4c40ad6e2c52bb1c62f964874526c6ee110793e2
parent45d349f07c4873738454c09e3e7b4f3665e81454
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
26 files changed:
folly/experimental/RCUUtils.cpp
folly/experimental/exception_tracer/test/ExceptionCounterTest.cpp
folly/experimental/io/FsUtil.cpp
folly/experimental/io/HugePageUtil.cpp
folly/experimental/test/TestUtilTest.cpp
folly/futures/ManualExecutor.cpp
folly/futures/test/RetryingTest.cpp
folly/futures/test/TimekeeperTest.cpp
folly/io/ShutdownSocketSet.cpp
folly/io/async/test/DelayedDestructionBaseTest.cpp
folly/io/async/test/HHWheelTimerTest.cpp
folly/io/async/test/SSLSessionTest.cpp
folly/io/async/test/SocketPair.cpp
folly/test/AtomicHashMapTest.cpp
folly/test/BatonTest.cpp
folly/test/ExceptionWrapperTest.cpp
folly/test/LoggingBenchmark.cpp
folly/test/MemoryIdlerTest.cpp
folly/test/PortabilityTest.cpp
folly/test/RandomBenchmark.cpp
folly/test/ScopeGuardTest.cpp
folly/test/SingletonTestGlobal.cpp
folly/test/SingletonVaultCTest.cpp
folly/test/StringBenchmark.cpp
folly/test/SubprocessTestParentDeathHelper.cpp
folly/test/ThreadLocalTestLib.cpp