mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
Move entirety of llvm namespace to wpi namespace.
During shared library loading, a different libLLVM can be pulled in, causing llvm symbols from dependent libraries to resolve to that library instead of this one. This has been seen in the wild with the Mesa OpenGL implementation in JavaFX applications (see wpilibsuite/shuffleboard#361). This is clearly a very breaking change. For some level of backwards compatibility, a namespace alias from llvm to wpi is performed in the "llvm" headers. Unfortunately, forward declarations of llvm classes will still break, but compilers seem to generate clear error messages in those cases ("namespace alias 'llvm' not allowed here, assuming 'wpi'"). This change also moves all the wpiutil headers to a single "wpi" subdirectory from the previously split "llvm", "support", "tcpsockets", and "udpsockets". Shim headers will be added for backwards compatibility in a later commit.
This commit is contained in:
@@ -15,11 +15,11 @@
|
||||
#ifndef LLVM_SUPPORT_ALIGNOF_H
|
||||
#define LLVM_SUPPORT_ALIGNOF_H
|
||||
|
||||
#include "llvm/Compiler.h"
|
||||
#include "wpi/Compiler.h"
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
namespace detail {
|
||||
|
||||
@@ -71,8 +71,8 @@ template <typename T>
|
||||
struct AlignOf {
|
||||
#ifndef _MSC_VER
|
||||
// Avoid warnings from GCC like:
|
||||
// comparison between 'enum llvm::AlignOf<X>::<anonymous>' and 'enum
|
||||
// llvm::AlignOf<Y>::<anonymous>' [-Wenum-compare]
|
||||
// comparison between 'enum wpi::AlignOf<X>::<anonymous>' and 'enum
|
||||
// wpi::AlignOf<Y>::<anonymous>' [-Wenum-compare]
|
||||
// by using constexpr instead of enum.
|
||||
// (except on MSVC, since it doesn't support constexpr yet).
|
||||
static constexpr unsigned Alignment = static_cast<unsigned int>(
|
||||
@@ -80,7 +80,7 @@ struct AlignOf {
|
||||
#else
|
||||
enum {
|
||||
Alignment = static_cast<unsigned int>(
|
||||
sizeof(::llvm::detail::AlignmentCalcImpl<T>) - sizeof(T))
|
||||
sizeof(::wpi::detail::AlignmentCalcImpl<T>) - sizeof(T))
|
||||
};
|
||||
#endif
|
||||
enum { Alignment_GreaterEqual_2Bytes = Alignment >= 2 ? 1 : 0 };
|
||||
@@ -248,12 +248,12 @@ template <typename T1,
|
||||
typename T2 = char, typename T3 = char, typename T4 = char,
|
||||
typename T5 = char, typename T6 = char, typename T7 = char,
|
||||
typename T8 = char, typename T9 = char, typename T10 = char>
|
||||
struct AlignedCharArrayUnion : llvm::AlignedCharArray<
|
||||
AlignOf<llvm::detail::AlignerImpl<T1, T2, T3, T4, T5,
|
||||
struct AlignedCharArrayUnion : wpi::AlignedCharArray<
|
||||
AlignOf<wpi::detail::AlignerImpl<T1, T2, T3, T4, T5,
|
||||
T6, T7, T8, T9, T10> >::Alignment,
|
||||
sizeof(::llvm::detail::SizerImpl<T1, T2, T3, T4, T5,
|
||||
sizeof(::wpi::detail::SizerImpl<T1, T2, T3, T4, T5,
|
||||
T6, T7, T8, T9, T10>)> {
|
||||
};
|
||||
} // end namespace llvm
|
||||
} // end namespace wpi
|
||||
|
||||
#endif // LLVM_SUPPORT_ALIGNOF_H
|
||||
@@ -10,13 +10,13 @@
|
||||
#ifndef LLVM_ADT_ARRAYREF_H
|
||||
#define LLVM_ADT_ARRAYREF_H
|
||||
|
||||
#include "llvm/Compiler.h"
|
||||
#include "llvm/Hashing.h"
|
||||
#include "llvm/None.h"
|
||||
#include "llvm/SmallVector.h"
|
||||
#include "wpi/Compiler.h"
|
||||
#include "wpi/Hashing.h"
|
||||
#include "wpi/None.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
#include <vector>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
/// ArrayRef - Represent a constant reference to an array (0 or more elements
|
||||
/// consecutively in memory), i.e. a start pointer and a length. It allows
|
||||
/// various APIs to take consecutive elements easily and conveniently.
|
||||
@@ -392,6 +392,6 @@ namespace llvm {
|
||||
template <typename T> hash_code hash_value(ArrayRef<T> S) {
|
||||
return hash_combine_range(S.begin(), S.end());
|
||||
}
|
||||
} // end namespace llvm
|
||||
} // end namespace wpi
|
||||
|
||||
#endif // LLVM_ADT_ARRAYREF_H
|
||||
@@ -11,29 +11,25 @@
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
|
||||
#include "llvm/StringRef.h"
|
||||
#include "wpi/StringRef.h"
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
class raw_ostream;
|
||||
} // namespace llvm
|
||||
|
||||
namespace wpi {
|
||||
size_t Base64Decode(raw_ostream& os, StringRef encoded);
|
||||
|
||||
size_t Base64Decode(llvm::raw_ostream& os, llvm::StringRef encoded);
|
||||
size_t Base64Decode(StringRef encoded, std::string* plain);
|
||||
|
||||
size_t Base64Decode(llvm::StringRef encoded, std::string* plain);
|
||||
StringRef Base64Decode(StringRef encoded, size_t* num_read,
|
||||
SmallVectorImpl<char>& buf);
|
||||
|
||||
llvm::StringRef Base64Decode(llvm::StringRef encoded, size_t* num_read,
|
||||
llvm::SmallVectorImpl<char>& buf);
|
||||
void Base64Encode(raw_ostream& os, StringRef plain);
|
||||
|
||||
void Base64Encode(llvm::raw_ostream& os, llvm::StringRef plain);
|
||||
void Base64Encode(StringRef plain, std::string* encoded);
|
||||
|
||||
void Base64Encode(llvm::StringRef plain, std::string* encoded);
|
||||
|
||||
llvm::StringRef Base64Encode(llvm::StringRef plain,
|
||||
llvm::SmallVectorImpl<char>& buf);
|
||||
StringRef Base64Encode(StringRef plain, SmallVectorImpl<char>& buf);
|
||||
|
||||
} // namespace wpi
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include <thread>
|
||||
#include <utility>
|
||||
|
||||
#include "support/condition_variable.h"
|
||||
#include "support/mutex.h"
|
||||
#include "wpi/condition_variable.h"
|
||||
#include "wpi/mutex.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
@@ -180,10 +180,10 @@ unsigned getNumBytesForUTF8(UTF8 firstByte);
|
||||
/*************************************************************************/
|
||||
/* Below are LLVM-specific wrappers of the functions above. */
|
||||
|
||||
#include "llvm/ArrayRef.h"
|
||||
#include "llvm/StringRef.h"
|
||||
#include "wpi/ArrayRef.h"
|
||||
#include "wpi/StringRef.h"
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Convert an Unicode code point to UTF8 sequence.
|
||||
@@ -246,7 +246,7 @@ bool convertUTF16ToUTF8String(ArrayRef<UTF16> SrcUTF16,
|
||||
bool convertUTF8ToUTF16String(StringRef SrcUTF8,
|
||||
SmallVectorImpl<UTF16> &DstUTF16);
|
||||
|
||||
} /* end namespace llvm */
|
||||
} /* end namespace wpi */
|
||||
|
||||
#endif
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
#ifndef LLVM_ADT_DENSEMAP_H
|
||||
#define LLVM_ADT_DENSEMAP_H
|
||||
|
||||
#include "llvm/DenseMapInfo.h"
|
||||
#include "llvm/EpochTracker.h"
|
||||
#include "llvm/AlignOf.h"
|
||||
#include "llvm/Compiler.h"
|
||||
#include "llvm/MathExtras.h"
|
||||
#include "llvm/PointerLikeTypeTraits.h"
|
||||
#include "llvm/type_traits.h"
|
||||
#include "wpi/DenseMapInfo.h"
|
||||
#include "wpi/EpochTracker.h"
|
||||
#include "wpi/AlignOf.h"
|
||||
#include "wpi/Compiler.h"
|
||||
#include "wpi/MathExtras.h"
|
||||
#include "wpi/PointerLikeTypeTraits.h"
|
||||
#include "wpi/type_traits.h"
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <climits>
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <new>
|
||||
#include <utility>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
namespace detail {
|
||||
// We extend a pair to allow users to override the bucket type with their own
|
||||
@@ -1115,6 +1115,6 @@ capacity_in_bytes(const DenseMap<KeyT, ValueT, KeyInfoT> &X) {
|
||||
return X.getMemorySize();
|
||||
}
|
||||
|
||||
} // end namespace llvm
|
||||
} // end namespace wpi
|
||||
|
||||
#endif
|
||||
@@ -14,13 +14,13 @@
|
||||
#ifndef LLVM_ADT_DENSEMAPINFO_H
|
||||
#define LLVM_ADT_DENSEMAPINFO_H
|
||||
|
||||
#include "llvm/ArrayRef.h"
|
||||
#include "llvm/Hashing.h"
|
||||
#include "llvm/StringRef.h"
|
||||
#include "llvm/PointerLikeTypeTraits.h"
|
||||
#include "llvm/type_traits.h"
|
||||
#include "wpi/ArrayRef.h"
|
||||
#include "wpi/Hashing.h"
|
||||
#include "wpi/StringRef.h"
|
||||
#include "wpi/PointerLikeTypeTraits.h"
|
||||
#include "wpi/type_traits.h"
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
template<typename T>
|
||||
struct DenseMapInfo {
|
||||
@@ -246,6 +246,6 @@ template <typename T> struct DenseMapInfo<ArrayRef<T>> {
|
||||
}
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
} // end namespace wpi
|
||||
|
||||
#endif
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
#ifdef NDEBUG //ifndef LLVM_ENABLE_ABI_BREAKING_CHECKS
|
||||
|
||||
@@ -92,6 +92,6 @@ public:
|
||||
|
||||
#endif // LLVM_ENABLE_ABI_BREAKING_CHECKS
|
||||
|
||||
} // namespace llvm
|
||||
} // namespace wpi
|
||||
|
||||
#endif
|
||||
@@ -7,7 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file declares the llvm::sys::fs namespace. It is designed after
|
||||
// This file declares the wpi::sys::fs namespace. It is designed after
|
||||
// TR2/boost filesystem (v3), but modified to remove exception handling and the
|
||||
// path class.
|
||||
//
|
||||
@@ -27,9 +27,9 @@
|
||||
#ifndef LLVM_SUPPORT_FILESYSTEM_H
|
||||
#define LLVM_SUPPORT_FILESYSTEM_H
|
||||
|
||||
#include "llvm/IntrusiveRefCntPtr.h"
|
||||
#include "llvm/SmallString.h"
|
||||
#include "llvm/Twine.h"
|
||||
#include "wpi/IntrusiveRefCntPtr.h"
|
||||
#include "wpi/SmallString.h"
|
||||
#include "wpi/Twine.h"
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
namespace sys {
|
||||
namespace fs {
|
||||
|
||||
@@ -663,6 +663,6 @@ public:
|
||||
|
||||
} // end namespace fs
|
||||
} // end namespace sys
|
||||
} // end namespace llvm
|
||||
} // end namespace wpi
|
||||
|
||||
#endif // LLVM_SUPPORT_FILESYSTEM_H
|
||||
@@ -23,14 +23,14 @@
|
||||
#ifndef LLVM_SUPPORT_FORMAT_H
|
||||
#define LLVM_SUPPORT_FORMAT_H
|
||||
|
||||
#include "llvm/STLExtras.h"
|
||||
#include "llvm/StringRef.h"
|
||||
#include "wpi/STLExtras.h"
|
||||
#include "wpi/StringRef.h"
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <tuple>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
/// This is a helper class used for handling formatted output. It is the
|
||||
/// abstract base class of a templated derived class.
|
||||
@@ -197,6 +197,6 @@ inline FormattedNumber format_decimal(int64_t N, unsigned Width) {
|
||||
return FormattedNumber(0, N, Width, false, false, false);
|
||||
}
|
||||
|
||||
} // end namespace llvm
|
||||
} // end namespace wpi
|
||||
|
||||
#endif
|
||||
@@ -45,7 +45,7 @@
|
||||
#ifndef LLVM_ADT_HASHING_H
|
||||
#define LLVM_ADT_HASHING_H
|
||||
|
||||
#include "llvm/type_traits.h"
|
||||
#include "wpi/type_traits.h"
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
@@ -53,7 +53,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
/// \brief An opaque object representing a hash code.
|
||||
///
|
||||
@@ -64,8 +64,8 @@ namespace llvm {
|
||||
///
|
||||
/// In order to obtain the hash_code for an object 'x':
|
||||
/// \code
|
||||
/// using llvm::hash_value;
|
||||
/// llvm::hash_code code = hash_value(x);
|
||||
/// using wpi::hash_value;
|
||||
/// wpi::hash_code code = hash_value(x);
|
||||
/// \endcode
|
||||
class hash_code {
|
||||
size_t value;
|
||||
@@ -311,7 +311,7 @@ struct hash_state {
|
||||
|
||||
/// \brief A global, fixed seed-override variable.
|
||||
///
|
||||
/// This variable can be set using the \see llvm::set_fixed_execution_seed
|
||||
/// This variable can be set using the \see wpi::set_fixed_execution_seed
|
||||
/// function. See that function for details. Do not, under any circumstances,
|
||||
/// set or read this variable.
|
||||
extern size_t fixed_seed_override;
|
||||
@@ -370,7 +370,7 @@ get_hashable_data(const T &value) {
|
||||
template <typename T>
|
||||
typename std::enable_if<!is_hashable_data<T>::value, size_t>::type
|
||||
get_hashable_data(const T &value) {
|
||||
using ::llvm::hash_value;
|
||||
using ::wpi::hash_value;
|
||||
return hash_value(value);
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ hash_combine_range_impl(ValueT *first, ValueT *last) {
|
||||
/// a sequence of bytes.
|
||||
template <typename InputIteratorT>
|
||||
hash_code hash_combine_range(InputIteratorT first, InputIteratorT last) {
|
||||
return ::llvm::hashing::detail::hash_combine_range_impl(first, last);
|
||||
return ::wpi::hashing::detail::hash_combine_range_impl(first, last);
|
||||
}
|
||||
|
||||
|
||||
@@ -599,7 +599,7 @@ public:
|
||||
/// *not* call this routine, they should instead call 'hash_value'.
|
||||
template <typename ...Ts> hash_code hash_combine(const Ts &...args) {
|
||||
// Recursively hash each argument using a helper class.
|
||||
::llvm::hashing::detail::hash_combine_recursive_helper helper;
|
||||
::wpi::hashing::detail::hash_combine_recursive_helper helper;
|
||||
return helper.combine(0, helper.buffer, helper.buffer + 64, args...);
|
||||
}
|
||||
|
||||
@@ -629,14 +629,14 @@ inline hash_code hash_integer_value(uint64_t value) {
|
||||
template <typename T>
|
||||
typename std::enable_if<is_integral_or_enum<T>::value, hash_code>::type
|
||||
hash_value(T value) {
|
||||
return ::llvm::hashing::detail::hash_integer_value(
|
||||
return ::wpi::hashing::detail::hash_integer_value(
|
||||
static_cast<uint64_t>(value));
|
||||
}
|
||||
|
||||
// Declared and documented above, but defined here so that any of the hashing
|
||||
// infrastructure is available.
|
||||
template <typename T> hash_code hash_value(const T *ptr) {
|
||||
return ::llvm::hashing::detail::hash_integer_value(
|
||||
return ::wpi::hashing::detail::hash_integer_value(
|
||||
reinterpret_cast<uintptr_t>(ptr));
|
||||
}
|
||||
|
||||
@@ -654,6 +654,6 @@ hash_code hash_value(const std::basic_string<T> &arg) {
|
||||
return hash_combine_range(arg.begin(), arg.end());
|
||||
}
|
||||
|
||||
} // namespace llvm
|
||||
} // namespace wpi
|
||||
|
||||
#endif
|
||||
@@ -13,16 +13,16 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "llvm/ArrayRef.h"
|
||||
#include "llvm/SmallString.h"
|
||||
#include "llvm/SmallVector.h"
|
||||
#include "llvm/StringMap.h"
|
||||
#include "llvm/StringRef.h"
|
||||
#include "llvm/Twine.h"
|
||||
#include "support/raw_istream.h"
|
||||
#include "support/raw_socket_istream.h"
|
||||
#include "support/raw_socket_ostream.h"
|
||||
#include "tcpsockets/NetworkStream.h"
|
||||
#include "wpi/ArrayRef.h"
|
||||
#include "wpi/NetworkStream.h"
|
||||
#include "wpi/SmallString.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
#include "wpi/StringMap.h"
|
||||
#include "wpi/StringRef.h"
|
||||
#include "wpi/Twine.h"
|
||||
#include "wpi/raw_istream.h"
|
||||
#include "wpi/raw_socket_istream.h"
|
||||
#include "wpi/raw_socket_ostream.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
@@ -30,16 +30,15 @@ namespace wpi {
|
||||
// @param buf Buffer for output
|
||||
// @param error Set to true if an error occurred
|
||||
// @return Escaped string
|
||||
llvm::StringRef UnescapeURI(const llvm::Twine& str,
|
||||
llvm::SmallVectorImpl<char>& buf, bool* error);
|
||||
StringRef UnescapeURI(const Twine& str, SmallVectorImpl<char>& buf,
|
||||
bool* error);
|
||||
|
||||
// Escape a string with %xx-encoding.
|
||||
// @param buf Buffer for output
|
||||
// @param spacePlus If true, encodes spaces to '+' rather than "%20"
|
||||
// @return Escaped string
|
||||
llvm::StringRef EscapeURI(const llvm::Twine& str,
|
||||
llvm::SmallVectorImpl<char>& buf,
|
||||
bool spacePlus = true);
|
||||
StringRef EscapeURI(const Twine& str, SmallVectorImpl<char>& buf,
|
||||
bool spacePlus = true);
|
||||
|
||||
// Parse a set of HTTP headers. Saves just the Content-Type and Content-Length
|
||||
// fields.
|
||||
@@ -47,9 +46,8 @@ llvm::StringRef EscapeURI(const llvm::Twine& str,
|
||||
// @param contentType If not null, Content-Type contents are saved here.
|
||||
// @param contentLength If not null, Content-Length contents are saved here.
|
||||
// @return False if error occurred in input stream
|
||||
bool ParseHttpHeaders(wpi::raw_istream& is,
|
||||
llvm::SmallVectorImpl<char>* contentType,
|
||||
llvm::SmallVectorImpl<char>* contentLength);
|
||||
bool ParseHttpHeaders(raw_istream& is, SmallVectorImpl<char>* contentType,
|
||||
SmallVectorImpl<char>* contentLength);
|
||||
|
||||
// Look for a MIME multi-part boundary. On return, the input stream will
|
||||
// be located at the character following the boundary (usually "\r\n").
|
||||
@@ -58,13 +56,13 @@ bool ParseHttpHeaders(wpi::raw_istream& is,
|
||||
// @param saveBuf If not null, all scanned characters up to but not including
|
||||
// the boundary are saved to this string
|
||||
// @return False if error occurred on input stream, true if boundary found.
|
||||
bool FindMultipartBoundary(wpi::raw_istream& is, llvm::StringRef boundary,
|
||||
bool FindMultipartBoundary(wpi::raw_istream& is, StringRef boundary,
|
||||
std::string* saveBuf);
|
||||
|
||||
class HttpLocation {
|
||||
public:
|
||||
HttpLocation() = default;
|
||||
HttpLocation(const llvm::Twine& url_, bool* error, std::string* errorMsg);
|
||||
HttpLocation(const Twine& url_, bool* error, std::string* errorMsg);
|
||||
|
||||
std::string url; // retain copy
|
||||
std::string user; // unescaped
|
||||
@@ -89,38 +87,38 @@ class HttpRequest {
|
||||
template <typename T>
|
||||
HttpRequest(const HttpLocation& loc, const T& extraParams);
|
||||
|
||||
HttpRequest(const HttpLocation& loc, llvm::StringRef path_)
|
||||
HttpRequest(const HttpLocation& loc, StringRef path_)
|
||||
: host{loc.host}, port{loc.port}, path{path_} {
|
||||
SetAuth(loc);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
HttpRequest(const HttpLocation& loc, llvm::StringRef path_, const T& params)
|
||||
HttpRequest(const HttpLocation& loc, StringRef path_, const T& params)
|
||||
: host{loc.host}, port{loc.port} {
|
||||
SetPath(path_, params);
|
||||
SetAuth(loc);
|
||||
}
|
||||
|
||||
llvm::SmallString<128> host;
|
||||
SmallString<128> host;
|
||||
int port;
|
||||
std::string auth;
|
||||
llvm::SmallString<128> path;
|
||||
SmallString<128> path;
|
||||
|
||||
private:
|
||||
void SetAuth(const HttpLocation& loc);
|
||||
template <typename T>
|
||||
void SetPath(llvm::StringRef path_, const T& params);
|
||||
void SetPath(StringRef path_, const T& params);
|
||||
|
||||
template <typename T>
|
||||
static llvm::StringRef GetFirst(const T& elem) {
|
||||
static StringRef GetFirst(const T& elem) {
|
||||
return elem.first;
|
||||
}
|
||||
template <typename T>
|
||||
static llvm::StringRef GetFirst(const llvm::StringMapEntry<T>& elem) {
|
||||
static StringRef GetFirst(const StringMapEntry<T>& elem) {
|
||||
return elem.getKey();
|
||||
}
|
||||
template <typename T>
|
||||
static llvm::StringRef GetSecond(const T& elem) {
|
||||
static StringRef GetSecond(const T& elem) {
|
||||
return elem.second;
|
||||
}
|
||||
};
|
||||
@@ -137,8 +135,8 @@ class HttpConnection {
|
||||
wpi::raw_socket_ostream os;
|
||||
|
||||
// Valid after Handshake() is successful
|
||||
llvm::SmallString<64> contentType;
|
||||
llvm::SmallString<64> contentLength;
|
||||
SmallString<64> contentType;
|
||||
SmallString<64> contentLength;
|
||||
|
||||
explicit operator bool() const { return stream && !is.has_error(); }
|
||||
};
|
||||
@@ -13,19 +13,19 @@ namespace wpi {
|
||||
template <typename T>
|
||||
HttpRequest::HttpRequest(const HttpLocation& loc, const T& extraParams)
|
||||
: host{loc.host}, port{loc.port} {
|
||||
llvm::SmallVector<std::pair<llvm::StringRef, llvm::StringRef>, 8> params;
|
||||
StringMap<StringRef> params;
|
||||
for (const auto& p : loc.params)
|
||||
params.emplace_back(std::make_pair(GetFirst(p), GetSecond(p)));
|
||||
params.insert(std::make_pair(GetFirst(p), GetSecond(p)));
|
||||
for (const auto& p : extraParams)
|
||||
params.emplace_back(std::make_pair(GetFirst(p), GetSecond(p)));
|
||||
params.insert(std::make_pair(GetFirst(p), GetSecond(p)));
|
||||
SetPath(loc.path, params);
|
||||
SetAuth(loc);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void HttpRequest::SetPath(llvm::StringRef path_, const T& params) {
|
||||
void HttpRequest::SetPath(StringRef path_, const T& params) {
|
||||
// Build location including query string
|
||||
llvm::raw_svector_ostream pathOs{path};
|
||||
raw_svector_ostream pathOs{path};
|
||||
pathOs << path_;
|
||||
bool first = true;
|
||||
for (const auto& param : params) {
|
||||
@@ -35,7 +35,7 @@ void HttpRequest::SetPath(llvm::StringRef path_, const T& params) {
|
||||
} else {
|
||||
pathOs << '&';
|
||||
}
|
||||
llvm::SmallString<64> escapeBuf;
|
||||
SmallString<64> escapeBuf;
|
||||
pathOs << EscapeURI(GetFirst(param), escapeBuf);
|
||||
if (!GetSecond(param).empty()) {
|
||||
pathOs << '=' << EscapeURI(GetSecond(param), escapeBuf);
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
template <class T>
|
||||
class IntrusiveRefCntPtr;
|
||||
@@ -89,7 +89,7 @@ namespace llvm {
|
||||
static void release(T *obj) { obj->Release(); }
|
||||
};
|
||||
|
||||
/// \brief A thread-safe version of \c llvm::RefCountedBase.
|
||||
/// \brief A thread-safe version of \c wpi::RefCountedBase.
|
||||
///
|
||||
/// A generic base class for objects that wish to have their lifetimes managed
|
||||
/// using reference counts. Classes subclass \c ThreadSafeRefCountedBase to
|
||||
@@ -283,6 +283,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
} // end namespace wpi
|
||||
|
||||
#endif // LLVM_ADT_INTRUSIVEREFCNTPTR_H
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "llvm/SmallString.h"
|
||||
#include "llvm/raw_ostream.h"
|
||||
#include "wpi/SmallString.h"
|
||||
#include "wpi/raw_ostream.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
@@ -60,8 +60,8 @@ class Logger {
|
||||
do { \
|
||||
::wpi::Logger& WPI_logger_ = logger_inst; \
|
||||
if (WPI_logger_.min_level() <= level && WPI_logger_.HasLogger()) { \
|
||||
llvm::SmallString<128> log_buf_; \
|
||||
llvm::raw_svector_ostream log_os_{log_buf_}; \
|
||||
::wpi::SmallString<128> log_buf_; \
|
||||
::wpi::raw_svector_ostream log_os_{log_buf_}; \
|
||||
log_os_ << x; \
|
||||
WPI_logger_.Log(level, __FILE__, __LINE__, log_buf_.c_str()); \
|
||||
} \
|
||||
@@ -14,7 +14,7 @@
|
||||
#ifndef LLVM_SUPPORT_MATHEXTRAS_H
|
||||
#define LLVM_SUPPORT_MATHEXTRAS_H
|
||||
|
||||
#include "llvm/Compiler.h"
|
||||
#include "wpi/Compiler.h"
|
||||
#include <cstdint>
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
/// \brief The behavior an operation has on an input of 0.
|
||||
enum ZeroBehavior {
|
||||
/// \brief The returned value is undefined.
|
||||
@@ -648,6 +648,6 @@ SaturatingMultiplyAdd(T X, T Y, T A, bool *ResultOverflowed = nullptr) {
|
||||
return SaturatingAdd(A, Product, &Overflowed);
|
||||
}
|
||||
|
||||
} // namespace llvm
|
||||
} // namespace wpi
|
||||
|
||||
#endif
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "tcpsockets/NetworkStream.h"
|
||||
#include "wpi/NetworkStream.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include "llvm/StringRef.h"
|
||||
#include "wpi/StringRef.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
@@ -31,7 +31,7 @@ class NetworkStream {
|
||||
int timeout = 0) = 0;
|
||||
virtual void close() = 0;
|
||||
|
||||
virtual llvm::StringRef getPeerIP() const = 0;
|
||||
virtual StringRef getPeerIP() const = 0;
|
||||
virtual int getPeerPort() const = 0;
|
||||
virtual void setNoDelay() = 0;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifndef LLVM_ADT_NONE_H
|
||||
#define LLVM_ADT_NONE_H
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
/// \brief A simple null object to allow implicit construction of Optional<T>
|
||||
/// and similar types without having to spell out the specialization's name.
|
||||
enum class NoneType { None };
|
||||
@@ -16,14 +16,14 @@
|
||||
#ifndef LLVM_ADT_OPTIONAL_H
|
||||
#define LLVM_ADT_OPTIONAL_H
|
||||
|
||||
#include "llvm/None.h"
|
||||
#include "llvm/AlignOf.h"
|
||||
#include "llvm/Compiler.h"
|
||||
#include "wpi/None.h"
|
||||
#include "wpi/AlignOf.h"
|
||||
#include "wpi/Compiler.h"
|
||||
#include <cassert>
|
||||
#include <new>
|
||||
#include <utility>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
template<typename T>
|
||||
class Optional {
|
||||
@@ -223,6 +223,6 @@ void operator>=(const Optional<T> &X, const Optional<U> &Y);
|
||||
template<typename T, typename U>
|
||||
void operator>(const Optional<T> &X, const Optional<U> &Y);
|
||||
|
||||
} // end llvm namespace
|
||||
} // end wpi namespace
|
||||
|
||||
#endif
|
||||
@@ -7,7 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file declares the llvm::sys::path namespace. It is designed after
|
||||
// This file declares the wpi::sys::path namespace. It is designed after
|
||||
// TR2/boost filesystem (v3), but modified to remove exception handling and the
|
||||
// path class.
|
||||
//
|
||||
@@ -16,12 +16,12 @@
|
||||
#ifndef LLVM_SUPPORT_PATH_H
|
||||
#define LLVM_SUPPORT_PATH_H
|
||||
|
||||
#include "llvm/Twine.h"
|
||||
#include "wpi/Twine.h"
|
||||
#include <iterator>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
namespace sys {
|
||||
namespace path {
|
||||
|
||||
@@ -452,6 +452,6 @@ bool remove_dots(SmallVectorImpl<char> &path, bool remove_dot_dot = false);
|
||||
|
||||
} // end namespace path
|
||||
} // end namespace sys
|
||||
} // end namespace llvm
|
||||
} // end namespace wpi
|
||||
|
||||
#endif
|
||||
@@ -15,10 +15,10 @@
|
||||
#ifndef LLVM_SUPPORT_POINTERLIKETYPETRAITS_H
|
||||
#define LLVM_SUPPORT_POINTERLIKETYPETRAITS_H
|
||||
|
||||
#include "llvm/AlignOf.h"
|
||||
#include "wpi/AlignOf.h"
|
||||
#include <cstdint>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
/// A traits type that is used to handle pointer types and things that are just
|
||||
/// wrappers for pointers as a uniform entity.
|
||||
@@ -89,6 +89,6 @@ public:
|
||||
enum { NumLowBitsAvailable = 0 };
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
} // end namespace wpi
|
||||
|
||||
#endif
|
||||
@@ -26,10 +26,10 @@
|
||||
#include <memory>
|
||||
#include <utility> // for std::pair
|
||||
|
||||
#include "llvm/iterator_range.h"
|
||||
#include "llvm/Compiler.h"
|
||||
#include "wpi/iterator_range.h"
|
||||
#include "wpi/Compiler.h"
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Extra additions to <functional>
|
||||
@@ -229,10 +229,10 @@ template <typename ContainerTy>
|
||||
auto reverse(
|
||||
ContainerTy &&C,
|
||||
typename std::enable_if<!has_rbegin<ContainerTy>::value>::type * = nullptr)
|
||||
-> decltype(make_range(llvm::make_reverse_iterator(std::end(C)),
|
||||
llvm::make_reverse_iterator(std::begin(C)))) {
|
||||
return make_range(llvm::make_reverse_iterator(std::end(C)),
|
||||
llvm::make_reverse_iterator(std::begin(C)));
|
||||
-> decltype(make_range(wpi::make_reverse_iterator(std::end(C)),
|
||||
wpi::make_reverse_iterator(std::begin(C)))) {
|
||||
return make_range(wpi::make_reverse_iterator(std::end(C)),
|
||||
wpi::make_reverse_iterator(std::begin(C)));
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
@@ -516,6 +516,6 @@ template <typename T> struct deref {
|
||||
}
|
||||
};
|
||||
|
||||
} // End llvm namespace
|
||||
} // End wpi namespace
|
||||
|
||||
#endif
|
||||
@@ -11,8 +11,8 @@
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
|
||||
#include "support/condition_variable.h"
|
||||
#include "support/mutex.h"
|
||||
#include "wpi/condition_variable.h"
|
||||
#include "wpi/mutex.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
#ifndef LLVM_ADT_SMALLPTRSET_H
|
||||
#define LLVM_ADT_SMALLPTRSET_H
|
||||
|
||||
#include "llvm/Compiler.h"
|
||||
#include "llvm/PointerLikeTypeTraits.h"
|
||||
#include "wpi/Compiler.h"
|
||||
#include "wpi/PointerLikeTypeTraits.h"
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <iterator>
|
||||
#include <utility>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
class SmallPtrSetIteratorImpl;
|
||||
|
||||
@@ -398,7 +398,7 @@ public:
|
||||
namespace std {
|
||||
/// Implement std::swap in terms of SmallPtrSet swap.
|
||||
template<class T, unsigned N>
|
||||
inline void swap(llvm::SmallPtrSet<T, N> &LHS, llvm::SmallPtrSet<T, N> &RHS) {
|
||||
inline void swap(wpi::SmallPtrSet<T, N> &LHS, wpi::SmallPtrSet<T, N> &RHS) {
|
||||
LHS.swap(RHS);
|
||||
}
|
||||
}
|
||||
@@ -14,12 +14,12 @@
|
||||
#ifndef LLVM_ADT_SMALLSET_H
|
||||
#define LLVM_ADT_SMALLSET_H
|
||||
|
||||
#include "llvm/None.h"
|
||||
#include "llvm/SmallPtrSet.h"
|
||||
#include "llvm/SmallVector.h"
|
||||
#include "wpi/None.h"
|
||||
#include "wpi/SmallPtrSet.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
#include <set>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
/// SmallSet - This maintains a set of unique values, optimizing for the case
|
||||
/// when the set is small (less than N). In this case, the set can be
|
||||
@@ -131,6 +131,6 @@ private:
|
||||
template <typename PointeeType, unsigned N>
|
||||
class SmallSet<PointeeType*, N> : public SmallPtrSet<PointeeType*, N> {};
|
||||
|
||||
} // end namespace llvm
|
||||
} // end namespace wpi
|
||||
|
||||
#endif
|
||||
@@ -14,10 +14,10 @@
|
||||
#ifndef LLVM_ADT_SMALLSTRING_H
|
||||
#define LLVM_ADT_SMALLSTRING_H
|
||||
|
||||
#include "llvm/SmallVector.h"
|
||||
#include "llvm/StringRef.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
#include "wpi/StringRef.h"
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
/// SmallString - A SmallString is just a SmallVector with methods and accessors
|
||||
/// that make it work better as a string (e.g. operator+ etc).
|
||||
@@ -14,11 +14,11 @@
|
||||
#ifndef LLVM_ADT_SMALLVECTOR_H
|
||||
#define LLVM_ADT_SMALLVECTOR_H
|
||||
|
||||
#include "llvm/iterator_range.h"
|
||||
#include "llvm/AlignOf.h"
|
||||
#include "llvm/Compiler.h"
|
||||
#include "llvm/MathExtras.h"
|
||||
#include "llvm/type_traits.h"
|
||||
#include "wpi/iterator_range.h"
|
||||
#include "wpi/AlignOf.h"
|
||||
#include "wpi/Compiler.h"
|
||||
#include "wpi/MathExtras.h"
|
||||
#include "wpi/type_traits.h"
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
/// This is all the non-templated stuff common to all SmallVectors.
|
||||
class SmallVectorBase {
|
||||
@@ -70,7 +70,7 @@ private:
|
||||
// Allocate raw space for N elements of type T. If T has a ctor or dtor, we
|
||||
// don't want it to be automatically run, so we need to represent the space as
|
||||
// something else. Use an array of char of sufficient alignment.
|
||||
typedef llvm::AlignedCharArrayUnion<T> U;
|
||||
typedef wpi::AlignedCharArrayUnion<T> U;
|
||||
U FirstEl;
|
||||
// Space after 'FirstEl' is clobbered, do not add any instance vars after it.
|
||||
|
||||
@@ -849,7 +849,7 @@ public:
|
||||
}
|
||||
|
||||
template <typename RangeTy>
|
||||
explicit SmallVector(const llvm::iterator_range<RangeTy> R)
|
||||
explicit SmallVector(const wpi::iterator_range<RangeTy> R)
|
||||
: SmallVectorImpl<T>(N) {
|
||||
this->append(R.begin(), R.end());
|
||||
}
|
||||
@@ -899,20 +899,20 @@ static inline size_t capacity_in_bytes(const SmallVector<T, N> &X) {
|
||||
return X.capacity_in_bytes();
|
||||
}
|
||||
|
||||
} // End llvm namespace
|
||||
} // End wpi namespace
|
||||
|
||||
namespace std {
|
||||
/// Implement std::swap in terms of SmallVector swap.
|
||||
template<typename T>
|
||||
inline void
|
||||
swap(llvm::SmallVectorImpl<T> &LHS, llvm::SmallVectorImpl<T> &RHS) {
|
||||
swap(wpi::SmallVectorImpl<T> &LHS, wpi::SmallVectorImpl<T> &RHS) {
|
||||
LHS.swap(RHS);
|
||||
}
|
||||
|
||||
/// Implement std::swap in terms of SmallVector swap.
|
||||
template<typename T, unsigned N>
|
||||
inline void
|
||||
swap(llvm::SmallVector<T, N> &LHS, llvm::SmallVector<T, N> &RHS) {
|
||||
swap(wpi::SmallVector<T, N> &LHS, wpi::SmallVector<T, N> &RHS) {
|
||||
LHS.swap(RHS);
|
||||
}
|
||||
}
|
||||
@@ -14,11 +14,11 @@
|
||||
#ifndef LLVM_ADT_STRINGEXTRAS_H
|
||||
#define LLVM_ADT_STRINGEXTRAS_H
|
||||
|
||||
#include "llvm/StringRef.h"
|
||||
#include "wpi/StringRef.h"
|
||||
#include <cstdint>
|
||||
#include <iterator>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
template<typename T> class SmallVectorImpl;
|
||||
|
||||
/// hexdigit - Return the hexadecimal character for the
|
||||
@@ -192,6 +192,6 @@ inline std::string join(IteratorT Begin, IteratorT End, StringRef Separator) {
|
||||
return join_impl(Begin, End, Separator, tag());
|
||||
}
|
||||
|
||||
} // End llvm namespace
|
||||
} // End wpi namespace
|
||||
|
||||
#endif
|
||||
@@ -14,15 +14,15 @@
|
||||
#ifndef LLVM_ADT_STRINGMAP_H
|
||||
#define LLVM_ADT_STRINGMAP_H
|
||||
|
||||
#include "llvm/SmallVector.h"
|
||||
#include "llvm/StringRef.h"
|
||||
#include "llvm/PointerLikeTypeTraits.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
#include "wpi/StringRef.h"
|
||||
#include "wpi/PointerLikeTypeTraits.h"
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <utility>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
template<typename ValueT>
|
||||
class StringMapConstIterator;
|
||||
template<typename ValueT>
|
||||
@@ -558,6 +558,6 @@ inline bool operator>=(const StringMap<ValueTy>& lhs,
|
||||
return !(lhs < rhs);
|
||||
}
|
||||
|
||||
} // namespace llvm
|
||||
} // namespace wpi
|
||||
|
||||
#endif
|
||||
@@ -10,8 +10,8 @@
|
||||
#ifndef LLVM_ADT_STRINGREF_H
|
||||
#define LLVM_ADT_STRINGREF_H
|
||||
|
||||
#include "llvm/iterator_range.h"
|
||||
#include "llvm/Compiler.h"
|
||||
#include "wpi/iterator_range.h"
|
||||
#include "wpi/Compiler.h"
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
class hash_code;
|
||||
@@ -140,7 +140,7 @@ namespace llvm {
|
||||
|
||||
/// c_str - Get a null terminated pointer to the start of the string
|
||||
/// If string is not null terminated, use buffer to store new string
|
||||
const char *c_str(llvm::SmallVectorImpl<char>& buf) const;
|
||||
const char *c_str(wpi::SmallVectorImpl<char>& buf) const;
|
||||
|
||||
/// empty - Check if the string is empty.
|
||||
bool empty() const { return size() == 0; }
|
||||
@@ -621,6 +621,6 @@ namespace llvm {
|
||||
// StringRefs can be treated like a POD type.
|
||||
template <typename T> struct isPodLike;
|
||||
template <> struct isPodLike<StringRef> { static const bool value = true; };
|
||||
} // namespace llvm
|
||||
} // namespace wpi
|
||||
|
||||
#endif
|
||||
@@ -28,8 +28,8 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "tcpsockets/NetworkAcceptor.h"
|
||||
#include "tcpsockets/TCPStream.h"
|
||||
#include "wpi/NetworkAcceptor.h"
|
||||
#include "wpi/TCPStream.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "llvm/ArrayRef.h"
|
||||
#include "tcpsockets/NetworkStream.h"
|
||||
#include "wpi/ArrayRef.h"
|
||||
#include "wpi/NetworkStream.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
@@ -40,7 +40,7 @@ class TCPConnector {
|
||||
Logger& logger,
|
||||
int timeout = 0);
|
||||
static std::unique_ptr<NetworkStream> connect_parallel(
|
||||
llvm::ArrayRef<std::pair<const char*, int>> servers, Logger& logger,
|
||||
ArrayRef<std::pair<const char*, int>> servers, Logger& logger,
|
||||
int timeout = 0);
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
|
||||
#include "tcpsockets/NetworkStream.h"
|
||||
#include "wpi/NetworkStream.h"
|
||||
|
||||
struct sockaddr_in;
|
||||
|
||||
@@ -50,7 +50,7 @@ class TCPStream : public NetworkStream {
|
||||
int timeout = 0) override;
|
||||
void close() override;
|
||||
|
||||
llvm::StringRef getPeerIP() const override;
|
||||
StringRef getPeerIP() const override;
|
||||
int getPeerPort() const override;
|
||||
void setNoDelay() override;
|
||||
bool setBlocking(bool enabled) override;
|
||||
@@ -10,14 +10,14 @@
|
||||
#ifndef LLVM_ADT_TWINE_H
|
||||
#define LLVM_ADT_TWINE_H
|
||||
|
||||
#include "llvm/SmallVector.h"
|
||||
#include "llvm/StringRef.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
#include "wpi/StringRef.h"
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
class raw_ostream;
|
||||
|
||||
/// Twine - A lightweight data structure for efficiently representing the
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "llvm/ArrayRef.h"
|
||||
#include "llvm/StringRef.h"
|
||||
#include "support/mutex.h"
|
||||
#include "wpi/ArrayRef.h"
|
||||
#include "wpi/StringRef.h"
|
||||
#include "wpi/mutex.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
@@ -25,7 +25,7 @@ class UDPClient {
|
||||
|
||||
public:
|
||||
explicit UDPClient(Logger& logger);
|
||||
UDPClient(llvm::StringRef address, Logger& logger);
|
||||
UDPClient(StringRef address, Logger& logger);
|
||||
UDPClient(const UDPClient& other) = delete;
|
||||
UDPClient(UDPClient&& other);
|
||||
~UDPClient();
|
||||
@@ -36,8 +36,8 @@ class UDPClient {
|
||||
int start();
|
||||
void shutdown();
|
||||
// The passed in address MUST be a resolved IP address.
|
||||
int send(llvm::ArrayRef<uint8_t> data, llvm::StringRef server, int port);
|
||||
int send(llvm::StringRef data, llvm::StringRef server, int port);
|
||||
int send(ArrayRef<uint8_t> data, StringRef server, int port);
|
||||
int send(StringRef data, StringRef server, int port);
|
||||
};
|
||||
|
||||
} // namespace wpi
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <system_error>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
std::error_code mapWindowsError(unsigned EV);
|
||||
}
|
||||
|
||||
@@ -10,16 +10,14 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "llvm/StringRef.h"
|
||||
|
||||
namespace llvm {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
} // namespace llvm
|
||||
#include "wpi/StringRef.h"
|
||||
|
||||
namespace wpi {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
|
||||
std::string GetHostname();
|
||||
llvm::StringRef GetHostname(llvm::SmallVectorImpl<char>& name);
|
||||
StringRef GetHostname(SmallVectorImpl<char>& name);
|
||||
} // namespace wpi
|
||||
|
||||
#endif // WPIUTIL_SUPPORT_HOSTNAME_H_
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <utility>
|
||||
#include <iterator>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
/// \brief A range adaptor for a pair of iterators.
|
||||
///
|
||||
@@ -16,16 +16,16 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "llvm/ArrayRef.h"
|
||||
#include "llvm/ConvertUTF.h"
|
||||
#include "llvm/SmallString.h"
|
||||
#include "llvm/SmallVector.h"
|
||||
#include "llvm/StringRef.h"
|
||||
#include "llvm/raw_ostream.h"
|
||||
#include "support/SafeThread.h"
|
||||
#include "support/atomic_static.h"
|
||||
#include "support/deprecated.h"
|
||||
#include "support/mutex.h"
|
||||
#include "wpi/ArrayRef.h"
|
||||
#include "wpi/ConvertUTF.h"
|
||||
#include "wpi/SafeThread.h"
|
||||
#include "wpi/SmallString.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
#include "wpi/StringRef.h"
|
||||
#include "wpi/atomic_static.h"
|
||||
#include "wpi/deprecated.h"
|
||||
#include "wpi/mutex.h"
|
||||
#include "wpi/raw_ostream.h"
|
||||
|
||||
namespace wpi {
|
||||
namespace java {
|
||||
@@ -33,9 +33,8 @@ namespace java {
|
||||
// Gets a Java stack trace. Also provides the last function
|
||||
// in the stack trace not starting with excludeFuncPrefix (useful for e.g.
|
||||
// finding the first user call to a series of library functions).
|
||||
std::string GetJavaStackTrace(
|
||||
JNIEnv* env, std::string* func = nullptr,
|
||||
llvm::StringRef excludeFuncPrefix = llvm::StringRef());
|
||||
std::string GetJavaStackTrace(JNIEnv* env, std::string* func = nullptr,
|
||||
StringRef excludeFuncPrefix = StringRef());
|
||||
|
||||
// Shim for backwards compatibility
|
||||
template <const char* excludeFuncPrefix>
|
||||
@@ -43,7 +42,7 @@ WPI_DEPRECATED("use StringRef function instead")
|
||||
std::string GetJavaStackTrace(JNIEnv* env, std::string* func) {
|
||||
return GetJavaStackTrace(
|
||||
env, func,
|
||||
excludeFuncPrefix == nullptr ? llvm::StringRef() : excludeFuncPrefix);
|
||||
excludeFuncPrefix == nullptr ? StringRef() : excludeFuncPrefix);
|
||||
}
|
||||
|
||||
|
||||
@@ -139,25 +138,25 @@ class JStringRef {
|
||||
jsize size = env->GetStringLength(str);
|
||||
const jchar* chars = env->GetStringCritical(str, nullptr);
|
||||
if (chars) {
|
||||
llvm::convertUTF16ToUTF8String(llvm::makeArrayRef(chars, size), m_str);
|
||||
convertUTF16ToUTF8String(makeArrayRef(chars, size), m_str);
|
||||
env->ReleaseStringCritical(str, chars);
|
||||
}
|
||||
} else {
|
||||
llvm::errs() << "JStringRef was passed a null pointer at \n"
|
||||
<< GetJavaStackTrace(env);
|
||||
errs() << "JStringRef was passed a null pointer at \n"
|
||||
<< GetJavaStackTrace(env);
|
||||
}
|
||||
// Ensure str is null-terminated.
|
||||
m_str.push_back('\0');
|
||||
m_str.pop_back();
|
||||
}
|
||||
|
||||
operator llvm::StringRef() const { return m_str; }
|
||||
llvm::StringRef str() const { return m_str; }
|
||||
operator StringRef() const { return m_str; }
|
||||
StringRef str() const { return m_str; }
|
||||
const char* c_str() const { return m_str.data(); }
|
||||
size_t size() const { return m_str.size(); }
|
||||
|
||||
private:
|
||||
llvm::SmallString<128> m_str;
|
||||
SmallString<128> m_str;
|
||||
};
|
||||
|
||||
// Details for J*ArrayRef and CriticalJ*ArrayRef
|
||||
@@ -170,13 +169,12 @@ class JArrayRefInner {};
|
||||
template <typename C>
|
||||
class JArrayRefInner<C, jbyte> {
|
||||
public:
|
||||
operator llvm::StringRef() const { return str(); }
|
||||
operator StringRef() const { return str(); }
|
||||
|
||||
llvm::StringRef str() const {
|
||||
StringRef str() const {
|
||||
auto arr = static_cast<const C*>(this)->array();
|
||||
if (arr.empty()) return llvm::StringRef{};
|
||||
return llvm::StringRef{reinterpret_cast<const char*>(arr.data()),
|
||||
arr.size()};
|
||||
if (arr.empty()) return StringRef{};
|
||||
return StringRef{reinterpret_cast<const char*>(arr.data()), arr.size()};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -186,11 +184,11 @@ class JArrayRefBase : public JArrayRefInner<JArrayRefBase<T>, T> {
|
||||
public:
|
||||
explicit operator bool() const { return this->m_elements != nullptr; }
|
||||
|
||||
operator llvm::ArrayRef<T>() const { return array(); }
|
||||
operator ArrayRef<T>() const { return array(); }
|
||||
|
||||
llvm::ArrayRef<T> array() const {
|
||||
if (!this->m_elements) return llvm::ArrayRef<T>{};
|
||||
return llvm::ArrayRef<T>{this->m_elements, this->m_size};
|
||||
ArrayRef<T> array() const {
|
||||
if (!this->m_elements) return ArrayRef<T>{};
|
||||
return ArrayRef<T>{this->m_elements, this->m_size};
|
||||
}
|
||||
|
||||
JArrayRefBase(const JArrayRefBase&) = delete;
|
||||
@@ -249,16 +247,16 @@ class JArrayRefBase : public JArrayRefInner<JArrayRefBase<T>, T> {
|
||||
static_cast<T*>(bb ? env->GetDirectBufferAddress(bb) : nullptr), \
|
||||
len) { \
|
||||
if (!bb) \
|
||||
llvm::errs() << "JArrayRef was passed a null pointer at \n" \
|
||||
<< GetJavaStackTrace(env); \
|
||||
errs() << "JArrayRef was passed a null pointer at \n" \
|
||||
<< GetJavaStackTrace(env); \
|
||||
} \
|
||||
J##F##ArrayRef(JNIEnv* env, T##Array jarr) \
|
||||
: detail::JArrayRefBase<T>(env, jarr) { \
|
||||
if (jarr) \
|
||||
m_elements = env->Get##F##ArrayElements(jarr, nullptr); \
|
||||
else \
|
||||
llvm::errs() << "JArrayRef was passed a null pointer at \n" \
|
||||
<< GetJavaStackTrace(env); \
|
||||
errs() << "JArrayRef was passed a null pointer at \n" \
|
||||
<< GetJavaStackTrace(env); \
|
||||
} \
|
||||
~J##F##ArrayRef() { \
|
||||
if (m_jarr && m_elements) \
|
||||
@@ -275,8 +273,8 @@ class JArrayRefBase : public JArrayRefInner<JArrayRefBase<T>, T> {
|
||||
m_elements = \
|
||||
static_cast<T*>(env->GetPrimitiveArrayCritical(jarr, nullptr)); \
|
||||
else \
|
||||
llvm::errs() << "JArrayRef was passed a null pointer at \n" \
|
||||
<< GetJavaStackTrace(env); \
|
||||
errs() << "JArrayRef was passed a null pointer at \n" \
|
||||
<< GetJavaStackTrace(env); \
|
||||
} \
|
||||
~CriticalJ##F##ArrayRef() { \
|
||||
if (m_jarr && m_elements) \
|
||||
@@ -299,9 +297,9 @@ WPI_JNI_JARRAYREF(jdouble, Double)
|
||||
//
|
||||
|
||||
// Convert a UTF8 string into a jstring.
|
||||
inline jstring MakeJString(JNIEnv* env, llvm::StringRef str) {
|
||||
llvm::SmallVector<UTF16, 128> chars;
|
||||
llvm::convertUTF8ToUTF16String(str, chars);
|
||||
inline jstring MakeJString(JNIEnv* env, StringRef str) {
|
||||
SmallVector<UTF16, 128> chars;
|
||||
convertUTF8ToUTF16String(str, chars);
|
||||
return env->NewString(chars.begin(), chars.size());
|
||||
}
|
||||
|
||||
@@ -314,7 +312,7 @@ namespace detail {
|
||||
template <typename T,
|
||||
bool = (std::is_integral<T>::value && sizeof(jint) == sizeof(T))>
|
||||
struct ConvertIntArray {
|
||||
static jintArray ToJava(JNIEnv* env, llvm::ArrayRef<T> arr) {
|
||||
static jintArray ToJava(JNIEnv* env, ArrayRef<T> arr) {
|
||||
jintArray jarr = env->NewIntArray(arr.size());
|
||||
if (!jarr) return nullptr;
|
||||
jint* elements =
|
||||
@@ -330,7 +328,7 @@ struct ConvertIntArray {
|
||||
// Fast path (use SetIntArrayRegion)
|
||||
template <typename T>
|
||||
struct ConvertIntArray<T, true> {
|
||||
static jintArray ToJava(JNIEnv* env, llvm::ArrayRef<T> arr) {
|
||||
static jintArray ToJava(JNIEnv* env, ArrayRef<T> arr) {
|
||||
jintArray jarr = env->NewIntArray(arr.size());
|
||||
if (!jarr) return nullptr;
|
||||
env->SetIntArrayRegion(jarr, 0, arr.size(),
|
||||
@@ -343,15 +341,14 @@ struct ConvertIntArray<T, true> {
|
||||
|
||||
// Convert an ArrayRef to a jintArray.
|
||||
template <typename T>
|
||||
inline jintArray MakeJIntArray(JNIEnv* env, llvm::ArrayRef<T> arr) {
|
||||
inline jintArray MakeJIntArray(JNIEnv* env, ArrayRef<T> arr) {
|
||||
return detail::ConvertIntArray<T>::ToJava(env, arr);
|
||||
}
|
||||
|
||||
// Convert a SmallVector to a jintArray. This is required in addition to
|
||||
// ArrayRef because template resolution occurs prior to implicit conversions.
|
||||
template <typename T>
|
||||
inline jintArray MakeJIntArray(JNIEnv* env,
|
||||
const llvm::SmallVectorImpl<T>& arr) {
|
||||
inline jintArray MakeJIntArray(JNIEnv* env, const SmallVectorImpl<T>& arr) {
|
||||
return detail::ConvertIntArray<T>::ToJava(env, arr);
|
||||
}
|
||||
|
||||
@@ -363,7 +360,7 @@ inline jintArray MakeJIntArray(JNIEnv* env, const std::vector<T>& arr) {
|
||||
}
|
||||
|
||||
// Convert a StringRef into a jbyteArray.
|
||||
inline jbyteArray MakeJByteArray(JNIEnv* env, llvm::StringRef str) {
|
||||
inline jbyteArray MakeJByteArray(JNIEnv* env, StringRef str) {
|
||||
jbyteArray jarr = env->NewByteArray(str.size());
|
||||
if (!jarr) return nullptr;
|
||||
env->SetByteArrayRegion(jarr, 0, str.size(),
|
||||
@@ -372,7 +369,7 @@ inline jbyteArray MakeJByteArray(JNIEnv* env, llvm::StringRef str) {
|
||||
}
|
||||
|
||||
// Convert an array of integers into a jbooleanArray.
|
||||
inline jbooleanArray MakeJBooleanArray(JNIEnv* env, llvm::ArrayRef<int> arr) {
|
||||
inline jbooleanArray MakeJBooleanArray(JNIEnv* env, ArrayRef<int> arr) {
|
||||
jbooleanArray jarr = env->NewBooleanArray(arr.size());
|
||||
if (!jarr) return nullptr;
|
||||
jboolean* elements =
|
||||
@@ -385,7 +382,7 @@ inline jbooleanArray MakeJBooleanArray(JNIEnv* env, llvm::ArrayRef<int> arr) {
|
||||
}
|
||||
|
||||
// Convert an array of booleans into a jbooleanArray.
|
||||
inline jbooleanArray MakeJBooleanArray(JNIEnv* env, llvm::ArrayRef<bool> arr) {
|
||||
inline jbooleanArray MakeJBooleanArray(JNIEnv* env, ArrayRef<bool> arr) {
|
||||
jbooleanArray jarr = env->NewBooleanArray(arr.size());
|
||||
if (!jarr) return nullptr;
|
||||
jboolean* elements =
|
||||
@@ -397,14 +394,14 @@ inline jbooleanArray MakeJBooleanArray(JNIEnv* env, llvm::ArrayRef<bool> arr) {
|
||||
return jarr;
|
||||
}
|
||||
|
||||
// Other MakeJ*Array conversions.
|
||||
// Other MakeJ*Array conversions.
|
||||
|
||||
#define WPI_JNI_MAKEJARRAY(T, F) \
|
||||
inline T##Array MakeJ##F##Array(JNIEnv* env, llvm::ArrayRef<T> arr) { \
|
||||
T##Array jarr = env->New##F##Array(arr.size()); \
|
||||
if (!jarr) return nullptr; \
|
||||
env->Set##F##ArrayRegion(jarr, 0, arr.size(), arr.data()); \
|
||||
return jarr; \
|
||||
#define WPI_JNI_MAKEJARRAY(T, F) \
|
||||
inline T##Array MakeJ##F##Array(JNIEnv* env, ArrayRef<T> arr) { \
|
||||
T##Array jarr = env->New##F##Array(arr.size()); \
|
||||
if (!jarr) return nullptr; \
|
||||
env->Set##F##ArrayRegion(jarr, 0, arr.size(), arr.data()); \
|
||||
return jarr; \
|
||||
}
|
||||
|
||||
WPI_JNI_MAKEJARRAY(jboolean, Boolean)
|
||||
@@ -417,8 +414,7 @@ WPI_JNI_MAKEJARRAY(jdouble, Double)
|
||||
#undef WPI_JNI_MAKEJARRAY
|
||||
|
||||
// Convert an array of std::string into a jarray of jstring.
|
||||
inline jobjectArray MakeJStringArray(JNIEnv* env,
|
||||
llvm::ArrayRef<std::string> arr) {
|
||||
inline jobjectArray MakeJStringArray(JNIEnv* env, ArrayRef<std::string> arr) {
|
||||
static JClass stringCls{env, "java/lang/String"};
|
||||
if (!stringCls) return nullptr;
|
||||
jobjectArray jarr = env->NewObjectArray(arr.size(), stringCls, nullptr);
|
||||
@@ -535,7 +531,7 @@ class JSingletonCallbackManager : public JCallbackManager<T> {
|
||||
};
|
||||
|
||||
inline std::string GetJavaStackTrace(JNIEnv* env, std::string* func,
|
||||
llvm::StringRef excludeFuncPrefix) {
|
||||
StringRef excludeFuncPrefix) {
|
||||
// create a throwable
|
||||
static JClass throwableCls(env, "java/lang/Throwable");
|
||||
if (!throwableCls) return "";
|
||||
@@ -572,7 +568,7 @@ inline std::string GetJavaStackTrace(JNIEnv* env, std::string* func,
|
||||
|
||||
bool haveLoc = false;
|
||||
std::string buf;
|
||||
llvm::raw_string_ostream oss(buf);
|
||||
raw_string_ostream oss(buf);
|
||||
for (jsize i = 0; i < stackTraceLength; i++) {
|
||||
// add the result of toString method of each element in the result
|
||||
JLocal<jobject> curStackTraceElement(
|
||||
@@ -623,9 +619,7 @@ class JException : public JClass {
|
||||
env->Throw(static_cast<jthrowable>(exception));
|
||||
}
|
||||
|
||||
void Throw(JNIEnv* env, llvm::StringRef msg) {
|
||||
Throw(env, MakeJString(env, msg));
|
||||
}
|
||||
void Throw(JNIEnv* env, StringRef msg) { Throw(env, MakeJString(env, msg)); }
|
||||
|
||||
explicit operator bool() const { return m_constructor; }
|
||||
|
||||
@@ -51,10 +51,10 @@ SOFTWARE.
|
||||
#include <utility> // declval, forward, make_pair, move, pair, swap
|
||||
#include <vector> // vector
|
||||
|
||||
#include "llvm/ArrayRef.h"
|
||||
#include "llvm/raw_ostream.h"
|
||||
#include "llvm/StringMap.h"
|
||||
#include "llvm/StringRef.h"
|
||||
#include "wpi/ArrayRef.h"
|
||||
#include "wpi/raw_ostream.h"
|
||||
#include "wpi/StringMap.h"
|
||||
#include "wpi/StringRef.h"
|
||||
|
||||
// exclude unsupported compilers
|
||||
#if defined(__clang__)
|
||||
@@ -476,7 +476,7 @@ template<>
|
||||
struct external_constructor<value_t::string>
|
||||
{
|
||||
template<typename BasicJsonType>
|
||||
static void construct(BasicJsonType& j, llvm::StringRef s)
|
||||
static void construct(BasicJsonType& j, StringRef s)
|
||||
{
|
||||
j.m_type = value_t::string;
|
||||
j.m_value = s;
|
||||
@@ -532,7 +532,7 @@ struct external_constructor<value_t::array>
|
||||
}
|
||||
|
||||
template<typename BasicJsonType, typename T>
|
||||
static void construct(BasicJsonType& j, llvm::ArrayRef<T> arr)
|
||||
static void construct(BasicJsonType& j, ArrayRef<T> arr)
|
||||
{
|
||||
using std::begin;
|
||||
using std::end;
|
||||
@@ -636,7 +636,7 @@ template<class RealType, class CompatibleObjectType>
|
||||
struct is_compatible_object_type_impl<true, RealType, CompatibleObjectType>
|
||||
{
|
||||
static constexpr auto value =
|
||||
std::is_constructible<llvm::StringRef,
|
||||
std::is_constructible<StringRef,
|
||||
typename CompatibleObjectType::key_type>::value &&
|
||||
std::is_constructible<typename RealType::mapped_type,
|
||||
typename CompatibleObjectType::mapped_type>::value;
|
||||
@@ -666,7 +666,7 @@ struct is_compatible_array_type
|
||||
static auto constexpr value =
|
||||
conjunction<negation<std::is_same<void, CompatibleArrayType>>,
|
||||
negation<is_compatible_object_type<BasicJsonType, CompatibleArrayType>>,
|
||||
negation<std::is_constructible<llvm::StringRef, CompatibleArrayType>>,
|
||||
negation<std::is_constructible<StringRef, CompatibleArrayType>>,
|
||||
negation<is_json_nested_type<BasicJsonType, CompatibleArrayType>>,
|
||||
has_value_type<CompatibleArrayType>,
|
||||
has_iterator<CompatibleArrayType>>::value;
|
||||
@@ -712,7 +712,7 @@ void to_json(BasicJsonType& j, T b) noexcept
|
||||
}
|
||||
|
||||
template<typename BasicJsonType, typename CompatibleString,
|
||||
enable_if_t<std::is_constructible<llvm::StringRef,
|
||||
enable_if_t<std::is_constructible<StringRef,
|
||||
CompatibleString>::value, int> = 0>
|
||||
inline
|
||||
void to_json(BasicJsonType& j, const CompatibleString& s)
|
||||
@@ -766,7 +766,7 @@ void to_json(BasicJsonType& j, const std::vector<bool>& e)
|
||||
|
||||
template<typename BasicJsonType, typename T>
|
||||
inline
|
||||
void to_json(BasicJsonType& j, llvm::ArrayRef<T> arr)
|
||||
void to_json(BasicJsonType& j, ArrayRef<T> arr)
|
||||
{
|
||||
external_constructor<value_t::array>::construct(j, arr);
|
||||
}
|
||||
@@ -795,7 +795,7 @@ void to_json(BasicJsonType& j, const CompatibleObjectType& arr)
|
||||
|
||||
template <typename BasicJsonType, typename T, std::size_t N,
|
||||
enable_if_t<!std::is_constructible<
|
||||
llvm::StringRef, T (&)[N]>::value,
|
||||
StringRef, T (&)[N]>::value,
|
||||
int> = 0>
|
||||
inline
|
||||
void to_json(BasicJsonType& j, T (&arr)[N])
|
||||
@@ -804,7 +804,7 @@ void to_json(BasicJsonType& j, T (&arr)[N])
|
||||
}
|
||||
|
||||
template <typename BasicJsonType, typename CompatibleString, typename T,
|
||||
enable_if_t<std::is_constructible<llvm::StringRef,
|
||||
enable_if_t<std::is_constructible<StringRef,
|
||||
CompatibleString>::value, int> = 0>
|
||||
inline
|
||||
void to_json(BasicJsonType& j, std::pair<CompatibleString, T> const& p)
|
||||
@@ -1048,7 +1048,7 @@ void from_json(const BasicJsonType& j, ArithmeticType& val)
|
||||
}
|
||||
|
||||
template <typename BasicJsonType, typename CompatibleString, typename T,
|
||||
enable_if_t<std::is_constructible<llvm::StringRef,
|
||||
enable_if_t<std::is_constructible<StringRef,
|
||||
CompatibleString>::value, int> = 0>
|
||||
void from_json(const BasicJsonType& j, std::pair<CompatibleString, T>& p)
|
||||
{
|
||||
@@ -1363,7 +1363,7 @@ class json
|
||||
7159](http://rfc7159.net/rfc7159), because any order implements the
|
||||
specified "unordered" nature of JSON objects.
|
||||
*/
|
||||
using object_t = llvm::StringMap<json>;
|
||||
using object_t = StringMap<json>;
|
||||
|
||||
/*!
|
||||
@brief a type for an array
|
||||
@@ -1754,7 +1754,7 @@ class json
|
||||
json_value(value_t t);
|
||||
|
||||
/// constructor for strings
|
||||
json_value(llvm::StringRef value);
|
||||
json_value(StringRef value);
|
||||
json_value(const std::string& value);
|
||||
|
||||
/// constructor for objects
|
||||
@@ -1816,7 +1816,7 @@ class json
|
||||
@brief per-element parser callback type
|
||||
|
||||
With a parser callback function, the result of parsing a JSON text can be
|
||||
influenced. When passed to @ref parse(wpi::raw_istream&, const
|
||||
influenced. When passed to @ref parse(raw_istream&, const
|
||||
parser_callback_t) or @ref parse(const CharT, const parser_callback_t),
|
||||
it is called on certain events (passed as @ref parse_event_t via parameter
|
||||
@a event) with a set recursion depth @a depth and context JSON value
|
||||
@@ -1859,7 +1859,7 @@ class json
|
||||
should be kept (`true`) or not (`false`). In the latter case, it is either
|
||||
skipped completely or replaced by an empty discarded object.
|
||||
|
||||
@sa @ref parse(wpi::raw_istream&, parser_callback_t) or
|
||||
@sa @ref parse(raw_istream&, parser_callback_t) or
|
||||
@ref parse(const CharT, const parser_callback_t) for examples
|
||||
|
||||
@since version 1.0.0
|
||||
@@ -1962,7 +1962,7 @@ class json
|
||||
See the examples below.
|
||||
|
||||
@tparam CompatibleType a type such that:
|
||||
- @a CompatibleType is not derived from `wpi::raw_istream`,
|
||||
- @a CompatibleType is not derived from `raw_istream`,
|
||||
- @a CompatibleType is not @ref json (to avoid hijacking copy/move
|
||||
constructors),
|
||||
- @a CompatibleType is not a @ref json nested type (e.g.,
|
||||
@@ -1986,7 +1986,7 @@ class json
|
||||
@since version 2.1.0
|
||||
*/
|
||||
template<typename CompatibleType, typename U = detail::uncvref_t<CompatibleType>,
|
||||
detail::enable_if_t<!std::is_base_of<wpi::raw_istream, U>::value &&
|
||||
detail::enable_if_t<!std::is_base_of<raw_istream, U>::value &&
|
||||
!std::is_same<U, json>::value &&
|
||||
!detail::is_json_nested_type<json, U>::value,
|
||||
int> = 0>
|
||||
@@ -2477,7 +2477,7 @@ class json
|
||||
|
||||
@since version 1.0.0; indentaction character added in version 3.0.0
|
||||
*/
|
||||
void dump(llvm::raw_ostream& os, int indent = -1) const;
|
||||
void dump(raw_ostream& os, int indent = -1) const;
|
||||
|
||||
/*!
|
||||
@brief return the type of the JSON value (explicit)
|
||||
@@ -3354,7 +3354,7 @@ class json
|
||||
|
||||
@complexity Logarithmic in the size of the container.
|
||||
|
||||
@sa @ref operator[](llvm::StringRef) for unchecked
|
||||
@sa @ref operator[](StringRef) for unchecked
|
||||
access by reference
|
||||
@sa @ref value() for access by value with a default value
|
||||
|
||||
@@ -3364,7 +3364,7 @@ class json
|
||||
written using `at()`. It also demonstrates the different exceptions that
|
||||
can be thrown.,at__object_t_key_type}
|
||||
*/
|
||||
reference at(llvm::StringRef key);
|
||||
reference at(StringRef key);
|
||||
|
||||
/*!
|
||||
@brief access specified object element with bounds checking
|
||||
@@ -3386,7 +3386,7 @@ class json
|
||||
|
||||
@complexity Logarithmic in the size of the container.
|
||||
|
||||
@sa @ref operator[](llvm::StringRef) for unchecked
|
||||
@sa @ref operator[](StringRef) for unchecked
|
||||
access by reference
|
||||
@sa @ref value() for access by value with a default value
|
||||
|
||||
@@ -3396,7 +3396,7 @@ class json
|
||||
`at()`. It also demonstrates the different exceptions that can be thrown.,
|
||||
at__object_t_key_type_const}
|
||||
*/
|
||||
const_reference at(llvm::StringRef key) const;
|
||||
const_reference at(StringRef key) const;
|
||||
|
||||
/*!
|
||||
@brief access specified array element
|
||||
@@ -3467,13 +3467,13 @@ class json
|
||||
@liveexample{The example below shows how object elements can be read and
|
||||
written using the `[]` operator.,operatorarray__key_type}
|
||||
|
||||
@sa @ref at(llvm::StringRef) for access by reference
|
||||
@sa @ref at(StringRef) for access by reference
|
||||
with range checking
|
||||
@sa @ref value() for access by value with a default value
|
||||
|
||||
@since version 1.0.0
|
||||
*/
|
||||
reference operator[](llvm::StringRef key);
|
||||
reference operator[](StringRef key);
|
||||
|
||||
/*!
|
||||
@brief read-only access specified object element
|
||||
@@ -3499,13 +3499,13 @@ class json
|
||||
@liveexample{The example below shows how object elements can be read using
|
||||
the `[]` operator.,operatorarray__key_type_const}
|
||||
|
||||
@sa @ref at(llvm::StringRef) for access by reference
|
||||
@sa @ref at(StringRef) for access by reference
|
||||
with range checking
|
||||
@sa @ref value() for access by value with a default value
|
||||
|
||||
@since version 1.0.0
|
||||
*/
|
||||
const_reference operator[](llvm::StringRef key) const;
|
||||
const_reference operator[](StringRef key) const;
|
||||
|
||||
/*!
|
||||
@brief access specified object element
|
||||
@@ -3605,7 +3605,7 @@ class json
|
||||
template<typename T>
|
||||
reference operator[](T* key)
|
||||
{
|
||||
return this->operator[](llvm::StringRef(key));
|
||||
return this->operator[](StringRef(key));
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -3641,7 +3641,7 @@ class json
|
||||
template<typename T>
|
||||
const_reference operator[](T* key) const
|
||||
{
|
||||
return this->operator[](llvm::StringRef(key));
|
||||
return this->operator[](StringRef(key));
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -3659,10 +3659,10 @@ class json
|
||||
}
|
||||
@endcode
|
||||
|
||||
@note Unlike @ref at(llvm::StringRef), this function
|
||||
@note Unlike @ref at(StringRef), this function
|
||||
does not throw if the given key @a key was not found.
|
||||
|
||||
@note Unlike @ref operator[](llvm::StringRef key), this
|
||||
@note Unlike @ref operator[](StringRef key), this
|
||||
function does not implicitly add an element to the position defined by @a
|
||||
key. This function is furthermore also applicable to const objects.
|
||||
|
||||
@@ -3685,16 +3685,16 @@ class json
|
||||
@liveexample{The example below shows how object elements can be queried
|
||||
with a default value.,json__value}
|
||||
|
||||
@sa @ref at(llvm::StringRef) for access by reference
|
||||
@sa @ref at(StringRef) for access by reference
|
||||
with range checking
|
||||
@sa @ref operator[](llvm::StringRef) for unchecked
|
||||
@sa @ref operator[](StringRef) for unchecked
|
||||
access by reference
|
||||
|
||||
@since version 1.0.0
|
||||
*/
|
||||
template<class ValueType, typename std::enable_if<
|
||||
std::is_convertible<json, ValueType>::value, int>::type = 0>
|
||||
ValueType value(llvm::StringRef key, ValueType default_value) const
|
||||
ValueType value(StringRef key, ValueType default_value) const
|
||||
{
|
||||
// at only works for objects
|
||||
if (is_object())
|
||||
@@ -3716,9 +3716,9 @@ class json
|
||||
|
||||
/*!
|
||||
@brief overload for a default value of type const char*
|
||||
@copydoc json::value(llvm::StringRef, ValueType) const
|
||||
@copydoc json::value(StringRef, ValueType) const
|
||||
*/
|
||||
std::string value(llvm::StringRef key, const char* default_value) const
|
||||
std::string value(StringRef key, const char* default_value) const
|
||||
{
|
||||
return value(key, std::string(default_value));
|
||||
}
|
||||
@@ -3907,7 +3907,7 @@ class json
|
||||
|
||||
@sa @ref erase(IteratorType, IteratorType) -- removes the elements in
|
||||
the given range
|
||||
@sa @ref erase(llvm::StringRef) -- removes the element
|
||||
@sa @ref erase(StringRef) -- removes the element
|
||||
from an object at the given key
|
||||
@sa @ref erase(const size_type) -- removes the element from an array at
|
||||
the given index
|
||||
@@ -4010,7 +4010,7 @@ class json
|
||||
types.,erase__IteratorType_IteratorType}
|
||||
|
||||
@sa @ref erase(IteratorType) -- removes the element at a given position
|
||||
@sa @ref erase(llvm::StringRef) -- removes the element
|
||||
@sa @ref erase(StringRef) -- removes the element
|
||||
from an object at the given key
|
||||
@sa @ref erase(const size_type) -- removes the element from an array at
|
||||
the given index
|
||||
@@ -4098,7 +4098,7 @@ class json
|
||||
|
||||
@since version 1.0.0
|
||||
*/
|
||||
size_type erase(llvm::StringRef key);
|
||||
size_type erase(StringRef key);
|
||||
|
||||
/*!
|
||||
@brief remove element from a JSON array given an index
|
||||
@@ -4119,7 +4119,7 @@ class json
|
||||
@sa @ref erase(IteratorType) -- removes the element at a given position
|
||||
@sa @ref erase(IteratorType, IteratorType) -- removes the elements in
|
||||
the given range
|
||||
@sa @ref erase(llvm::StringRef) -- removes the element
|
||||
@sa @ref erase(StringRef) -- removes the element
|
||||
from an object at the given key
|
||||
|
||||
@since version 1.0.0
|
||||
@@ -4158,13 +4158,13 @@ class json
|
||||
|
||||
@since version 1.0.0
|
||||
*/
|
||||
iterator find(llvm::StringRef key);
|
||||
iterator find(StringRef key);
|
||||
|
||||
/*!
|
||||
@brief find an element in a JSON object
|
||||
@copydoc find(llvm::StringRef)
|
||||
@copydoc find(StringRef)
|
||||
*/
|
||||
const_iterator find(llvm::StringRef key) const;
|
||||
const_iterator find(StringRef key) const;
|
||||
|
||||
/*!
|
||||
@brief returns the number of occurrences of a key in a JSON object
|
||||
@@ -4187,7 +4187,7 @@ class json
|
||||
|
||||
@since version 1.0.0
|
||||
*/
|
||||
size_type count(llvm::StringRef key) const
|
||||
size_type count(StringRef key) const
|
||||
{
|
||||
// return 0 for all nonobject types
|
||||
return is_object() ? m_value.object->count(key) : 0;
|
||||
@@ -4605,13 +4605,13 @@ class json
|
||||
|
||||
@since version 1.0.0
|
||||
*/
|
||||
void push_back(const std::pair<llvm::StringRef, json>& val);
|
||||
void push_back(const std::pair<StringRef, json>& val);
|
||||
|
||||
/*!
|
||||
@brief add an object to an object
|
||||
@copydoc push_back(const typename object_t::value_type&)
|
||||
*/
|
||||
reference operator+=(const std::pair<llvm::StringRef, json>& val)
|
||||
reference operator+=(const std::pair<StringRef, json>& val)
|
||||
{
|
||||
push_back(val);
|
||||
return *this;
|
||||
@@ -4724,7 +4724,7 @@ class json
|
||||
@since version 2.0.8
|
||||
*/
|
||||
template<class... Args>
|
||||
std::pair<iterator, bool> emplace(llvm::StringRef key, Args&& ... args)
|
||||
std::pair<iterator, bool> emplace(StringRef key, Args&& ... args)
|
||||
{
|
||||
// emplace only works for null objects or arrays
|
||||
if (!(is_null() || is_object()))
|
||||
@@ -5342,7 +5342,7 @@ class json
|
||||
|
||||
@since version 1.0.0; indentaction character added in version 3.0.0
|
||||
*/
|
||||
friend llvm::raw_ostream& operator<<(llvm::raw_ostream& o, const json& j);
|
||||
friend raw_ostream& operator<<(raw_ostream& o, const json& j);
|
||||
|
||||
/// @}
|
||||
|
||||
@@ -5380,12 +5380,12 @@ class json
|
||||
@liveexample{The example below demonstrates the `parse()` function with
|
||||
and without callback function.,parse__string__parser_callback_t}
|
||||
|
||||
@sa @ref parse(wpi::raw_istream&, const parser_callback_t) for a version
|
||||
@sa @ref parse(raw_istream&, const parser_callback_t) for a version
|
||||
that reads from an input stream
|
||||
|
||||
@since version 1.0.0 (originally for std::string)
|
||||
*/
|
||||
static json parse(llvm::StringRef s,
|
||||
static json parse(StringRef s,
|
||||
const parser_callback_t cb = nullptr);
|
||||
|
||||
/*!
|
||||
@@ -5417,7 +5417,7 @@ class json
|
||||
|
||||
@since version 1.0.0
|
||||
*/
|
||||
static json parse(wpi::raw_istream& i,
|
||||
static json parse(raw_istream& i,
|
||||
const parser_callback_t cb = nullptr);
|
||||
|
||||
/*!
|
||||
@@ -5441,12 +5441,12 @@ class json
|
||||
@liveexample{The example below shows how a JSON value is constructed by
|
||||
reading a serialization from a stream.,operator_deserialize}
|
||||
|
||||
@sa parse(wpi::raw_istream&, const parser_callback_t) for a variant with a
|
||||
@sa parse(raw_istream&, const parser_callback_t) for a variant with a
|
||||
parser callback function to filter values while parsing
|
||||
|
||||
@since version 1.0.0
|
||||
*/
|
||||
friend wpi::raw_istream& operator>>(wpi::raw_istream& i, json& j);
|
||||
friend raw_istream& operator>>(raw_istream& i, json& j);
|
||||
|
||||
/// @}
|
||||
|
||||
@@ -5571,7 +5571,7 @@ class json
|
||||
return lhs.m_it - rhs.m_it;
|
||||
}
|
||||
|
||||
friend llvm::raw_ostream& operator<<(llvm::raw_ostream& os, primitive_iterator_t it)
|
||||
friend raw_ostream& operator<<(raw_ostream& os, primitive_iterator_t it)
|
||||
{
|
||||
return os << it.m_it;
|
||||
}
|
||||
@@ -6327,7 +6327,7 @@ class json
|
||||
@brief return the key of an object iterator
|
||||
@pre The iterator is initialized; i.e. `m_object != nullptr`.
|
||||
*/
|
||||
llvm::StringRef key() const
|
||||
StringRef key() const
|
||||
{
|
||||
assert(m_object != nullptr);
|
||||
|
||||
@@ -6445,8 +6445,8 @@ class json
|
||||
|
||||
@since version 2.0.9
|
||||
*/
|
||||
static void to_cbor(llvm::raw_ostream& os, const json& j);
|
||||
static llvm::StringRef to_cbor(const json& j, llvm::SmallVectorImpl<char> buf);
|
||||
static void to_cbor(raw_ostream& os, const json& j);
|
||||
static StringRef to_cbor(const json& j, SmallVectorImpl<char> buf);
|
||||
static std::string to_cbor(const json& j);
|
||||
|
||||
/*!
|
||||
@@ -6523,8 +6523,8 @@ class json
|
||||
|
||||
@since version 2.0.9
|
||||
*/
|
||||
static void to_msgpack(llvm::raw_ostream& os, const json& j);
|
||||
static llvm::StringRef to_msgpack(const json& j, llvm::SmallVectorImpl<char> buf);
|
||||
static void to_msgpack(raw_ostream& os, const json& j);
|
||||
static StringRef to_msgpack(const json& j, SmallVectorImpl<char> buf);
|
||||
static std::string to_msgpack(const json& j);
|
||||
|
||||
/*!
|
||||
@@ -6613,8 +6613,8 @@ class json
|
||||
|
||||
@since version 2.0.9, parameter @a start_index since 2.1.1
|
||||
*/
|
||||
static json from_cbor(wpi::raw_istream& is);
|
||||
static json from_cbor(llvm::StringRef s);
|
||||
static json from_cbor(raw_istream& is);
|
||||
static json from_cbor(StringRef s);
|
||||
|
||||
/*!
|
||||
@brief create a JSON value from a byte vector in MessagePack format
|
||||
@@ -6682,8 +6682,8 @@ class json
|
||||
|
||||
@since version 2.0.9, parameter @a start_index since 2.1.1
|
||||
*/
|
||||
static json from_msgpack(wpi::raw_istream& is);
|
||||
static json from_msgpack(llvm::StringRef s);
|
||||
static json from_msgpack(raw_istream& is);
|
||||
static json from_msgpack(StringRef s);
|
||||
|
||||
/// @}
|
||||
|
||||
@@ -6937,7 +6937,7 @@ class json
|
||||
|
||||
Uses a JSON pointer to retrieve a reference to the respective JSON value.
|
||||
No bound checking is performed. Similar to @ref operator[](
|
||||
llvm::StringRef), `null` values are created in arrays and objects if
|
||||
StringRef), `null` values are created in arrays and objects if
|
||||
necessary.
|
||||
|
||||
In particular:
|
||||
@@ -7214,7 +7214,7 @@ if no parse error occurred.
|
||||
*/
|
||||
inline wpi::json operator "" _json(const char* s, std::size_t n)
|
||||
{
|
||||
return wpi::json::parse(llvm::StringRef(s, n));
|
||||
return wpi::json::parse(wpi::StringRef(s, n));
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -10,14 +10,14 @@
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include "llvm/SmallVector.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
class raw_istream;
|
||||
|
||||
uint64_t SizeUleb128(uint64_t val);
|
||||
uint64_t WriteUleb128(llvm::SmallVectorImpl<char>& dest, uint64_t val);
|
||||
uint64_t WriteUleb128(SmallVectorImpl<char>& dest, uint64_t val);
|
||||
uint64_t ReadUleb128(const char* addr, uint64_t* ret);
|
||||
bool ReadUleb128(raw_istream& is, uint64_t* ret);
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
#include <cstddef>
|
||||
#include <system_error>
|
||||
|
||||
#include "llvm/SmallVector.h"
|
||||
#include "llvm/StringRef.h"
|
||||
#include "llvm/Twine.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
#include "wpi/StringRef.h"
|
||||
#include "wpi/Twine.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
@@ -56,7 +56,7 @@ class raw_istream {
|
||||
// @param buf Buffer for output
|
||||
// @param maxLen Maximum length
|
||||
// @return Line
|
||||
llvm::StringRef getline(llvm::SmallVectorImpl<char>& buf, int maxLen);
|
||||
StringRef getline(SmallVectorImpl<char>& buf, int maxLen);
|
||||
|
||||
virtual void close() = 0;
|
||||
virtual size_t in_avail() const = 0;
|
||||
@@ -78,7 +78,7 @@ class raw_istream {
|
||||
|
||||
class raw_mem_istream : public raw_istream {
|
||||
public:
|
||||
explicit raw_mem_istream(llvm::StringRef mem);
|
||||
explicit raw_mem_istream(StringRef mem);
|
||||
raw_mem_istream(const char* mem, size_t len) : m_cur(mem), m_left(len) {}
|
||||
void close() override;
|
||||
size_t in_avail() const override;
|
||||
@@ -92,7 +92,7 @@ class raw_mem_istream : public raw_istream {
|
||||
|
||||
class raw_fd_istream : public raw_istream {
|
||||
public:
|
||||
raw_fd_istream(const llvm::Twine& filename, std::error_code& ec,
|
||||
raw_fd_istream(const Twine& filename, std::error_code& ec,
|
||||
size_t bufSize = 4096);
|
||||
raw_fd_istream(int fd, bool shouldClose, size_t bufSize = 4096);
|
||||
~raw_fd_istream() override;
|
||||
@@ -14,10 +14,10 @@
|
||||
#ifndef LLVM_SUPPORT_RAW_OS_OSTREAM_H
|
||||
#define LLVM_SUPPORT_RAW_OS_OSTREAM_H
|
||||
|
||||
#include "llvm/raw_ostream.h"
|
||||
#include "wpi/raw_ostream.h"
|
||||
#include <iosfwd>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
/// raw_os_ostream - A raw_ostream that writes to an std::ostream. This is a
|
||||
/// simple adaptor class. It does not check for output errors; clients should
|
||||
@@ -37,6 +37,6 @@ public:
|
||||
~raw_os_ostream() override;
|
||||
};
|
||||
|
||||
} // end llvm namespace
|
||||
} // end wpi namespace
|
||||
|
||||
#endif
|
||||
@@ -14,13 +14,13 @@
|
||||
#ifndef LLVM_SUPPORT_RAW_OSTREAM_H
|
||||
#define LLVM_SUPPORT_RAW_OSTREAM_H
|
||||
|
||||
#include "llvm/FileSystem.h"
|
||||
#include "llvm/SmallVector.h"
|
||||
#include "llvm/StringRef.h"
|
||||
#include "wpi/FileSystem.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
#include "wpi/StringRef.h"
|
||||
#include <cstdint>
|
||||
#include <system_error>
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
class format_object_base;
|
||||
class FormattedString;
|
||||
class FormattedNumber;
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
return write(Str.data(), Str.length());
|
||||
}
|
||||
|
||||
raw_ostream &operator<<(const llvm::SmallVectorImpl<char> &Str) {
|
||||
raw_ostream &operator<<(const wpi::SmallVectorImpl<char> &Str) {
|
||||
return write(Str.data(), Str.size());
|
||||
}
|
||||
|
||||
@@ -510,6 +510,6 @@ public:
|
||||
~buffer_ostream() override { OS << str(); }
|
||||
};
|
||||
|
||||
} // end llvm namespace
|
||||
} // end wpi namespace
|
||||
|
||||
#endif // LLVM_SUPPORT_RAW_OSTREAM_H
|
||||
@@ -8,7 +8,7 @@
|
||||
#ifndef WPIUTIL_SUPPORT_RAW_SOCKET_ISTREAM_H_
|
||||
#define WPIUTIL_SUPPORT_RAW_SOCKET_ISTREAM_H_
|
||||
|
||||
#include "support/raw_istream.h"
|
||||
#include "wpi/raw_istream.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
#ifndef WPIUTIL_SUPPORT_RAW_SOCKET_OSTREAM_H_
|
||||
#define WPIUTIL_SUPPORT_RAW_SOCKET_OSTREAM_H_
|
||||
|
||||
#include "llvm/raw_ostream.h"
|
||||
#include "wpi/raw_ostream.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
class NetworkStream;
|
||||
|
||||
class raw_socket_ostream : public llvm::raw_ostream {
|
||||
class raw_socket_ostream : public raw_ostream {
|
||||
public:
|
||||
raw_socket_ostream(NetworkStream& stream, bool shouldClose)
|
||||
: m_stream(stream), m_shouldClose(shouldClose) {}
|
||||
@@ -24,25 +24,21 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "llvm/StringRef.h"
|
||||
|
||||
namespace llvm {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
} // namespace llvm
|
||||
#include "wpi/StringRef.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
class raw_istream;
|
||||
|
||||
class SHA1 {
|
||||
public:
|
||||
SHA1();
|
||||
void Update(llvm::StringRef s);
|
||||
void Update(StringRef s);
|
||||
void Update(raw_istream& is);
|
||||
std::string Final();
|
||||
llvm::StringRef Final(llvm::SmallVectorImpl<char>& buf);
|
||||
static std::string FromFile(llvm::StringRef filename);
|
||||
StringRef Final(SmallVectorImpl<char>& buf);
|
||||
static std::string FromFile(StringRef filename);
|
||||
|
||||
private:
|
||||
uint32_t digest[5];
|
||||
@@ -17,9 +17,9 @@
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "llvm/Compiler.h"
|
||||
#include "wpi/Compiler.h"
|
||||
|
||||
namespace llvm {
|
||||
namespace wpi {
|
||||
|
||||
/// isPodLike - This is a type trait that is used to determine whether a given
|
||||
/// type can be copied around with memcpy instead of running ctors etc.
|
||||
@@ -90,6 +90,6 @@ struct add_const_past_pointer<
|
||||
typedef const typename std::remove_pointer<T>::type *type;
|
||||
};
|
||||
|
||||
} // namespace llvm
|
||||
} // namespace wpi
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user