Commit a99a9d37 authored by Rick Ratmansky's avatar Rick Ratmansky Committed by Facebook Github Bot

Revert D14114164: [Folly] Remove include of glog from Range.h

Differential Revision:
D14114164

Original commit changeset: e227609e9214

fbshipit-source-id: 99d0fde58e512224915d7a00893ddf15c547dfba
parent 1c841a35
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#pragma once #pragma once
#include <algorithm> #include <algorithm>
#include <cassert>
#include <cctype> #include <cctype>
#include <climits> #include <climits>
#include <cstddef> #include <cstddef>
...@@ -700,7 +699,7 @@ toAppend( ...@@ -700,7 +699,7 @@ toAppend(
conv.ToFixed(value, int(numDigits), &builder); conv.ToFixed(value, int(numDigits), &builder);
break; break;
default: default:
assert(mode == DoubleToStringConverter::PRECISION); CHECK(mode == DoubleToStringConverter::PRECISION);
conv.ToPrecision(value, int(numDigits), &builder); conv.ToPrecision(value, int(numDigits), &builder);
break; break;
} }
......
...@@ -129,7 +129,7 @@ bool readFile( ...@@ -129,7 +129,7 @@ bool readFile(
size_t soFar = 0; // amount of bytes successfully read size_t soFar = 0; // amount of bytes successfully read
SCOPE_EXIT { SCOPE_EXIT {
assert(out.size() >= soFar); // resize better doesn't throw DCHECK(out.size() >= soFar); // resize better doesn't throw
out.resize(soFar); out.resize(soFar);
}; };
...@@ -173,7 +173,7 @@ bool readFile( ...@@ -173,7 +173,7 @@ bool readFile(
const char* file_name, const char* file_name,
Container& out, Container& out,
size_t num_bytes = std::numeric_limits<size_t>::max()) { size_t num_bytes = std::numeric_limits<size_t>::max()) {
assert(file_name); DCHECK(file_name);
const auto fd = openNoInt(file_name, O_RDONLY | O_CLOEXEC); const auto fd = openNoInt(file_name, O_RDONLY | O_CLOEXEC);
if (fd == -1) { if (fd == -1) {
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Format.h> #include <folly/Format.h>
#include <cassert>
#include <folly/ConstexprMath.h> #include <folly/ConstexprMath.h>
#include <folly/CppAttributes.h> #include <folly/CppAttributes.h>
#include <folly/container/Array.h> #include <folly/container/Array.h>
...@@ -210,7 +208,7 @@ void FormatValue<double>::formatHelper( ...@@ -210,7 +208,7 @@ void FormatValue<double>::formatHelper(
int len = builder.position(); int len = builder.position();
builder.Finalize(); builder.Finalize();
assert(len > 0); DCHECK_GT(len, 0);
// Add '+' or ' ' sign if needed // Add '+' or ' ' sign if needed
char* p = buf + 1; char* p = buf + 1;
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#define FOLLY_FORMAT_H_ #define FOLLY_FORMAT_H_
#include <cstdio> #include <cstdio>
#include <ios>
#include <stdexcept> #include <stdexcept>
#include <tuple> #include <tuple>
#include <type_traits> #include <type_traits>
...@@ -242,9 +241,9 @@ class Formatter : public BaseFormatter< ...@@ -242,9 +241,9 @@ class Formatter : public BaseFormatter<
/** /**
* Formatter objects can be written to streams. * Formatter objects can be written to streams.
*/ */
template <class C, bool containerMode, class... Args> template <bool containerMode, class... Args>
std::ostream& operator<<( std::ostream& operator<<(
std::basic_ostream<C>& out, std::ostream& out,
const Formatter<containerMode, Args...>& formatter) { const Formatter<containerMode, Args...>& formatter) {
auto writer = [&out](StringPiece sp) { auto writer = [&out](StringPiece sp) {
out.write(sp.data(), std::streamsize(sp.size())); out.write(sp.data(), std::streamsize(sp.size()));
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <folly/MacAddress.h> #include <folly/MacAddress.h>
#include <cassert>
#include <ostream> #include <ostream>
#include <folly/Exception.h> #include <folly/Exception.h>
...@@ -39,7 +38,7 @@ MacAddress::MacAddress(StringPiece str) { ...@@ -39,7 +38,7 @@ MacAddress::MacAddress(StringPiece str) {
MacAddress MacAddress::createMulticast(IPAddressV6 v6addr) { MacAddress MacAddress::createMulticast(IPAddressV6 v6addr) {
// This method should only be used for multicast addresses. // This method should only be used for multicast addresses.
assert(v6addr.isMulticast()); DCHECK(v6addr.isMulticast());
uint8_t bytes[SIZE]; uint8_t bytes[SIZE];
bytes[0] = 0x33; bytes[0] = 0x33;
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <folly/SocketAddress.h> #include <folly/SocketAddress.h>
#include <cassert>
#include <cerrno> #include <cerrno>
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
...@@ -586,7 +585,7 @@ size_t SocketAddress::hash() const { ...@@ -586,7 +585,7 @@ size_t SocketAddress::hash() const {
break; break;
} }
case AF_UNIX: case AF_UNIX:
assert(external_); DCHECK(external_);
break; break;
case AF_UNSPEC: case AF_UNSPEC:
default: default:
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#pragma once #pragma once
#include <sys/types.h> #include <sys/types.h>
#include <cassert>
#include <cstddef> #include <cstddef>
#include <iosfwd> #include <iosfwd>
#include <string> #include <string>
...@@ -405,7 +403,7 @@ class SocketAddress { ...@@ -405,7 +403,7 @@ class SocketAddress {
socklen_t getActualSize() const; socklen_t getActualSize() const;
sa_family_t getFamily() const { sa_family_t getFamily() const {
assert(external_ || AF_UNIX != storage_.addr.family()); DCHECK(external_ || AF_UNIX != storage_.addr.family());
return external_ ? sa_family_t(AF_UNIX) : storage_.addr.family(); return external_ ? sa_family_t(AF_UNIX) : storage_.addr.family();
} }
......
...@@ -13,11 +13,8 @@ ...@@ -13,11 +13,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/chrono/Conv.h> #include <folly/chrono/Conv.h>
#include <glog/logging.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
using namespace folly; using namespace folly;
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#pragma once #pragma once
#include <cassert>
#include <string> #include <string>
#include <folly/Function.h> #include <folly/Function.h>
...@@ -81,7 +80,7 @@ class CompressionCounter { ...@@ -81,7 +80,7 @@ class CompressionCounter {
return makeCompressionCounterHandler( return makeCompressionCounterHandler(
codecType, codecName, level, key, counterType); codecType, codecName, level, key, counterType);
}; };
assert(!initialize_.hasAllocatedMemory()); DCHECK(!initialize_.hasAllocatedMemory());
} }
void operator+=(double sum) { void operator+=(double sum) {
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
#include <algorithm> #include <algorithm>
#include <unordered_map> #include <unordered_map>
#include <glog/logging.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/FBString.h> #include <folly/FBString.h>
#include <folly/container/test/F14TestUtil.h> #include <folly/container/test/F14TestUtil.h>
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
#include <unordered_map> #include <unordered_map>
#include <glog/logging.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/FBString.h> #include <folly/FBString.h>
#include <folly/container/test/F14TestUtil.h> #include <folly/container/test/F14TestUtil.h>
......
...@@ -17,9 +17,10 @@ ...@@ -17,9 +17,10 @@
#pragma once #pragma once
#include <algorithm> #include <algorithm>
#include <cassert>
#include <string> #include <string>
#include <glog/logging.h>
#include <folly/Likely.h> #include <folly/Likely.h>
namespace folly { namespace folly {
...@@ -55,7 +56,7 @@ class StringPieceLite { ...@@ -55,7 +56,7 @@ class StringPieceLite {
return size() == 0; return size() == 0;
} }
const char& operator[](size_t i) const { const char& operator[](size_t i) const {
assert(size() > i); DCHECK_GT(size(), i);
return b_[i]; return b_[i];
} }
template <typename Range> template <typename Range>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <folly/detail/RangeSse42.h> #include <folly/detail/RangeSse42.h>
#include <cassert> #include <glog/logging.h>
#include <folly/Portability.h> #include <folly/Portability.h>
...@@ -73,9 +73,9 @@ static inline size_t nextAlignedIndex(const char* arr) { ...@@ -73,9 +73,9 @@ static inline size_t nextAlignedIndex(const char* arr) {
size_t qfind_first_byte_of_needles16( size_t qfind_first_byte_of_needles16(
const StringPieceLite haystack, const StringPieceLite haystack,
const StringPieceLite needles) { const StringPieceLite needles) {
assert(haystack.size() > 0u); DCHECK_GT(haystack.size(), 0u);
assert(needles.size() > 0u); DCHECK_GT(needles.size(), 0u);
assert(needles.size() <= 16u); DCHECK_LE(needles.size(), 16u);
if ((needles.size() <= 2 && haystack.size() >= 256) || if ((needles.size() <= 2 && haystack.size() >= 256) ||
// must bail if we can't even SSE-load a single segment of haystack // must bail if we can't even SSE-load a single segment of haystack
(haystack.size() < 16 && (haystack.size() < 16 &&
...@@ -119,8 +119,8 @@ size_t scanHaystackBlock( ...@@ -119,8 +119,8 @@ size_t scanHaystackBlock(
const StringPieceLite haystack, const StringPieceLite haystack,
const StringPieceLite needles, const StringPieceLite needles,
uint64_t blockStartIdx) { uint64_t blockStartIdx) {
assert(needles.size() > 16u); // should handled by *needles16() method DCHECK_GT(needles.size(), 16u); // should handled by *needles16() method
assert( DCHECK(
blockStartIdx + 16 <= haystack.size() || blockStartIdx + 16 <= haystack.size() ||
(page_for(haystack.data() + blockStartIdx) == (page_for(haystack.data() + blockStartIdx) ==
page_for(haystack.data() + blockStartIdx + 15))); page_for(haystack.data() + blockStartIdx + 15)));
......
...@@ -119,6 +119,7 @@ struct hash<::folly::dynamic> { ...@@ -119,6 +119,7 @@ struct hash<::folly::dynamic> {
apply(std::string); \ apply(std::string); \
break; \ break; \
default: \ default: \
CHECK(0); \
abort(); \ abort(); \
} \ } \
} while (0) } while (0)
......
...@@ -14,14 +14,12 @@ ...@@ -14,14 +14,12 @@
* limitations under the License. * limitations under the License.
*/ */
#include <folly/dynamic.h>
#include <numeric> #include <numeric>
#include <glog/logging.h> #include <folly/container/Enumerate.h>
#include <folly/dynamic.h>
#include <folly/Format.h> #include <folly/Format.h>
#include <folly/container/Enumerate.h>
#include <folly/hash/Hash.h> #include <folly/hash/Hash.h>
#include <folly/lang/Assume.h> #include <folly/lang/Assume.h>
#include <folly/lang/Exception.h> #include <folly/lang/Exception.h>
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
#include <folly/executors/thread_factory/ThreadFactory.h> #include <folly/executors/thread_factory/ThreadFactory.h>
#include <glog/logging.h>
#include <folly/String.h> #include <folly/String.h>
#include <folly/portability/SysResource.h> #include <folly/portability/SysResource.h>
#include <folly/portability/SysTime.h> #include <folly/portability/SysTime.h>
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
#include <sstream> #include <sstream>
#include <glog/logging.h>
#include <folly/Optional.h> #include <folly/Optional.h>
namespace folly { namespace folly {
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/experimental/EnvUtil.h> #include <folly/experimental/EnvUtil.h>
#include <glog/logging.h>
#include <folly/String.h> #include <folly/String.h>
#include <folly/portability/Stdlib.h> #include <folly/portability/Stdlib.h>
#include <folly/portability/Unistd.h> #include <folly/portability/Unistd.h>
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
#include <random> #include <random>
#include <glog/logging.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/Random.h> #include <folly/Random.h>
#include <folly/String.h> #include <folly/String.h>
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
#include <iostream> #include <iostream>
#include <glog/logging.h>
#include <folly/FileUtil.h> #include <folly/FileUtil.h>
#include <folly/Format.h> #include <folly/Format.h>
#include <folly/experimental/io/FsUtil.h> #include <folly/experimental/io/FsUtil.h>
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <sys/types.h> #include <sys/types.h>
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <glog/logging.h>
#include <folly/Exception.h> #include <folly/Exception.h>
#include <folly/File.h> #include <folly/File.h>
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
// specializations. // specializations.
#include <folly/experimental/crypto/detail/LtHashInternal.h> #include <folly/experimental/crypto/detail/LtHashInternal.h>
#include <glog/logging.h>
#ifdef __AVX2__ #ifdef __AVX2__
#include <immintrin.h> #include <immintrin.h>
#include <sodium.h> #include <sodium.h>
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
// specializations. // specializations.
#include <folly/experimental/crypto/detail/LtHashInternal.h> #include <folly/experimental/crypto/detail/LtHashInternal.h>
#include <glog/logging.h>
#ifdef __SSE2__ #ifdef __SSE2__
#include <emmintrin.h> #include <emmintrin.h>
#include <sodium.h> #include <sodium.h>
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
// specializations. // specializations.
#include <folly/experimental/crypto/detail/LtHashInternal.h> #include <folly/experimental/crypto/detail/LtHashInternal.h>
#include <glog/logging.h>
#include <folly/Memory.h> #include <folly/Memory.h>
#include <folly/lang/Bits.h> #include <folly/lang/Bits.h>
......
...@@ -597,7 +597,7 @@ bool Dwarf::findAddress( ...@@ -597,7 +597,7 @@ bool Dwarf::findAddress(
// it only if such behavior is requested via LocationInfoMode. // it only if such behavior is requested via LocationInfoMode.
return false; return false;
} else { } else {
FOLLY_SAFE_DCHECK(mode == LocationInfoMode::FULL, "unexpected mode"); DCHECK(mode == LocationInfoMode::FULL);
// Fall back to the linear scan. // Fall back to the linear scan.
} }
} }
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/experimental/symbolizer/Dwarf.h> #include <folly/experimental/symbolizer/Dwarf.h>
#include <glog/logging.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
using folly::symbolizer::Dwarf; using folly::symbolizer::Dwarf;
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <random> #include <random>
#include <boost/thread.hpp> #include <boost/thread.hpp>
#include <glog/logging.h>
#include <folly/Random.h> #include <folly/Random.h>
#include <folly/experimental/FunctionScheduler.h> #include <folly/experimental/FunctionScheduler.h>
......
...@@ -13,13 +13,10 @@ ...@@ -13,13 +13,10 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <string> #include <string>
#include <tuple> #include <tuple>
#include <vector> #include <vector>
#include <glog/logging.h>
#include <folly/FBVector.h> #include <folly/FBVector.h>
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/gen/Base.h> #include <folly/gen/Base.h>
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <folly/json.h> #include <folly/json.h>
#include <algorithm> #include <algorithm>
...@@ -22,7 +21,6 @@ ...@@ -22,7 +21,6 @@
#include <type_traits> #include <type_traits>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <glog/logging.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/Portability.h> #include <folly/Portability.h>
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/json_patch.h> #include <folly/json_patch.h>
#include <glog/logging.h>
#include <folly/container/Enumerate.h> #include <folly/container/Enumerate.h>
namespace { namespace {
......
...@@ -15,9 +15,6 @@ ...@@ -15,9 +15,6 @@
*/ */
#include <folly/ssl/detail/SSLSessionImpl.h> #include <folly/ssl/detail/SSLSessionImpl.h>
#include <glog/logging.h>
#include <folly/portability/OpenSSL.h> #include <folly/portability/OpenSSL.h>
#include <folly/ssl/OpenSSLVersionFinder.h> #include <folly/ssl/OpenSSLVersionFinder.h>
......
...@@ -15,9 +15,6 @@ ...@@ -15,9 +15,6 @@
*/ */
#include <folly/stats/TDigest.h> #include <folly/stats/TDigest.h>
#include <glog/logging.h>
#include <folly/stats/detail/DoubleRadixSort.h> #include <folly/stats/detail/DoubleRadixSort.h>
#include <algorithm> #include <algorithm>
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#pragma once #pragma once
#include <cassert>
#include <cmath> #include <cmath>
#include <vector> #include <vector>
...@@ -54,7 +53,7 @@ class TDigest { ...@@ -54,7 +53,7 @@ class TDigest {
public: public:
explicit Centroid(double mean = 0.0, double weight = 1.0) explicit Centroid(double mean = 0.0, double weight = 1.0)
: mean_(mean), weight_(weight) { : mean_(mean), weight_(weight) {
assert(weight > 0); DCHECK_GT(weight, 0);
} }
inline double mean() const { inline double mean() const {
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#endif #endif
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <glog/logging.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/container/Foreach.h> #include <folly/container/Foreach.h>
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/dynamic.h> #include <folly/dynamic.h>
#include <glog/logging.h>
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/json.h> #include <folly/json.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <sstream> #include <sstream>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <glog/logging.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/Portability.h> #include <folly/Portability.h>
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/File.h> #include <folly/File.h>
#include <glog/logging.h>
#include <folly/String.h> #include <folly/String.h>
#include <folly/portability/Fcntl.h> #include <folly/portability/Fcntl.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <stdexcept> #include <stdexcept>
#include <glog/logging.h>
#include <folly/portability/GMock.h> #include <folly/portability/GMock.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/test/JsonMockUtil.h> #include <folly/test/JsonMockUtil.h>
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <set> #include <set>
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <glog/logging.h>
#include <folly/FBVector.h> #include <folly/FBVector.h>
#include <folly/container/Array.h> #include <folly/container/Array.h>
......
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