Commit 4598dd70 authored by Michael Lee's avatar Michael Lee Committed by Facebook Github Bot 5

Switch gflags to portability/GFlags.h

Summary:
There are two places that still includes gflags/gflags.h:
portability/GFlags.h and futures/exercises/Koan.h. Also removing
gflags entirely from a couple of places which never reference it at
all.

Reviewed By: yfeldblum

Differential Revision: D3203187

fb-gh-sync-id: e7725fbf2c4b3c475c0035e1b0e8c6e1227f277f
fbshipit-source-id: e7725fbf2c4b3c475c0035e1b0e8c6e1227f277f
parent 2d969487
......@@ -21,6 +21,7 @@
#include <utility>
#include <folly/Format.h>
#include <folly/portability/GFlags.h>
#include <folly/portability/SysMman.h>
#ifdef __linux__
......@@ -30,7 +31,6 @@
#include <fcntl.h>
#include <sys/types.h>
#include <system_error>
#include <gflags/gflags.h>
DEFINE_int64(mlock_chunk_size, 1 << 20, // 1MB
"Maximum bytes to mlock/munlock/munmap at once "
......
......@@ -24,9 +24,9 @@
#include <string>
#include <glog/logging.h>
#include <gflags/gflags.h>
#include <folly/Format.h>
#include <folly/portability/GFlags.h>
#include <folly/detail/FingerprintPolynomial.h>
......
......@@ -20,10 +20,11 @@
#include <unordered_set>
#include <boost/version.hpp>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <folly/Conv.h>
#include <folly/Portability.h>
#include <folly/portability/GFlags.h>
namespace po = ::boost::program_options;
......
......@@ -17,8 +17,9 @@
#pragma once
#include <boost/program_options.hpp>
#include <folly/Optional.h>
#include <gflags/gflags.h>
#include <folly/portability/GFlags.h>
namespace folly {
......
......@@ -18,11 +18,11 @@
#include <thread>
#include <vector>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <folly/Benchmark.h>
#include <folly/experimental/exception_tracer/ExceptionTracer.h>
#include <folly/portability/GFlags.h>
void recurse(int level) {
if (level == 0) {
......
......@@ -25,8 +25,6 @@
#include <stdexcept>
#include <system_error>
#include <gflags/gflags.h>
#include <folly/File.h>
#include <folly/Format.h>
#include <folly/MemoryMapping.h>
......@@ -34,6 +32,7 @@
#include <folly/Range.h>
#include <folly/ScopeGuard.h>
#include <folly/experimental/io/HugePages.h>
#include <folly/portability/GFlags.h>
DEFINE_bool(cp, false, "Copy file");
......
......@@ -19,9 +19,10 @@
#include <stdio.h>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <folly/portability/GFlags.h>
using namespace folly;
using namespace folly::symbolizer;
......
......@@ -16,7 +16,7 @@
#include <folly/Benchmark.h>
#include <folly/experimental/symbolizer/Dwarf.h>
#include <gflags/gflags.h>
#include <folly/portability/GFlags.h>
void dummy() {}
......
......@@ -14,7 +14,6 @@
* limitations under the License.
*/
#include <gflags/gflags.h>
#include <gtest/gtest.h>
#include <iostream>
#include <thread>
......
......@@ -15,7 +15,7 @@
*/
#include <folly/experimental/NestedCommandLineApp.h>
#include <gflags/gflags.h>
#include <folly/portability/GFlags.h>
DEFINE_int32(global_foo, 42, "Global foo");
......
......@@ -15,14 +15,15 @@
*/
/* -*- Mode: C++; tab-width: 2; c-basic-offset: 2; indent-tabs-mode: nil -*- */
#include <thread>
#include <folly/experimental/ReadMostlySharedPtr.h>
#include <iostream>
#include <thread>
#include <folly/Benchmark.h>
#include <folly/Memory.h>
#include <gflags/gflags.h>
#include <folly/experimental/RCURefCount.h>
#include <folly/experimental/ReadMostlySharedPtr.h>
#include <folly/portability/GFlags.h>
template <template<typename> class MainPtr,
template<typename> class WeakPtr,
......
......@@ -15,19 +15,20 @@
*/
// Copyright 2013-present Facebook. All Rights Reserved.
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <string>
#include <list>
#include <folly/Range.h>
#include <folly/experimental/StringKeyedMap.h>
#include <folly/experimental/StringKeyedSet.h>
#include <folly/experimental/StringKeyedUnorderedMap.h>
#include <folly/experimental/StringKeyedUnorderedSet.h>
#include <list>
#include <string>
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <folly/Range.h>
#include <folly/portability/GFlags.h>
using folly::StringKeyedMap;
using folly::StringKeyedSetBase;
using folly::StringKeyedUnorderedMap;
......
......@@ -13,12 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <folly/init/Init.h>
#include <folly/Singleton.h>
#include <folly/experimental/symbolizer/SignalHandler.h>
#include <glog/logging.h>
#include <gflags/gflags.h>
#include <folly/Singleton.h>
#include <folly/experimental/symbolizer/SignalHandler.h>
#include <folly/portability/GFlags.h>
namespace folly {
......
......@@ -16,8 +16,7 @@
#include <folly/Benchmark.h>
#include <folly/io/async/EventBase.h>
#include <gflags/gflags.h>
#include <folly/portability/GFlags.h>
using namespace folly;
......
......@@ -15,15 +15,15 @@
*/
#include <folly/io/IOBufQueue.h>
#include <folly/Range.h>
#include <gflags/gflags.h>
#include <gtest/gtest.h>
#include <iostream>
#include <stdexcept>
#include <string.h>
#include <gtest/gtest.h>
#include <folly/Range.h>
using folly::IOBuf;
using folly::IOBufQueue;
using folly::StringPiece;
......
......@@ -17,15 +17,14 @@
#include <folly/io/IOBuf.h>
#include <folly/io/TypedIOBuf.h>
#include <gflags/gflags.h>
#include <cstddef>
#include <boost/random.hpp>
#include <gtest/gtest.h>
#include <folly/Malloc.h>
#include <folly/Range.h>
#include <cstddef>
using folly::fbstring;
using folly::fbvector;
using folly::IOBuf;
......
......@@ -14,13 +14,12 @@
* limitations under the License.
*/
#include <folly/io/IOBuf.h>
#include <vector>
#include <gflags/gflags.h>
#include <folly/Benchmark.h>
#include <folly/io/Cursor.h>
#include <vector>
#include <folly/io/IOBuf.h>
#include <folly/portability/GFlags.h>
using folly::IOBuf;
using std::unique_ptr;
......
......@@ -18,10 +18,8 @@
#include <sys/types.h>
#include <unistd.h>
#include <random>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <gtest/gtest.h>
......@@ -30,6 +28,7 @@
#include <folly/Random.h>
#include <folly/experimental/TestUtil.h>
#include <folly/io/IOBufQueue.h>
#include <folly/portability/GFlags.h>
DEFINE_int32(random_seed, folly::randomNumberSeed(), "random seed");
......
......@@ -16,9 +16,9 @@
#pragma once
#if FOLLY_HAVE_LIBGFLAGS
#include <gflags/gflags.h>
#else
#include <folly/portability/Config.h>
#if defined(FOLLY_HAVE_LIBGFLAGS) && (FOLLY_HAVE_LIBGFLAGS == 0)
// glog/logging.h is dependent on this implementation detail
// being defined otherwise it undefines all of this -_-....
//
......@@ -58,4 +58,6 @@
FOLLY_DEFINE_FLAG(unsigned long long, U64, _name, _default)
#define DEFINE_string(_name, _default, _description) \
FOLLY_DEFINE_FLAG(std::string, S, _name, _default)
#else
#include <gflags/gflags.h>
#endif
......@@ -16,7 +16,7 @@
#include <folly/Range.h>
#include <gflags/gflags.h>
#include <folly/portability/GFlags.h>
#include <gtest/gtest.h>
#include <algorithm>
......
......@@ -13,14 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <folly/AtomicUnorderedMap.h>
#include <folly/test/DeterministicSchedule.h>
#include <thread>
#include <semaphore.h>
#include <gflags/gflags.h>
#include <thread>
#include <unordered_map>
#include <gtest/gtest.h>
#include <folly/Benchmark.h>
#include <unordered_map>
#include <folly/portability/GFlags.h>
#include <folly/test/DeterministicSchedule.h>
using namespace folly;
using namespace folly::test;
......
......@@ -15,13 +15,16 @@
*/
#include <folly/Baton.h>
#include <semaphore.h>
#include <thread>
#include <gtest/gtest.h>
#include <folly/Benchmark.h>
#include <folly/portability/GFlags.h>
#include <folly/test/BatonTestHelpers.h>
#include <folly/test/DeterministicSchedule.h>
#include <thread>
#include <semaphore.h>
#include <gflags/gflags.h>
#include <gtest/gtest.h>
using namespace folly;
using namespace folly::test;
......
......@@ -15,15 +15,16 @@
*/
#include <folly/Bits.h>
#include <folly/Benchmark.h>
#include <algorithm>
#include <type_traits>
#include <limits>
#include <vector>
#include <gtest/gtest.h>
#include <gflags/gflags.h>
#include <folly/Benchmark.h>
#include <folly/portability/GFlags.h>
using namespace folly;
using namespace folly::bititerator_detail;
......
......@@ -15,11 +15,13 @@
*/
#include <folly/Checksum.h>
#include <gflags/gflags.h>
#include <gtest/gtest.h>
#include <folly/Benchmark.h>
#include <folly/Hash.h>
#include <folly/detail/ChecksumDetail.h>
#include <folly/portability/GFlags.h>
namespace {
const unsigned int BUFFER_SIZE = 512 * 1024 * sizeof(uint64_t);
......
......@@ -20,13 +20,12 @@
#include <set>
#include <thread>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <folly/Benchmark.h>
#include <folly/ConcurrentSkipList.h>
#include <folly/Hash.h>
#include <folly/RWSpinLock.h>
#include <folly/portability/GFlags.h>
#include <glog/logging.h>
DEFINE_int32(num_threads, 12, "num concurrent threads to test");
......
......@@ -16,6 +16,8 @@
// @author: Xin Liu <xliux@fb.com>
#include <folly/ConcurrentSkipList.h>
#include <atomic>
#include <memory>
#include <set>
......@@ -24,15 +26,13 @@
#include <system_error>
#include <glog/logging.h>
#include <gflags/gflags.h>
#include <gtest/gtest.h>
#include <folly/Arena.h>
#include <folly/ConcurrentSkipList.h>
#include <folly/Foreach.h>
#include <folly/Memory.h>
#include <folly/String.h>
#include <gtest/gtest.h>
#include <folly/portability/GFlags.h>
DEFINE_int32(num_threads, 12, "num concurrent threads to test");
......
......@@ -16,9 +16,10 @@
#include <folly/test/DeterministicSchedule.h>
#include <gflags/gflags.h>
#include <gtest/gtest.h>
#include <folly/portability/GFlags.h>
using namespace folly::test;
TEST(DeterministicSchedule, uniform) {
......
......@@ -18,8 +18,8 @@
#include <folly/gen/Base.h>
#include <folly/json.h>
#include <folly/portability/GFlags.h>
#include <gflags/gflags.h>
#include <gtest/gtest.h>
#include <iostream>
......
......@@ -15,14 +15,14 @@
*/
#include <folly/ExceptionWrapper.h>
#include <gflags/gflags.h>
#include <atomic>
#include <exception>
#include <vector>
#include <stdexcept>
#include <thread>
#include <vector>
#include <folly/Benchmark.h>
#include <folly/portability/GFlags.h>
DEFINE_int32(num_threads, 32, "Number of threads to run concurrency "
"benchmarks");
......
......@@ -20,18 +20,17 @@
#include <folly/FBString.h>
#include <cstdlib>
#include <list>
#include <fstream>
#include <sstream>
#include <boost/algorithm/string.hpp>
#include <boost/random.hpp>
#include <gflags/gflags.h>
#include <folly/Benchmark.h>
#include <folly/Foreach.h>
#include <folly/Random.h>
#include <folly/Benchmark.h>
#include <folly/portability/GFlags.h>
using namespace std;
using namespace folly;
......
......@@ -17,14 +17,13 @@
//
// Author: andrei.alexandrescu@fb.com
#include <folly/Foreach.h>
#include <folly/Traits.h>
#include <folly/Random.h>
#include <folly/Benchmark.h>
#include <folly/FBString.h>
#include <folly/FBVector.h>
#include <folly/Benchmark.h>
#include <gflags/gflags.h>
#include <folly/Foreach.h>
#include <folly/Random.h>
#include <folly/Traits.h>
#include <folly/portability/GFlags.h>
#include <gtest/gtest.h>
#include <list>
......
......@@ -16,18 +16,17 @@
#include <folly/File.h>
#include <mutex>
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <boost/thread/locks.hpp>
#include <folly/String.h>
#include <folly/Subprocess.h>
#include <folly/experimental/io/FsUtil.h>
#include <folly/experimental/TestUtil.h>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <mutex>
#include <folly/experimental/io/FsUtil.h>
#include <folly/portability/GFlags.h>
using namespace folly;
using namespace folly::test;
......
......@@ -14,10 +14,10 @@
* limitations under the License.
*/
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <folly/File.h>
#include <folly/portability/GFlags.h>
DEFINE_bool(s, false, "get shared lock");
DEFINE_bool(x, false, "get exclusive lock");
......
......@@ -16,16 +16,15 @@
#include <folly/Format.h>
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <folly/FBVector.h>
#include <folly/FileUtil.h>
#include <folly/dynamic.h>
#include <folly/json.h>
#include <folly/small_vector.h>
#include <glog/logging.h>
#include <gflags/gflags.h>
#include <gtest/gtest.h>
using namespace folly;
TEST(FormatOther, file) {
......
......@@ -14,19 +14,20 @@
* limitations under the License.
*/
#include <stdint.h>
#include <folly/Hash.h>
#include <stdint.h>
#include <deque>
#include <random>
#include <string>
#include <vector>
#include <glog/logging.h>
#include <folly/Benchmark.h>
#include <folly/Format.h>
#include <folly/Hash.h>
#include <folly/Preprocessor.h>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <folly/portability/GFlags.h>
namespace detail {
......
......@@ -15,10 +15,9 @@
*/
#include <folly/stats/Histogram.h>
#include <gflags/gflags.h>
#include <folly/Benchmark.h>
#include <folly/Foreach.h>
#include <folly/portability/GFlags.h>
using folly::Histogram;
......
......@@ -17,7 +17,6 @@
#include <folly/stats/Histogram.h>
#include <folly/stats/Histogram-defs.h>
#include <gflags/gflags.h>
#include <gtest/gtest.h>
using folly::Histogram;
......
......@@ -18,9 +18,9 @@
#include <folly/Benchmark.h>
#include <folly/FileUtil.h>
#include <folly/portability/GFlags.h>
#include <gtest/gtest.h>
#include <gflags/gflags.h>
using folly::dynamic;
using folly::parseJson;
......
......@@ -15,15 +15,16 @@
*/
#include <folly/LifoSem.h>
#include <folly/test/DeterministicSchedule.h>
#include <thread>
#include <semaphore.h>
#include <gflags/gflags.h>
#include <thread>
#include <gtest/gtest.h>
#include <folly/Benchmark.h>
#include <folly/Random.h>
#include <folly/portability/GFlags.h>
#include <folly/test/DeterministicSchedule.h>
using namespace folly;
using namespace folly::test;
......
......@@ -21,12 +21,12 @@
#include <stdio.h>
#include <pthread.h>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <folly/Benchmark.h>
#include <folly/ProducerConsumerQueue.h>
#include <folly/portability/GFlags.h>
#include <folly/stats/Histogram.h>
#include <folly/stats/Histogram-defs.h>
#include <folly/ProducerConsumerQueue.h>
#include <glog/logging.h>
namespace {
......
......@@ -16,13 +16,14 @@
#include <folly/ProducerConsumerQueue.h>
#include <gtest/gtest.h>
#include <vector>
#include <atomic>
#include <chrono>
#include <memory>
#include <thread>
#include <vector>
#include <glog/logging.h>
#include <gtest/gtest.h>
//////////////////////////////////////////////////////////////////////
......
......@@ -18,21 +18,19 @@
// @author xliu (xliux@fb.com)
//
#include <folly/RWSpinLock.h>
#include <stdlib.h>
#include <unistd.h>
#include <vector>
#include <thread>
#include <gtest/gtest.h>
#include <glog/logging.h>
#include <folly/RWSpinLock.h>
#include <gtest/gtest.h>
#include <folly/portability/GFlags.h>
#if FOLLY_HAVE_LIBGFLAGS
#include <gflags/gflags.h>
DEFINE_int32(num_threads, 8, "num threads");
#else
constexpr int FLAGS_num_threads = 8;
#endif
namespace {
......
......@@ -19,16 +19,17 @@
#include <stdlib.h>
#include <thread>
#include <vector>
#include <gtest/gtest.h>
#include <boost/optional.hpp>
#include <boost/thread/shared_mutex.hpp>
#include <folly/Benchmark.h>
#include <folly/MPMCQueue.h>
#include <folly/RWSpinLock.h>
#include <folly/Random.h>
#include <folly/portability/GFlags.h>
#include <folly/test/DeterministicSchedule.h>
#include <gflags/gflags.h>
#include <gtest/gtest.h>
#include <boost/thread/shared_mutex.hpp>
#include <folly/RWSpinLock.h>
using namespace folly;
using namespace folly::test;
......
......@@ -15,13 +15,14 @@
*/
/* -*- Mode: C++; tab-width: 2; c-basic-offset: 2; indent-tabs-mode: nil -*- */
#include <thread>
#include <folly/Singleton.h>
#include <iostream>
#include <thread>
#include <folly/Benchmark.h>
#include <folly/Memory.h>
#include <gflags/gflags.h>
#include <folly/Singleton.h>
#include <folly/portability/GFlags.h>
using namespace folly;
......
......@@ -18,13 +18,13 @@
* A benchmark comparing SparseByteSet to bitset<256> and bool[256].
*/
#include <bitset>
#include <random>
#include <vector>
#include <gflags/gflags.h>
#include <folly/Benchmark.h>
#include <folly/Format.h>
#include <folly/SparseByteSet.h>
#include <folly/portability/GFlags.h>
#include <bitset>
#include <random>
#include <vector>
using namespace std;
using namespace folly;
......
......@@ -14,11 +14,13 @@
* limitations under the License.
*/
#include <folly/SparseByteSet.h>
#include <cstdint>
#include <limits>
#include <random>
#include <set>
#include <folly/SparseByteSet.h>
#include <gtest/gtest.h>
using namespace std;
......
......@@ -28,11 +28,11 @@
#include <signal.h>
#include <unistd.h>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <folly/Conv.h>
#include <folly/Subprocess.h>
#include <folly/portability/GFlags.h>
using folly::Subprocess;
......
......@@ -15,14 +15,16 @@
*/
#include <folly/ThreadCachedInt.h>
#include <folly/Hash.h>
#include <atomic>
#include <thread>
#include <gtest/gtest.h>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <folly/Benchmark.h>
#include <folly/Hash.h>
#include <folly/portability/GFlags.h>
using namespace folly;
......
......@@ -33,11 +33,11 @@
#include <unordered_map>
#include <boost/thread/tss.hpp>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <folly/Benchmark.h>
#include <folly/experimental/io/FsUtil.h>
#include <folly/portability/GFlags.h>
using namespace folly;
......
......@@ -17,10 +17,11 @@
#include <folly/test/function_benchmark/benchmark_impl.h>
#include <folly/test/function_benchmark/test_functions.h>
#include <glog/logging.h>
#include <folly/Benchmark.h>
#include <folly/ScopeGuard.h>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <folly/portability/GFlags.h>
using folly::ScopeGuard;
using folly::makeGuard;
......
......@@ -184,12 +184,13 @@ THOUGHTS:
#include <cstddef>
#include <iomanip>
#include <folly/ScopeGuard.h>
#include <folly/Conv.h>
#include <boost/preprocessor.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
#include <gflags/gflags.h>
#include <gtest/gtest.h>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/preprocessor.hpp>
#include <folly/Conv.h>
#include <folly/ScopeGuard.h>
#include <folly/portability/GFlags.h>
using namespace std;
using namespace folly;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment