WPILibC++ 2023.4.3
|
/file This file defines the SmallVector class. More...
Namespaces | |
namespace | detail |
detail namespace with internal helper functions | |
namespace | hashing |
namespace | impl |
namespace | java |
Java Native Interface (JNI) utility functions. | |
namespace | log |
namespace | math |
namespace | pointer_union_detail |
namespace | sig |
namespace | support |
namespace | sys |
namespace | uv |
Classes | |
struct | add_const_past_pointer |
If T is a pointer to X, return a pointer to const X. More... | |
struct | add_const_past_pointer< T, std::enable_if_t< std::is_pointer< T >::value > > |
struct | add_lvalue_reference_if_not_pointer |
If T is a pointer, just return it. If it is not, return T&. More... | |
struct | add_lvalue_reference_if_not_pointer< T, std::enable_if_t< std::is_pointer< T >::value > > |
struct | adl_serializer |
default JSONSerializer template argument More... | |
struct | AlignedCharArrayUnion |
A suitably aligned and sized character array member which can hold elements of any type. More... | |
class | AllocatorBase |
CRTP base class providing obvious overloads for the core Allocate() methods of LLVM-style allocators. More... | |
class | array |
This class is a wrapper around std::array that does compile time size checking. More... | |
class | buffer_ostream |
class | buffer_unique_ostream |
struct | CalculateSmallVectorDefaultInlinedElements |
Helper class for calculating the default number of inline elements for SmallVector<T> . More... | |
class | CallbackListenerData |
class | CallbackManager |
class | CallbackThread |
class | circular_buffer |
This is a simple circular buffer so we don't need to "bucket brigade" copy old values. More... | |
class | ConcurrentQueue |
struct | conjunction |
struct | conjunction< B1 > |
struct | conjunction< B1, Bn... > |
struct | const_pointer_or_const_ref |
struct | const_pointer_or_const_ref< T, std::enable_if_t< std::is_pointer< T >::value > > |
class | DebugEpochBase |
A base class for data structure classes wishing to make iterators ("handles") pointing into themselves fail-fast. More... | |
class | DenseMap |
class | DenseMapBase |
struct | DenseMapInfo |
An information struct used to provide DenseMap with the various necessary components for a given value type T . More... | |
struct | DenseMapInfo< char > |
struct | DenseMapInfo< hash_code, void > |
struct | DenseMapInfo< int > |
struct | DenseMapInfo< long > |
struct | DenseMapInfo< long long > |
struct | DenseMapInfo< PointerIntPair< PointerTy, IntBits, IntType >, void > |
struct | DenseMapInfo< PointerUnion< PTs... > > |
struct | DenseMapInfo< short > |
struct | DenseMapInfo< std::pair< T, U > > |
struct | DenseMapInfo< std::tuple< Ts... > > |
struct | DenseMapInfo< T * > |
struct | DenseMapInfo< unsigned > |
struct | DenseMapInfo< unsigned char > |
struct | DenseMapInfo< unsigned long > |
struct | DenseMapInfo< unsigned long long > |
struct | DenseMapInfo< unsigned short > |
class | DenseMapIterator |
struct | disjunction |
struct | disjunction< B1 > |
struct | disjunction< B1, Bn... > |
class | DsClient |
struct | empty_array_t |
class | EventLoopRunner |
Executes an event loop on a separate thread. More... | |
struct | EventVector |
struct | FirstIndexOfType |
Find the first index where a type appears in a list of types. More... | |
struct | FirstIndexOfType< T, T, Us... > |
struct | FirstIndexOfType< T, U, Us... > |
class | function_ref |
An efficient, type-erasing, non-owning reference to a callable. More... | |
class | function_ref< Ret(Params...)> |
struct | FunctionPointerLikeTypeTraits |
Provide suitable custom traits struct for function pointers. More... | |
class | future |
A lightweight version of std::future. More... | |
class | future< void > |
Explicit specialization for future<void>. More... | |
class | hash_code |
An opaque object representing a hash code. More... | |
struct | http_parser |
struct | http_parser_settings |
struct | http_parser_url |
class | HttpConnection |
class | HttpLocation |
class | HttpMultipartScanner |
class | HttpParser |
HTTP protocol parser. More... | |
class | HttpPath |
Class for HTTP path matching. More... | |
class | HttpPathRef |
Proxy reference object for a portion of a HttpPath. More... | |
class | HttpQueryMap |
Map for looking up elements of the query portion of a URI. More... | |
class | HttpRequest |
class | HttpServerConnection |
class | HttpWebSocketServerConnection |
A server-side HTTP connection that also accepts WebSocket upgrades. More... | |
struct | in_place_index_t |
struct | in_place_t |
struct | in_place_type_t |
class | interpolating_map |
Implements a table of key-value pairs with linear interpolation between values. More... | |
class | is_integral_or_enum |
Metafunction that determines whether the given type is either an integral type or an enumeration type, including enum classes. More... | |
class | iterator_adaptor_base |
CRTP base class for adapting an iterator to a different type. More... | |
class | iterator_facade_base |
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of the interface. More... | |
class | iterator_range |
A range adaptor for a pair of iterators. More... | |
class | json |
a class to store JSON values More... | |
class | json_pointer |
class | Logger |
class | MallocAllocator |
class | MappedFileRegion |
class | MapVector |
This class implements a map that also provides access to all stored values in a deterministic order. More... | |
class | MemoryBuffer |
This interface provides simple read-only access to a block of memory, and provides simple methods for reading files and standard input into a memory buffer. More... | |
class | MemoryBufferRef |
struct | negation |
class | NetworkAcceptor |
class | NetworkStream |
struct | NullDeleter |
class | ParallelTcpConnector |
Parallel TCP connector. More... | |
struct | pointee_iterator |
An iterator type that allows iterating over the pointees via some other iterator. More... | |
class | pointer_iterator |
class | PointerIntPair |
PointerIntPair - This class implements a pair of a pointer and small integer. More... | |
struct | PointerIntPairInfo |
struct | PointerLikeTypeTraits |
A traits type that is used to handle pointer types and things that are just wrappers for pointers as a uniform entity. More... | |
struct | PointerLikeTypeTraits< const T * > |
struct | PointerLikeTypeTraits< const T > |
struct | PointerLikeTypeTraits< PointerIntPair< PointerTy, IntBits, IntType, PtrTraits > > |
struct | PointerLikeTypeTraits< PointerUnion< PTs... > > |
struct | PointerLikeTypeTraits< ReturnT(*)(ParamTs...)> |
Provide a default specialization for function pointers that assumes 4-byte alignment. More... | |
struct | PointerLikeTypeTraits< T * > |
struct | PointerLikeTypeTraits< uintptr_t > |
struct | PointerLikeTypeTraits< void * > |
class | PointerUnion |
A discriminated union of two or more pointer types, with the discriminator in the low bit of the pointer. More... | |
class | PortForwarder |
Forward ports to another host. More... | |
class | priority_queue |
This class is the same as std::priority_queue with two changes: More... | |
class | promise |
A lightweight version of std::promise. More... | |
class | promise< void > |
Explicit specialization for promise<void>. More... | |
class | PromiseFactory |
A promise factory for lightweight futures. More... | |
class | PromiseFactory< void > |
Explicit specialization for PromiseFactory<void>. More... | |
class | raw_fd_istream |
class | raw_fd_ostream |
A raw_ostream that writes to a file descriptor. More... | |
class | raw_fd_stream |
A raw_ostream of a file for reading/writing/seeking. More... | |
class | raw_istream |
class | raw_mem_istream |
class | raw_null_ostream |
A raw_ostream that discards all output. More... | |
class | raw_os_ostream |
raw_os_ostream - A raw_ostream that writes to an std::ostream. More... | |
class | raw_ostream |
This class implements an extremely fast bulk output stream that can only output to a stream. More... | |
class | raw_pwrite_stream |
An abstract base class for streams implementations that also support a pwrite operation. More... | |
class | raw_socket_istream |
class | raw_socket_ostream |
class | raw_string_ostream |
A raw_ostream that writes to an std::string. More... | |
class | raw_svector_ostream |
A raw_ostream that writes to an SmallVector or SmallString. More... | |
class | raw_usvector_ostream |
A raw_ostream that writes to an SmallVector or SmallString. More... | |
class | raw_uv_ostream |
raw_ostream style output to a SmallVector of uv::Buffer buffers. More... | |
class | raw_uvector_ostream |
A raw_ostream that writes to a vector. More... | |
class | raw_vector_ostream |
A raw_ostream that writes to a vector. More... | |
class | recursive_spinlock1 |
A recursive spinlock mutex. More... | |
class | recursive_spinlock2 |
A recursive spinlock mutex. More... | |
struct | remove_cvref |
struct | RoundUpToPowerOfTwo |
RoundUpToPowerOfTwo - This is a helper template that rounds N up to the next power of two (which means N itself if N is already a power of two). More... | |
struct | RoundUpToPowerOfTwoH |
RoundUpToPowerOfTwoH - If N is not a power of two, increase it. More... | |
struct | RoundUpToPowerOfTwoH< N, false > |
class | SafeThread |
class | SafeThreadBase |
Base class for SafeThreadOwner threads. More... | |
class | SafeThreadEvent |
class | SafeThreadOwner |
class | scope_exit |
struct | ScopedFatalErrorHandler |
ScopedFatalErrorHandler - This is a simple helper class which just calls install_fatal_error_handler in its constructor and remove_fatal_error_handler in its destructor. More... | |
class | Sendable |
Interface for Sendable objects. More... | |
class | SendableBuilder |
class | SendableHelper |
A helper class for use with objects that add themselves to SendableRegistry. More... | |
class | SendableRegistry |
The SendableRegistry class is the public interface for registering sensors and actuators for use on dashboards and LiveWindow. More... | |
class | SHA1 |
class | SmallDenseMap |
struct | SmallMapVector |
A MapVector that performs no allocations if smaller than a certain size. More... | |
class | SmallPtrSet |
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements. More... | |
class | SmallPtrSetImpl |
A templated base class for SmallPtrSet which provides the typesafe interface that is common across all small sizes. More... | |
class | SmallPtrSetImplBase |
SmallPtrSetImplBase - This is the common code shared among all the SmallPtrSet<>'s, which is almost everything. More... | |
class | SmallPtrSetIterator |
SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet. More... | |
class | SmallPtrSetIteratorImpl |
SmallPtrSetIteratorImpl - This is the common base class shared between all instances of SmallPtrSetIterator. More... | |
class | SmallSet |
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less than N). More... | |
class | SmallSet< PointeeType *, N > |
If this set is of pointer values, transparently switch over to using SmallPtrSet for performance. More... | |
class | SmallSetIterator |
SmallSetIterator - This class implements a const_iterator for SmallSet by delegating to the underlying SmallVector or Set iterators. More... | |
class | SmallString |
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better as a string (e.g. More... | |
class | SmallVector |
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small. More... | |
struct | SmallVectorAlignmentAndSize |
Figure out the offset of the first element. More... | |
class | SmallVectorBase |
This is all the stuff common to all SmallVectors. More... | |
class | SmallVectorImpl |
This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter. More... | |
class | SmallVectorMemoryBuffer |
SmallVector-backed MemoryBuffer instance. More... | |
struct | SmallVectorStorage |
Storage for the SmallVector elements. More... | |
struct | SmallVectorStorage< T, 0 > |
We need the storage to be properly aligned even for small-size of 0 so that the pointer math in SmallVectorTemplateCommon::getFirstEl() is well-defined. More... | |
class | SmallVectorTemplateBase |
SmallVectorTemplateBase<TriviallyCopyable = false> - This is where we put method implementations that are designed to work with non-trivial T's. More... | |
class | SmallVectorTemplateBase< T, true > |
SmallVectorTemplateBase<TriviallyCopyable = true> - This is where we put method implementations that are designed to work with trivially copyable T's. More... | |
class | SmallVectorTemplateCommon |
This is the part of SmallVectorTemplateBase which does not depend on whether the type T is a POD. More... | |
class | spinlock |
A spinlock mutex. More... | |
class | static_circular_buffer |
This is a simple circular buffer so we don't need to "bucket brigade" copy old values. More... | |
class | StringMap |
StringMap - This is an unconventional map that is specialized for handling keys that are "strings", which are basically ranges of bytes. More... | |
class | StringMapConstIterator |
class | StringMapEntry |
StringMapEntry - This is used to represent one value that is inserted into a StringMap. More... | |
class | StringMapEntryBase |
StringMapEntryBase - Shared base class of StringMapEntry instances. More... | |
class | StringMapEntryStorage |
StringMapEntryStorage - Holds the value in a StringMapEntry. More... | |
class | StringMapEntryStorage< std::nullopt_t > |
class | StringMapImpl |
StringMapImpl - This is the base class of StringMap that is shared among all of its instantiations. More... | |
class | StringMapIterator |
class | StringMapIterBase |
class | StringMapKeyIterator |
struct | TypesAreDistinct |
Determine if all types in Ts are distinct. More... | |
struct | TypesAreDistinct<> |
class | UDPClient |
class | UidVector |
Vector which provides an integrated freelist for removal and reuse of individual elements. More... | |
class | Uleb128Reader |
Unsigned LEB128 streaming reader. More... | |
class | unique_function |
unique_function is a type-erasing functor similar to std::function. More... | |
class | unique_function< R(P...) const > |
class | unique_function< R(P...)> |
class | UrlParser |
Parses a URL into its constiuent components. More... | |
class | VersionTuple |
Represents a version number in the form major[.minor[.subminor[.build]]]. More... | |
class | WebSocket |
RFC 6455 compliant WebSocket client and server implementation. More... | |
class | WebSocketServer |
Dedicated WebSocket server. More... | |
class | WebSocketServerHelper |
WebSocket HTTP server helper. More... | |
class | WorkerThread |
class | WorkerThread< R(T...)> |
class | WritableMemoryBuffer |
This class is an extension of MemoryBuffer, which allows copy-on-write access to the underlying contents. More... | |
class | WriteThroughMemoryBuffer |
This class is an extension of MemoryBuffer, which allows write access to the underlying contents and committing those changes to the original source. More... | |
Typedefs | |
typedef int(* | http_data_cb) (http_parser *, const char *at, size_t length) |
typedef int(* | http_cb) (http_parser *) |
using | recursive_spinlock = recursive_spinlock1 |
using | mutex = ::std::mutex |
using | recursive_mutex = ::std::recursive_mutex |
using | condition_variable = ::std::condition_variable |
template<size_t I, typename... Ts> | |
using | TypeAtIndex = std::tuple_element_t< I, std::tuple< Ts... > > |
Find the type at a given index in a list of types. More... | |
template<typename T > | |
using | is_trivially_move_constructible = std::is_trivially_move_constructible< T > |
template<typename T > | |
using | is_trivially_copy_constructible = std::is_trivially_copy_constructible< T > |
template<typename WrappedIteratorT , typename T1 = std::remove_reference_t<decltype( **std::declval<WrappedIteratorT>())>, typename T2 = std::add_pointer_t<T1>> | |
using | raw_pointer_iterator = pointer_iterator< pointee_iterator< WrappedIteratorT, T1 >, T2 > |
template<typename T > | |
using | remove_cvref_t = typename wpi::remove_cvref< T >::type |
typedef unsigned int | UTF32 |
typedef unsigned short | UTF16 |
typedef unsigned char | UTF8 |
typedef bool | Boolean |
typedef void(* | fatal_error_handler_t) (void *user_data, const char *reason, bool gen_crash_diag) |
An error handler callback. More... | |
template<typename RangeType > | |
using | ValueTypeFromRangeType = typename std::remove_const< typename std::remove_reference< decltype(*std::begin(std::declval< RangeType & >()))>::type >::type |
Enumerations | |
enum | http_status |
enum | http_method |
enum | http_parser_type { HTTP_REQUEST , HTTP_RESPONSE , HTTP_BOTH } |
enum | flags { F_CHUNKED = 1 << 0 , F_CONNECTION_KEEP_ALIVE = 1 << 1 , F_CONNECTION_CLOSE = 1 << 2 , F_CONNECTION_UPGRADE = 1 << 3 , F_TRAILING = 1 << 4 , F_UPGRADE = 1 << 5 , F_SKIPBODY = 1 << 6 , F_CONTENTLENGTH = 1 << 7 } |
enum | http_errno |
enum | http_parser_url_fields { UF_SCHEMA = 0 , UF_HOST = 1 , UF_PORT = 2 , UF_PATH = 3 , UF_QUERY = 4 , UF_FRAGMENT = 5 , UF_USERINFO = 6 , UF_MAX = 7 } |
enum | LogLevel { WPI_LOG_CRITICAL = 50 , WPI_LOG_ERROR = 40 , WPI_LOG_WARNING = 30 , WPI_LOG_INFO = 20 , WPI_LOG_DEBUG = 10 , WPI_LOG_DEBUG1 = 9 , WPI_LOG_DEBUG2 = 8 , WPI_LOG_DEBUG3 = 7 , WPI_LOG_DEBUG4 = 6 } |
enum | ZeroBehavior { ZB_Undefined , ZB_Max , ZB_Width } |
The behavior an operation has on an input of 0. More... | |
enum | ConversionResult { conversionOK , sourceExhausted , targetExhausted , sourceIllegal } |
enum | ConversionFlags { strictConversion = 0 , lenientConversion } |
enum class | errc { argument_list_too_long = int(std::errc::argument_list_too_long) , argument_out_of_domain = int(std::errc::argument_out_of_domain) , bad_address = int(std::errc::bad_address) , bad_file_descriptor = int(std::errc::bad_file_descriptor) , broken_pipe = int(std::errc::broken_pipe) , device_or_resource_busy = int(std::errc::device_or_resource_busy) , directory_not_empty = int(std::errc::directory_not_empty) , executable_format_error = int(std::errc::executable_format_error) , file_exists = int(std::errc::file_exists) , file_too_large = int(std::errc::file_too_large) , filename_too_long = int(std::errc::filename_too_long) , function_not_supported = int(std::errc::function_not_supported) , illegal_byte_sequence = int(std::errc::illegal_byte_sequence) , inappropriate_io_control_operation , interrupted = int(std::errc::interrupted) , invalid_argument = int(std::errc::invalid_argument) , invalid_seek = int(std::errc::invalid_seek) , io_error = int(std::errc::io_error) , is_a_directory = int(std::errc::is_a_directory) , no_child_process = int(std::errc::no_child_process) , no_lock_available = int(std::errc::no_lock_available) , no_space_on_device = int(std::errc::no_space_on_device) , no_such_device_or_address = int(std::errc::no_such_device_or_address) , no_such_device = int(std::errc::no_such_device) , no_such_file_or_directory = int(std::errc::no_such_file_or_directory) , no_such_process = int(std::errc::no_such_process) , not_a_directory = int(std::errc::not_a_directory) , not_enough_memory = int(std::errc::not_enough_memory) , not_supported = int(std::errc::not_supported) , operation_not_permitted = int(std::errc::operation_not_permitted) , permission_denied = int(std::errc::permission_denied) , read_only_file_system = int(std::errc::read_only_file_system) , resource_deadlock_would_occur = int(std::errc::resource_deadlock_would_occur) , resource_unavailable_try_again , result_out_of_range = int(std::errc::result_out_of_range) , too_many_files_open_in_system = int(std::errc::too_many_files_open_in_system) , too_many_files_open = int(std::errc::too_many_files_open) , too_many_links = int(std::errc::too_many_links) } |
Functions | |
std::string_view | MimeTypeFromPath (std::string_view path) |
std::string_view | UnescapeURI (std::string_view str, SmallVectorImpl< char > &buf, bool *error) |
std::string_view | EscapeURI (std::string_view str, SmallVectorImpl< char > &buf, bool spacePlus=true) |
bool | ParseHttpHeaders (raw_istream &is, SmallVectorImpl< char > *contentType, SmallVectorImpl< char > *contentLength) |
bool | FindMultipartBoundary (wpi::raw_istream &is, std::string_view boundary, std::string *saveBuf) |
std::string | GetHostname () |
std::string_view | GetHostname (SmallVectorImpl< char > &name) |
int | SocketErrno () |
std::string | SocketStrerror (int code) |
std::string | SocketStrerror () |
unsigned long | http_parser_version (void) |
void | http_parser_init (http_parser *parser, enum http_parser_type type) |
void | http_parser_settings_init (http_parser_settings *settings) |
size_t | http_parser_execute (http_parser *parser, const http_parser_settings *settings, const char *data, size_t len) |
int | http_should_keep_alive (const http_parser *parser) |
const char * | http_method_str (enum http_method m) |
const char * | http_status_str (enum http_status s) |
const char * | http_errno_name (enum http_errno err) |
const char * | http_errno_description (enum http_errno err) |
void | http_parser_url_init (struct http_parser_url *u) |
int | http_parser_parse_url (const char *buf, size_t buflen, int is_connect, struct http_parser_url *u) |
void | http_parser_pause (http_parser *parser, int paused) |
int | http_body_is_final (const http_parser *parser) |
template<typename T > | |
std::vector< T >::iterator | insert_sorted (std::vector< T > &vec, T const &item) |
uint64_t | SizeUleb128 (uint64_t val) |
Get size of unsigned LEB128 data. More... | |
uint64_t | WriteUleb128 (SmallVectorImpl< char > &dest, uint64_t val) |
Write unsigned LEB128 data. More... | |
void | WriteUleb128 (raw_ostream &os, uint64_t val) |
Write unsigned LEB128 data. More... | |
uint64_t | ReadUleb128 (const char *addr, uint64_t *ret) |
Read unsigned LEB128 data. More... | |
bool | ReadUleb128 (raw_istream &is, uint64_t *ret) |
Read unsigned LEB128 data from a stream. More... | |
template<typename T > | |
future< T > | make_ready_future (T &&value) |
Constructs a valid future with the value set. More... | |
future< void > | make_ready_future () |
Constructs a valid future with the value set. More... | |
std::string | Demangle (std::string_view mangledSymbol) |
Demangle a C++ symbol. More... | |
std::string | GetStackTrace (int offset) |
Get a stack trace, ignoring the first "offset" symbols. More... | |
std::string | GetStackTraceDefault (int offset) |
The default implementation used for GetStackTrace(). More... | |
void | SetGetStackTraceImpl (std::string(*func)(int offset)) |
Set the implementation used by GetStackTrace(). More... | |
template<typename T > | |
constexpr std::span< T > | drop_front (std::span< T > in, typename std::span< T >::size_type n=1) |
Drop the first N elements of the array. More... | |
template<typename T > | |
constexpr std::span< T > | drop_back (std::span< T > in, typename std::span< T >::size_type n=1) |
Drop the last N elements of the array. More... | |
template<typename T , typename... Ts> | |
array (T, Ts...) -> array< std::enable_if_t<(std::is_same_v< T, Ts > &&...), T >, 1+sizeof...(Ts)> | |
size_t | Base64Decode (raw_ostream &os, std::string_view encoded) |
size_t | Base64Decode (std::string_view encoded, std::string *plain) |
std::string_view | Base64Decode (std::string_view encoded, size_t *num_read, SmallVectorImpl< char > &buf) |
size_t | Base64Decode (std::string_view encoded, std::vector< uint8_t > *plain) |
std::span< uint8_t > | Base64Decode (std::string_view encoded, size_t *num_read, SmallVectorImpl< uint8_t > &buf) |
void | Base64Encode (raw_ostream &os, std::string_view plain) |
void | Base64Encode (std::string_view plain, std::string *encoded) |
std::string_view | Base64Encode (std::string_view plain, SmallVectorImpl< char > &buf) |
void | Base64Encode (raw_ostream &os, std::span< const uint8_t > plain) |
void | Base64Encode (std::span< const uint8_t > plain, std::string *encoded) |
std::string_view | Base64Encode (std::span< const uint8_t > plain, SmallVectorImpl< char > &buf) |
std::error_code | mapWindowsError (unsigned EV) |
template<typename ... PTs> | |
bool | operator== (PointerUnion< PTs... > lhs, PointerUnion< PTs... > rhs) |
template<typename ... PTs> | |
bool | operator!= (PointerUnion< PTs... > lhs, PointerUnion< PTs... > rhs) |
template<typename ... PTs> | |
bool | operator< (PointerUnion< PTs... > lhs, PointerUnion< PTs... > rhs) |
template<class T > | |
iterator_range< T > | make_range (T x, T y) |
Convenience function for iterating over sub-ranges. More... | |
template<typename T > | |
iterator_range< T > | make_range (std::pair< T, T > p) |
template<typename RangeT , typename WrappedIteratorT = decltype(std::begin(std::declval<RangeT>()))> | |
iterator_range< pointee_iterator< WrappedIteratorT > > | make_pointee_range (RangeT &&Range) |
template<typename RangeT , typename WrappedIteratorT = decltype(std::begin(std::declval<RangeT>()))> | |
iterator_range< pointer_iterator< WrappedIteratorT > > | make_pointer_range (RangeT &&Range) |
raw_ostream & | operator<< (raw_ostream &OS, sys::TimePoint<> TP) |
template<typename T > | |
unsigned | countTrailingZeros (T Val, ZeroBehavior ZB=ZB_Width) |
Count number of 0's from the least significant bit to the most stopping at the first 1. More... | |
template<typename T > | |
unsigned | countLeadingZeros (T Val, ZeroBehavior ZB=ZB_Width) |
Count number of 0's from the most significant bit to the least stopping at the first 1. More... | |
template<typename T > | |
T | findFirstSet (T Val, ZeroBehavior ZB=ZB_Max) |
Get the index of the first set bit starting from the least significant bit. More... | |
template<typename T > | |
T | maskTrailingOnes (unsigned N) |
Create a bitmask with the N right-most bits set to 1, and all other bits set to 0. More... | |
template<typename T > | |
T | maskLeadingOnes (unsigned N) |
Create a bitmask with the N left-most bits set to 1, and all other bits set to 0. More... | |
template<typename T > | |
T | maskTrailingZeros (unsigned N) |
Create a bitmask with the N right-most bits set to 0, and all other bits set to 1. More... | |
template<typename T > | |
T | maskLeadingZeros (unsigned N) |
Create a bitmask with the N left-most bits set to 0, and all other bits set to 1. More... | |
template<typename T > | |
T | findLastSet (T Val, ZeroBehavior ZB=ZB_Max) |
Get the index of the last set bit starting from the least significant bit. More... | |
template<typename T > | |
T | reverseBits (T Val) |
Reverse the bits in Val . More... | |
constexpr uint32_t | Hi_32 (uint64_t Value) |
Return the high 32 bits of a 64 bit value. More... | |
constexpr uint32_t | Lo_32 (uint64_t Value) |
Return the low 32 bits of a 64 bit value. More... | |
constexpr uint64_t | Make_64 (uint32_t High, uint32_t Low) |
Make a 64-bit integer from a high / low pair of 32-bit integers. More... | |
template<unsigned N> | |
constexpr bool | isInt (int64_t x) |
Checks if an integer fits into the given bit width. More... | |
template<> | |
constexpr bool | isInt< 8 > (int64_t x) |
template<> | |
constexpr bool | isInt< 16 > (int64_t x) |
template<> | |
constexpr bool | isInt< 32 > (int64_t x) |
template<unsigned N, unsigned S> | |
constexpr bool | isShiftedInt (int64_t x) |
Checks if a signed integer is an N bit number shifted left by S. More... | |
template<unsigned N> | |
constexpr std::enable_if_t<(N< 64), bool > | isUInt (uint64_t X) |
Checks if an unsigned integer fits into the given bit width. More... | |
constexpr bool | isUInt (uint64_t) |
template<> | |
constexpr bool | isUInt< 8 > (uint64_t x) |
template<> | |
constexpr bool | isUInt< 16 > (uint64_t x) |
template<> | |
constexpr bool | isUInt< 32 > (uint64_t x) |
template<unsigned N, unsigned S> | |
constexpr bool | isShiftedUInt (uint64_t x) |
Checks if a unsigned integer is an N bit number shifted left by S. More... | |
uint64_t | maxUIntN (uint64_t N) |
Gets the maximum value for a N-bit unsigned integer. More... | |
int64_t | minIntN (int64_t N) |
Gets the minimum value for a N-bit signed integer. More... | |
int64_t | maxIntN (int64_t N) |
Gets the maximum value for a N-bit signed integer. More... | |
bool | isUIntN (unsigned N, uint64_t x) |
Checks if an unsigned integer fits into the given (dynamic) bit width. More... | |
bool | isIntN (unsigned N, int64_t x) |
Checks if an signed integer fits into the given (dynamic) bit width. More... | |
constexpr bool | isMask_32 (uint32_t Value) |
Return true if the argument is a non-empty sequence of ones starting at the least significant bit with the remainder zero (32 bit version). More... | |
constexpr bool | isMask_64 (uint64_t Value) |
Return true if the argument is a non-empty sequence of ones starting at the least significant bit with the remainder zero (64 bit version). More... | |
constexpr bool | isShiftedMask_32 (uint32_t Value) |
Return true if the argument contains a non-empty sequence of ones with the remainder zero (32 bit version.) Ex. More... | |
constexpr bool | isShiftedMask_64 (uint64_t Value) |
Return true if the argument contains a non-empty sequence of ones with the remainder zero (64 bit version.) More... | |
constexpr bool | isPowerOf2_32 (uint32_t Value) |
Return true if the argument is a power of two > 0. More... | |
constexpr bool | isPowerOf2_64 (uint64_t Value) |
Return true if the argument is a power of two > 0 (64 bit edition.) More... | |
template<typename T > | |
unsigned | countLeadingOnes (T Value, ZeroBehavior ZB=ZB_Width) |
Count the number of ones from the most significant bit to the first zero bit. More... | |
template<typename T > | |
unsigned | countTrailingOnes (T Value, ZeroBehavior ZB=ZB_Width) |
Count the number of ones from the least significant bit to the first zero bit. More... | |
template<typename T > | |
unsigned | countPopulation (T Value) |
Count the number of set bits in a value. More... | |
template<size_t kValue> | |
constexpr size_t | CTLog2 () |
Compile time Log2. More... | |
template<> | |
constexpr size_t | CTLog2< 1 > () |
double | Log2 (double Value) |
Return the log base 2 of the specified value. More... | |
unsigned | Log2_32 (uint32_t Value) |
Return the floor log base 2 of the specified value, -1 if the value is zero. More... | |
unsigned | Log2_64 (uint64_t Value) |
Return the floor log base 2 of the specified value, -1 if the value is zero. More... | |
unsigned | Log2_32_Ceil (uint32_t Value) |
Return the ceil log base 2 of the specified value, 32 if the value is zero. More... | |
unsigned | Log2_64_Ceil (uint64_t Value) |
Return the ceil log base 2 of the specified value, 64 if the value is zero. More... | |
template<typename T > | |
T | greatestCommonDivisor (T A, T B) |
Return the greatest common divisor of the values using Euclid's algorithm. More... | |
uint64_t | GreatestCommonDivisor64 (uint64_t A, uint64_t B) |
double | BitsToDouble (uint64_t Bits) |
This function takes a 64-bit integer and returns the bit equivalent double. More... | |
float | BitsToFloat (uint32_t Bits) |
This function takes a 32-bit integer and returns the bit equivalent float. More... | |
uint64_t | DoubleToBits (double Double) |
This function takes a double and returns the bit equivalent 64-bit integer. More... | |
uint32_t | FloatToBits (float Float) |
This function takes a float and returns the bit equivalent 32-bit integer. More... | |
constexpr uint64_t | MinAlign (uint64_t A, uint64_t B) |
A and B are either alignments or offsets. More... | |
uint64_t | NextPowerOf2 (uint64_t A) |
Returns the next power of two (in 64-bits) that is strictly greater than A. More... | |
uint64_t | PowerOf2Floor (uint64_t A) |
Returns the power of two which is less than or equal to the given value. More... | |
uint64_t | PowerOf2Ceil (uint64_t A) |
Returns the power of two which is greater than or equal to the given value. More... | |
uint64_t | alignTo (uint64_t Value, uint64_t Align, uint64_t Skew=0) |
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Align . More... | |
template<uint64_t Align> | |
constexpr uint64_t | alignTo (uint64_t Value) |
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Align . More... | |
uint64_t | divideCeil (uint64_t Numerator, uint64_t Denominator) |
Returns the integer ceil(Numerator / Denominator). More... | |
uint64_t | divideNearest (uint64_t Numerator, uint64_t Denominator) |
Returns the integer nearest(Numerator / Denominator). More... | |
uint64_t | alignDown (uint64_t Value, uint64_t Align, uint64_t Skew=0) |
Returns the largest uint64_t less than or equal to Value and is Skew mod Align . More... | |
template<unsigned B> | |
constexpr int32_t | SignExtend32 (uint32_t X) |
Sign-extend the number in the bottom B bits of X to a 32-bit integer. More... | |
int32_t | SignExtend32 (uint32_t X, unsigned B) |
Sign-extend the number in the bottom B bits of X to a 32-bit integer. More... | |
template<unsigned B> | |
constexpr int64_t | SignExtend64 (uint64_t x) |
Sign-extend the number in the bottom B bits of X to a 64-bit integer. More... | |
int64_t | SignExtend64 (uint64_t X, unsigned B) |
Sign-extend the number in the bottom B bits of X to a 64-bit integer. More... | |
template<typename T > | |
std::enable_if_t< std::is_unsigned< T >::value, T > | AbsoluteDifference (T X, T Y) |
Subtract two unsigned integers, X and Y, of type T and return the absolute value of the result. More... | |
template<typename T > | |
std::enable_if_t< std::is_unsigned< T >::value, T > | SaturatingAdd (T X, T Y, bool *ResultOverflowed=nullptr) |
Add two unsigned integers, X and Y, of type T. More... | |
template<typename T > | |
std::enable_if_t< std::is_unsigned< T >::value, T > | SaturatingMultiply (T X, T Y, bool *ResultOverflowed=nullptr) |
Multiply two unsigned integers, X and Y, of type T. More... | |
template<typename T > | |
std::enable_if_t< std::is_unsigned< T >::value, T > | SaturatingMultiplyAdd (T X, T Y, T A, bool *ResultOverflowed=nullptr) |
Multiply two unsigned integers, X and Y, and add the unsigned integer, A to the product. More... | |
template<typename T > | |
std::enable_if_t< std::is_signed< T >::value, T > | AddOverflow (T X, T Y, T &Result) |
Add two signed integers, computing the two's complement truncated result, returning true if overflow occured. More... | |
template<typename T > | |
std::enable_if_t< std::is_signed< T >::value, T > | SubOverflow (T X, T Y, T &Result) |
Subtract two signed integers, computing the two's complement truncated result, returning true if an overflow ocurred. More... | |
template<typename T > | |
std::enable_if_t< std::is_signed< T >::value, T > | MulOverflow (T X, T Y, T &Result) |
Multiply two signed integers, computing the two's complement truncated result, returning true if an overflow ocurred. More... | |
template<typename T > | |
constexpr int | sgn (T val) |
template<typename T > | |
constexpr T | Lerp (const T &startValue, const T &endValue, double t) |
Linearly interpolates between two values. More... | |
ConversionResult | ConvertUTF8toUTF16 (const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags) |
ConversionResult | ConvertUTF8toUTF32Partial (const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags) |
Convert a partial UTF8 sequence to UTF32. More... | |
ConversionResult | ConvertUTF8toUTF32 (const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags) |
Convert a partial UTF8 sequence to UTF32. More... | |
ConversionResult | ConvertUTF16toUTF8 (const UTF16 **sourceStart, const UTF16 *sourceEnd, UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags) |
ConversionResult | ConvertUTF32toUTF8 (const UTF32 **sourceStart, const UTF32 *sourceEnd, UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags) |
ConversionResult | ConvertUTF16toUTF32 (const UTF16 **sourceStart, const UTF16 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags) |
ConversionResult | ConvertUTF32toUTF16 (const UTF32 **sourceStart, const UTF32 *sourceEnd, UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags) |
Boolean | isLegalUTF8Sequence (const UTF8 *source, const UTF8 *sourceEnd) |
Boolean | isLegalUTF8String (const UTF8 **source, const UTF8 *sourceEnd) |
unsigned | getNumBytesForUTF8 (UTF8 firstByte) |
bool | ConvertUTF8toWide (unsigned WideCharWidth, std::string_view Source, char *&ResultPtr, const UTF8 *&ErrorPtr) |
Convert an UTF8 string_view to UTF8, UTF16, or UTF32 depending on WideCharWidth. More... | |
bool | ConvertUTF8toWide (std::string_view Source, std::wstring &Result) |
Converts a UTF-8 string_view to a std::wstring. More... | |
bool | ConvertUTF8toWide (const char *Source, std::wstring &Result) |
Converts a UTF-8 C-string to a std::wstring. More... | |
bool | convertWideToUTF8 (const std::wstring &Source, SmallVectorImpl< char > &Result) |
Converts a std::wstring to a UTF-8 encoded std::string. More... | |
bool | ConvertCodePointToUTF8 (unsigned Source, char *&ResultPtr) |
Convert an Unicode code point to UTF8 sequence. More... | |
ConversionResult | convertUTF8Sequence (const UTF8 **source, const UTF8 *sourceEnd, UTF32 *target, ConversionFlags flags) |
Convert the first UTF8 sequence in the given source buffer to a UTF32 code point. More... | |
bool | hasUTF16ByteOrderMark (std::span< const char > SrcBytes) |
Returns true if a blob of text starts with a UTF-16 big or little endian byte order mark. More... | |
bool | convertUTF16ToUTF8String (std::span< const char > SrcBytes, SmallVectorImpl< char > &Out) |
Converts a stream of raw bytes assumed to be UTF16 into a UTF8 std::string. More... | |
bool | convertUTF16ToUTF8String (std::span< const UTF16 > Src, SmallVectorImpl< char > &Out) |
Converts a UTF16 string into a UTF8 std::string. More... | |
bool | convertUTF8ToUTF16String (std::string_view SrcUTF8, SmallVectorImpl< UTF16 > &DstUTF16) |
Converts a UTF-8 string into a UTF-16 string with native endianness. More... | |
constexpr char | hexdigit (unsigned X, bool LowerCase=false) noexcept |
hexdigit - Return the hexadecimal character for the given number X (which should be less than 16). More... | |
constexpr unsigned | hexDigitValue (char C) noexcept |
Interpret the given character C as a hexadecimal digit and return its value. More... | |
constexpr bool | isDigit (char C) noexcept |
Checks if character C is one of the 10 decimal digits. More... | |
constexpr bool | isHexDigit (char C) noexcept |
Checks if character C is a hexadecimal numeric character. More... | |
constexpr bool | isAlpha (char C) noexcept |
Checks if character C is a valid letter as classified by "C" locale. More... | |
constexpr bool | isAlnum (char C) noexcept |
Checks whether character C is either a decimal digit or an uppercase or lowercase letter as classified by "C" locale. More... | |
constexpr bool | isASCII (char C) noexcept |
Checks whether character C is valid ASCII (high bit is zero). More... | |
constexpr bool | isPrint (char C) noexcept |
Checks whether character C is printable. More... | |
constexpr char | toLower (char x) noexcept |
Returns the corresponding lowercase character if x is uppercase. More... | |
constexpr char | toUpper (char x) noexcept |
Returns the corresponding uppercase character if x is lowercase. More... | |
std::string | utohexstr (unsigned long long val, bool lowerCase=false) |
constexpr bool | equals (std::string_view lhs, std::string_view rhs) noexcept |
equals - Check for string equality, this is more efficient than compare() when the relative ordering of inequal strings isn't needed. More... | |
int | compare_lower (std::string_view lhs, std::string_view rhs) noexcept |
compare_lower - Compare two strings, ignoring case. More... | |
constexpr bool | equals_lower (std::string_view lhs, std::string_view rhs) noexcept |
equals_lower - Check for string equality, ignoring case. More... | |
std::string_view::size_type | find_lower (std::string_view str, char ch, std::string_view::size_type from=0) noexcept |
Search for the first character ch in str , ignoring case. More... | |
std::string_view::size_type | find_lower (std::string_view str, std::string_view other, std::string_view::size_type from=0) noexcept |
Search for the first string other in str , ignoring case. More... | |
std::string_view::size_type | find_lower (std::string_view str, const char *other, std::string_view::size_type from=0) noexcept |
Search for the first string other in str , ignoring case. More... | |
std::string_view::size_type | rfind_lower (std::string_view str, char ch, std::string_view::size_type from=std::string_view::npos) noexcept |
Search for the last character ch in str , ignoring case. More... | |
std::string_view::size_type | rfind_lower (std::string_view str, std::string_view other) noexcept |
Search for the last string other in str , ignoring case. More... | |
std::string_view::size_type | rfind_lower (std::string_view str, const char *other) noexcept |
Search for the last string other in str , ignoring case. More... | |
constexpr std::string_view | substr (std::string_view str, std::string_view::size_type start, std::string_view::size_type n=std::string_view::npos) noexcept |
Returns the substring of str from [start, start + n). More... | |
constexpr bool | starts_with (std::string_view str, std::string_view prefix) noexcept |
Checks if str starts with the given prefix . More... | |
constexpr bool | starts_with (std::string_view str, char prefix) noexcept |
Checks if str starts with the given prefix . More... | |
constexpr bool | starts_with (std::string_view str, const char *prefix) noexcept |
Checks if str starts with the given prefix . More... | |
bool | starts_with_lower (std::string_view str, std::string_view prefix) noexcept |
Checks if str starts with the given prefix , ignoring case. More... | |
constexpr bool | starts_with_lower (std::string_view str, char prefix) noexcept |
Checks if str starts with the given prefix , ignoring case. More... | |
bool | starts_with_lower (std::string_view str, const char *prefix) noexcept |
Checks if str starts with the given prefix , ignoring case. More... | |
constexpr bool | ends_with (std::string_view str, std::string_view suffix) noexcept |
Checks if str ends with the given suffix . More... | |
constexpr bool | ends_with (std::string_view str, char suffix) noexcept |
Checks if str ends with the given suffix . More... | |
constexpr bool | ends_with (std::string_view str, const char *suffix) noexcept |
Checks if str ends with the given suffix . More... | |
bool | ends_with_lower (std::string_view str, std::string_view suffix) noexcept |
Checks if str ends with the given suffix , ignoring case. More... | |
constexpr bool | ends_with_lower (std::string_view str, char suffix) noexcept |
Checks if str ends with the given suffix , ignoring case. More... | |
bool | ends_with_lower (std::string_view str, const char *suffix) noexcept |
Checks if str ends with the given suffix , ignoring case. More... | |
constexpr bool | contains (std::string_view str, std::string_view other) noexcept |
Checks if str contains the substring other . More... | |
constexpr bool | contains (std::string_view str, char ch) noexcept |
Checks if str contains the substring other . More... | |
constexpr bool | contains (std::string_view str, const char *other) noexcept |
Checks if str contains the substring other . More... | |
bool | contains_lower (std::string_view str, std::string_view other) noexcept |
Checks if str contains the substring other , ignoring case. More... | |
bool | contains_lower (std::string_view str, char ch) noexcept |
Checks if str contains the substring other , ignoring case. More... | |
bool | contains_lower (std::string_view str, const char *other) noexcept |
Checks if str contains the substring other , ignoring case. More... | |
constexpr std::string_view | drop_front (std::string_view str, std::string_view::size_type n=1) noexcept |
Return a string_view equal to str but with the first n elements dropped. More... | |
constexpr std::string_view | drop_back (std::string_view str, std::string_view::size_type n=1) noexcept |
Return a string_view equal to str but with the last n elements dropped. More... | |
constexpr std::string_view | take_front (std::string_view str, std::string_view::size_type n=1) noexcept |
Returns a view equal to str but with only the first n elements remaining. More... | |
constexpr std::string_view | take_back (std::string_view str, std::string_view::size_type n=1) noexcept |
Returns a view equal to str but with only the last n elements remaining. More... | |
constexpr std::string_view | slice (std::string_view str, std::string_view::size_type start, std::string_view::size_type end) noexcept |
Returns a reference to the substring of str from [start, end). More... | |
constexpr std::pair< std::string_view, std::string_view > | split (std::string_view str, char separator) noexcept |
Splits str into two substrings around the first occurrence of a separator character. More... | |
constexpr std::pair< std::string_view, std::string_view > | split (std::string_view str, std::string_view separator) noexcept |
Splits str into two substrings around the first occurrence of a separator string. More... | |
constexpr std::pair< std::string_view, std::string_view > | rsplit (std::string_view str, char separator) noexcept |
Splits str into two substrings around the last occurrence of a separator character. More... | |
constexpr std::pair< std::string_view, std::string_view > | rsplit (std::string_view str, std::string_view separator) noexcept |
Splits str into two substrings around the last occurrence of a separator string. More... | |
void | split (std::string_view str, SmallVectorImpl< std::string_view > &arr, std::string_view separator, int maxSplit=-1, bool keepEmpty=true) noexcept |
Splits str into substrings around the occurrences of a separator string. More... | |
void | split (std::string_view str, SmallVectorImpl< std::string_view > &arr, char separator, int maxSplit=-1, bool keepEmpty=true) noexcept |
Splits str into substrings around the occurrences of a separator character. More... | |
constexpr std::string_view | ltrim (std::string_view str, char ch) noexcept |
Returns str with consecutive ch characters starting from the the left removed. More... | |
constexpr std::string_view | ltrim (std::string_view str, std::string_view chars=" \t\n\v\f\r") noexcept |
Returns str with consecutive characters in chars starting from the left removed. More... | |
constexpr std::string_view | rtrim (std::string_view str, char ch) noexcept |
Returns str with consecutive Char characters starting from the right removed. More... | |
constexpr std::string_view | rtrim (std::string_view str, std::string_view chars=" \t\n\v\f\r") noexcept |
Returns str with consecutive characters in chars starting from the right removed. More... | |
constexpr std::string_view | trim (std::string_view str, char ch) noexcept |
Returns str with consecutive ch characters starting from the left and right removed. More... | |
constexpr std::string_view | trim (std::string_view str, std::string_view chars=" \t\n\v\f\r") noexcept |
Returns str with consecutive characters in chars starting from the left and right removed. More... | |
template<typename T , std::enable_if_t< std::numeric_limits< T >::is_signed, bool > = true> | |
std::optional< T > | parse_integer (std::string_view str, unsigned radix) noexcept |
Parses the string str as an integer of the specified radix. More... | |
template<typename T , std::enable_if_t< std::numeric_limits< T >::is_signed, bool > = true> | |
std::optional< T > | consume_integer (std::string_view *str, unsigned radix) noexcept |
Parses the string str as an integer of the specified radix. More... | |
template<typename T > | |
std::optional< T > | parse_float (std::string_view str) noexcept |
Parses the string str as a floating point value. More... | |
template<> | |
std::optional< float > | parse_float< float > (std::string_view str) noexcept |
template<> | |
std::optional< double > | parse_float< double > (std::string_view str) noexcept |
template<> | |
std::optional< long double > | parse_float< long double > (std::string_view str) noexcept |
std::pair< std::string_view, std::string_view > | UnescapeCString (std::string_view str, SmallVectorImpl< char > &buf) |
Unescapes a C-style string (reverse operation to raw_ostream::write_escaped). More... | |
void | install_fatal_error_handler (fatal_error_handler_t handler, void *user_data=nullptr) |
install_fatal_error_handler - Installs a new error handler to be used whenever a serious (non-recoverable) error is encountered by LLVM. More... | |
void | remove_fatal_error_handler () |
Restores default error handling behavior. More... | |
void | report_fatal_error (const char *reason, bool gen_crash_diag=true) |
Reports a serious error, calling any installed error handler. More... | |
void | report_fatal_error (const std::string &reason, bool gen_crash_diag=true) |
void | report_fatal_error (std::string_view reason, bool gen_crash_diag=true) |
void | install_bad_alloc_error_handler (fatal_error_handler_t handler, void *user_data=nullptr) |
Installs a new bad alloc error handler that should be used whenever a bad alloc error, e.g. More... | |
void | remove_bad_alloc_error_handler () |
Restores default bad alloc error handling behavior. More... | |
void | install_out_of_memory_new_handler () |
void | report_bad_alloc_error (const char *Reason, bool GenCrashDiag=true) |
Reports a bad alloc error, calling any user defined bad alloc error handler. More... | |
void | wpi_unreachable_internal (const char *msg=nullptr, const char *file=nullptr, unsigned line=0) |
This function calls abort(), and prints the optional message to stderr. More... | |
uint16_t | ByteSwap_16 (uint16_t value) |
ByteSwap_16 - This function returns a byte-swapped representation of the 16-bit argument. More... | |
uint32_t | ByteSwap_32 (uint32_t value) |
This function returns a byte-swapped representation of the 32-bit argument. More... | |
uint64_t | ByteSwap_64 (uint64_t value) |
This function returns a byte-swapped representation of the 64-bit argument. More... | |
template<typename ValueTy > | |
bool | operator== (const StringMap< ValueTy > &lhs, const StringMap< ValueTy > &rhs) |
template<typename ValueTy > | |
bool | operator!= (const StringMap< ValueTy > &lhs, const StringMap< ValueTy > &rhs) |
template<typename ValueTy > | |
bool | operator< (const StringMap< ValueTy > &lhs, const StringMap< ValueTy > &rhs) |
template<typename ValueTy > | |
bool | operator<= (const StringMap< ValueTy > &lhs, const StringMap< ValueTy > &rhs) |
template<typename ValueTy > | |
bool | operator> (const StringMap< ValueTy > &lhs, const StringMap< ValueTy > &rhs) |
template<typename ValueTy > | |
bool | operator>= (const StringMap< ValueTy > &lhs, const StringMap< ValueTy > &rhs) |
template<typename T > | |
std::enable_if_t< is_integral_or_enum< T >::value, hash_code > | hash_value (T value) |
Compute a hash_code for any integer value. More... | |
template<typename T > | |
hash_code | hash_value (const T *ptr) |
Compute a hash_code for a pointer's address. More... | |
template<typename T , typename U > | |
hash_code | hash_value (const std::pair< T, U > &arg) |
Compute a hash_code for a pair of objects. More... | |
template<typename... Ts> | |
hash_code | hash_value (const std::tuple< Ts... > &arg) |
Compute a hash_code for a tuple. More... | |
template<typename T > | |
hash_code | hash_value (const std::basic_string< T > &arg) |
Compute a hash_code for a standard string. More... | |
void | set_fixed_execution_hash_seed (uint64_t fixed_value) |
Override the execution seed with a fixed value. More... | |
template<typename InputIteratorT > | |
hash_code | hash_combine_range (InputIteratorT first, InputIteratorT last) |
Compute a hash_code for a sequence of values. More... | |
template<typename ... Ts> | |
hash_code | hash_combine (const Ts &...args) |
Combine values into a single hash_code. More... | |
template<typename T , unsigned LN, unsigned RN, typename C > | |
bool | operator== (const SmallSet< T, LN, C > &LHS, const SmallSet< T, RN, C > &RHS) |
Equality comparison for SmallSet. More... | |
template<typename T , unsigned LN, unsigned RN, typename C > | |
bool | operator!= (const SmallSet< T, LN, C > &LHS, const SmallSet< T, RN, C > &RHS) |
Inequality comparison for SmallSet. More... | |
LLVM_ATTRIBUTE_RETURNS_NONNULL void * | safe_malloc (size_t Sz) |
LLVM_ATTRIBUTE_RETURNS_NONNULL void * | safe_calloc (size_t Count, size_t Sz) |
LLVM_ATTRIBUTE_RETURNS_NONNULL void * | safe_realloc (void *Ptr, size_t Sz) |
LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * | allocate_buffer (size_t Size, size_t Alignment) |
Allocate a buffer of memory with the given size and alignment. More... | |
void | deallocate_buffer (void *Ptr, size_t Size, size_t Alignment) |
Deallocate a buffer of memory with the given size and alignment. More... | |
template<typename T , unsigned N> | |
size_t | capacity_in_bytes (const SmallVector< T, N > &X) |
template<unsigned Size, typename R > | |
SmallVector< ValueTypeFromRangeType< R >, Size > | to_vector (R &&Range) |
Given a range of type R, iterate the entire range and return a SmallVector with elements of the vector. More... | |
template<typename R > | |
SmallVector< ValueTypeFromRangeType< R >, CalculateSmallVectorDefaultInlinedElements< ValueTypeFromRangeType< R > >::value > | to_vector (R &&Range) |
template<class T = void *> | |
bool | shouldReverseIterate () |
std::error_code | make_error_code (errc E) |
uint32_t | djbHash (std::string_view Buffer, uint32_t H=5381) |
The Bernstein hash function used by the DWARF accelerator tables. More... | |
template<typename DerivedT , typename KeyT , typename ValueT , typename KeyInfoT , typename BucketT > | |
bool | operator== (const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > &LHS, const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > &RHS) |
Equality comparison for DenseMap. More... | |
template<typename DerivedT , typename KeyT , typename ValueT , typename KeyInfoT , typename BucketT > | |
bool | operator!= (const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > &LHS, const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > &RHS) |
Inequality comparison for DenseMap. More... | |
template<typename KeyT , typename ValueT , typename KeyInfoT > | |
size_t | capacity_in_bytes (const DenseMap< KeyT, ValueT, KeyInfoT > &X) |
template<typename OStream , typename T > | |
std::enable_if_t<!std::is_reference< OStream >::value &&std::is_base_of< raw_ostream, OStream >::value, OStream && > | operator<< (OStream &&OS, const T &Value) |
Call the appropriate insertion operator, given an rvalue reference to a raw_ostream object and return a stream of the same type as the argument. More... | |
raw_fd_ostream & | outs () |
This returns a reference to a raw_fd_ostream for standard output. More... | |
raw_fd_ostream & | errs () |
This returns a reference to a raw_ostream for standard error. More... | |
raw_ostream & | nulls () |
This returns a reference to a raw_ostream which simply discards output. More... | |
template<typename PtrType > | |
bool | operator== (const SmallPtrSetImpl< PtrType > &LHS, const SmallPtrSetImpl< PtrType > &RHS) |
Equality comparison for SmallPtrSet. More... | |
template<typename PtrType > | |
bool | operator!= (const SmallPtrSetImpl< PtrType > &LHS, const SmallPtrSetImpl< PtrType > &RHS) |
Inequality comparison for SmallPtrSet. More... | |
Variables | |
constexpr empty_array_t | empty_array |
static const unsigned char | BitReverseTable256 [256] |
Macro compressed bit reversal table for 256 bits. More... | |
const float | huge_valf |
Use this rather than HUGE_VALF; the latter causes warnings on MSVC. More... | |
constexpr in_place_t | in_place |
template<typename T , unsigned N> | |
class LLVM_GSL_OWNER | SmallVector |
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference sizeof(SmallVector<T, 0>) . More... | |
/file This file defines the SmallVector class.
typedef bool wpi::Boolean |
using wpi::condition_variable = typedef ::std::condition_variable |
typedef void(* wpi::fatal_error_handler_t) (void *user_data, const char *reason, bool gen_crash_diag) |
An error handler callback.
typedef int(* wpi::http_cb) (http_parser *) |
typedef int(* wpi::http_data_cb) (http_parser *, const char *at, size_t length) |
using wpi::is_trivially_copy_constructible = typedef std::is_trivially_copy_constructible<T> |
using wpi::is_trivially_move_constructible = typedef std::is_trivially_move_constructible<T> |
using wpi::mutex = typedef ::std::mutex |
using wpi::raw_pointer_iterator = typedef pointer_iterator<pointee_iterator<WrappedIteratorT, T1>, T2> |
using wpi::recursive_mutex = typedef ::std::recursive_mutex |
using wpi::recursive_spinlock = typedef recursive_spinlock1 |
using wpi::remove_cvref_t = typedef typename wpi::remove_cvref<T>::type |
using wpi::TypeAtIndex = typedef std::tuple_element_t<I, std::tuple<Ts...> > |
Find the type at a given index in a list of types.
TypeAtIndex<I, Ts...> is the type at index I in Ts.
typedef unsigned short wpi::UTF16 |
typedef unsigned int wpi::UTF32 |
typedef unsigned char wpi::UTF8 |
using wpi::ValueTypeFromRangeType = typedef typename std::remove_const<typename std::remove_reference< decltype(*std::begin(std::declval<RangeType &>()))>::type>::type |
enum wpi::ConversionFlags |
|
strong |
enum wpi::flags |
enum wpi::http_errno |
enum wpi::http_method |
enum wpi::http_status |
enum wpi::LogLevel |
enum wpi::ZeroBehavior |
std::enable_if_t< std::is_unsigned< T >::value, T > wpi::AbsoluteDifference | ( | T | X, |
T | Y | ||
) |
Subtract two unsigned integers, X and Y, of type T and return the absolute value of the result.
std::enable_if_t< std::is_signed< T >::value, T > wpi::AddOverflow | ( | T | X, |
T | Y, | ||
T & | Result | ||
) |
Add two signed integers, computing the two's complement truncated result, returning true if overflow occured.
|
inline |
Returns the largest uint64_t less than or equal to Value
and is Skew
mod Align
.
Align
must be non-zero
|
inlineconstexpr |
Returns the next integer (mod 2**64) that is greater than or equal to Value
and is a multiple of Align
.
Align
must be non-zero.
|
inline |
Returns the next integer (mod 2**64) that is greater than or equal to Value
and is a multiple of Align
.
Align
must be non-zero.
If non-zero Skew
is specified, the return value will be a minimal integer that is greater than or equal to Value
and equal to Align
* N + Skew
for some integer N. If Skew
is larger than Align
, its value is adjusted to 'Skew
mod Align'
.
Examples:
LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * wpi::allocate_buffer | ( | size_t | Size, |
size_t | Alignment | ||
) |
Allocate a buffer of memory with the given size and alignment.
When the compiler supports aligned operator new, this will use it to to handle even over-aligned allocations.
However, this doesn't make any attempt to leverage the fancier techniques like posix_memalign due to portability. It is mostly intended to allow compatibility with platforms that, after aligned allocation was added, use reduced default alignment.
wpi::array | ( | T | , |
Ts... | |||
) | -> array< std::enable_if_t<(std::is_same_v< T, Ts > &&...), T >, 1+sizeof...(Ts)> |
size_t wpi::Base64Decode | ( | raw_ostream & | os, |
std::string_view | encoded | ||
) |
std::string_view wpi::Base64Decode | ( | std::string_view | encoded, |
size_t * | num_read, | ||
SmallVectorImpl< char > & | buf | ||
) |
std::span< uint8_t > wpi::Base64Decode | ( | std::string_view | encoded, |
size_t * | num_read, | ||
SmallVectorImpl< uint8_t > & | buf | ||
) |
size_t wpi::Base64Decode | ( | std::string_view | encoded, |
std::string * | plain | ||
) |
size_t wpi::Base64Decode | ( | std::string_view | encoded, |
std::vector< uint8_t > * | plain | ||
) |
void wpi::Base64Encode | ( | raw_ostream & | os, |
std::span< const uint8_t > | plain | ||
) |
void wpi::Base64Encode | ( | raw_ostream & | os, |
std::string_view | plain | ||
) |
std::string_view wpi::Base64Encode | ( | std::span< const uint8_t > | plain, |
SmallVectorImpl< char > & | buf | ||
) |
void wpi::Base64Encode | ( | std::span< const uint8_t > | plain, |
std::string * | encoded | ||
) |
std::string_view wpi::Base64Encode | ( | std::string_view | plain, |
SmallVectorImpl< char > & | buf | ||
) |
void wpi::Base64Encode | ( | std::string_view | plain, |
std::string * | encoded | ||
) |
|
inline |
This function takes a 64-bit integer and returns the bit equivalent double.
|
inline |
This function takes a 32-bit integer and returns the bit equivalent float.
|
inline |
ByteSwap_16 - This function returns a byte-swapped representation of the 16-bit argument.
|
inline |
This function returns a byte-swapped representation of the 32-bit argument.
|
inline |
This function returns a byte-swapped representation of the 64-bit argument.
|
inline |
|
inline |
|
noexcept |
compare_lower - Compare two strings, ignoring case.
|
inlinenoexcept |
Parses the string str
as an integer of the specified radix.
If radix
is specified as zero, this does radix autosensing using extended C rules: 0 is octal, 0x is hex, 0b is binary.
If the string does not begin with a number of the specified radix, this returns nullopt to signify the error. The string is considered erroneous if empty or if it overflows T. The portion of the string representing the discovered numeric value is removed from the beginning of the string.
|
constexprnoexcept |
Checks if str
contains the substring other
.
|
constexprnoexcept |
Checks if str
contains the substring other
.
|
constexprnoexcept |
Checks if str
contains the substring other
.
|
inlinenoexcept |
Checks if str
contains the substring other
, ignoring case.
|
inlinenoexcept |
Checks if str
contains the substring other
, ignoring case.
|
inlinenoexcept |
Checks if str
contains the substring other
, ignoring case.
bool wpi::ConvertCodePointToUTF8 | ( | unsigned | Source, |
char *& | ResultPtr | ||
) |
Convert an Unicode code point to UTF8 sequence.
Source | a Unicode code point. | |
[in,out] | ResultPtr | pointer to the output buffer, needs to be at least UNI_MAX_UTF8_BYTES_PER_CODE_POINT bytes. On success ResultPtr is updated one past end of the converted sequence. |
ConversionResult wpi::ConvertUTF16toUTF32 | ( | const UTF16 ** | sourceStart, |
const UTF16 * | sourceEnd, | ||
UTF32 ** | targetStart, | ||
UTF32 * | targetEnd, | ||
ConversionFlags | flags | ||
) |
ConversionResult wpi::ConvertUTF16toUTF8 | ( | const UTF16 ** | sourceStart, |
const UTF16 * | sourceEnd, | ||
UTF8 ** | targetStart, | ||
UTF8 * | targetEnd, | ||
ConversionFlags | flags | ||
) |
bool wpi::convertUTF16ToUTF8String | ( | std::span< const char > | SrcBytes, |
SmallVectorImpl< char > & | Out | ||
) |
Converts a stream of raw bytes assumed to be UTF16 into a UTF8 std::string.
[in] | SrcBytes | A buffer of what is assumed to be UTF-16 encoded text. |
[out] | Out | Converted UTF-8 is stored here on success. |
bool wpi::convertUTF16ToUTF8String | ( | std::span< const UTF16 > | Src, |
SmallVectorImpl< char > & | Out | ||
) |
Converts a UTF16 string into a UTF8 std::string.
[in] | Src | A buffer of UTF-16 encoded text. |
[out] | Out | Converted UTF-8 is stored here on success. |
ConversionResult wpi::ConvertUTF32toUTF16 | ( | const UTF32 ** | sourceStart, |
const UTF32 * | sourceEnd, | ||
UTF16 ** | targetStart, | ||
UTF16 * | targetEnd, | ||
ConversionFlags | flags | ||
) |
ConversionResult wpi::ConvertUTF32toUTF8 | ( | const UTF32 ** | sourceStart, |
const UTF32 * | sourceEnd, | ||
UTF8 ** | targetStart, | ||
UTF8 * | targetEnd, | ||
ConversionFlags | flags | ||
) |
|
inline |
Convert the first UTF8 sequence in the given source buffer to a UTF32 code point.
[in,out] | source | A pointer to the source buffer. If the conversion succeeds, this pointer will be updated to point to the byte just past the end of the converted sequence. |
sourceEnd | A pointer just past the end of the source buffer. | |
[out] | target | The converted code |
flags | Whether the conversion is strict or lenient. |
ConversionResult wpi::ConvertUTF8toUTF16 | ( | const UTF8 ** | sourceStart, |
const UTF8 * | sourceEnd, | ||
UTF16 ** | targetStart, | ||
UTF16 * | targetEnd, | ||
ConversionFlags | flags | ||
) |
bool wpi::convertUTF8ToUTF16String | ( | std::string_view | SrcUTF8, |
SmallVectorImpl< UTF16 > & | DstUTF16 | ||
) |
Converts a UTF-8 string into a UTF-16 string with native endianness.
ConversionResult wpi::ConvertUTF8toUTF32 | ( | const UTF8 ** | sourceStart, |
const UTF8 * | sourceEnd, | ||
UTF32 ** | targetStart, | ||
UTF32 * | targetEnd, | ||
ConversionFlags | flags | ||
) |
Convert a partial UTF8 sequence to UTF32.
If the sequence ends in an incomplete code unit sequence, returns sourceIllegal
.
ConversionResult wpi::ConvertUTF8toUTF32Partial | ( | const UTF8 ** | sourceStart, |
const UTF8 * | sourceEnd, | ||
UTF32 ** | targetStart, | ||
UTF32 * | targetEnd, | ||
ConversionFlags | flags | ||
) |
Convert a partial UTF8 sequence to UTF32.
If the sequence ends in an incomplete code unit sequence, returns sourceExhausted
.
bool wpi::ConvertUTF8toWide | ( | const char * | Source, |
std::wstring & | Result | ||
) |
Converts a UTF-8 C-string to a std::wstring.
bool wpi::ConvertUTF8toWide | ( | std::string_view | Source, |
std::wstring & | Result | ||
) |
Converts a UTF-8 string_view to a std::wstring.
bool wpi::ConvertUTF8toWide | ( | unsigned | WideCharWidth, |
std::string_view | Source, | ||
char *& | ResultPtr, | ||
const UTF8 *& | ErrorPtr | ||
) |
Convert an UTF8 string_view to UTF8, UTF16, or UTF32 depending on WideCharWidth.
The converted data is written to ResultPtr, which needs to point to at least WideCharWidth * (Source.Size() + 1) bytes. On success, ResultPtr will point one after the end of the copied string. On failure, ResultPtr will not be changed, and ErrorPtr will be set to the location of the first character which could not be converted.
bool wpi::convertWideToUTF8 | ( | const std::wstring & | Source, |
SmallVectorImpl< char > & | Result | ||
) |
Converts a std::wstring to a UTF-8 encoded std::string.
unsigned wpi::countLeadingOnes | ( | T | Value, |
ZeroBehavior | ZB = ZB_Width |
||
) |
Count the number of ones from the most significant bit to the first zero bit.
Ex. countLeadingOnes(0xFF0FFF00) == 8. Only unsigned integral types are allowed.
ZB | the behavior on an input of all ones. Only ZB_Width and ZB_Undefined are valid arguments. |
unsigned wpi::countLeadingZeros | ( | T | Val, |
ZeroBehavior | ZB = ZB_Width |
||
) |
Count number of 0's from the most significant bit to the least stopping at the first 1.
Only unsigned integral types are allowed.
ZB | the behavior on an input of 0. Only ZB_Width and ZB_Undefined are valid arguments. |
|
inline |
Count the number of set bits in a value.
Ex. countPopulation(0xF000F000) = 8 Returns 0 if the word is zero.
unsigned wpi::countTrailingOnes | ( | T | Value, |
ZeroBehavior | ZB = ZB_Width |
||
) |
Count the number of ones from the least significant bit to the first zero bit.
Ex. countTrailingOnes(0x00FF00FF) == 8. Only unsigned integral types are allowed.
ZB | the behavior on an input of all ones. Only ZB_Width and ZB_Undefined are valid arguments. |
unsigned wpi::countTrailingZeros | ( | T | Val, |
ZeroBehavior | ZB = ZB_Width |
||
) |
Count number of 0's from the least significant bit to the most stopping at the first 1.
Only unsigned integral types are allowed.
ZB | the behavior on an input of 0. Only ZB_Width and ZB_Undefined are valid arguments. |
|
inlineconstexpr |
Compile time Log2.
Valid only for positive powers of two.
|
inlineconstexpr |
void wpi::deallocate_buffer | ( | void * | Ptr, |
size_t | Size, | ||
size_t | Alignment | ||
) |
Deallocate a buffer of memory with the given size and alignment.
If supported, this will used the sized delete operator. Also if supported, this will pass the alignment to the delete operator.
The pointer must have been allocated with the corresponding new operator, most likely using the above helper.
std::string wpi::Demangle | ( | std::string_view | mangledSymbol | ) |
Demangle a C++ symbol.
mangledSymbol | the mangled symbol. |
|
inline |
Returns the integer ceil(Numerator / Denominator).
|
inline |
Returns the integer nearest(Numerator / Denominator).
|
inline |
The Bernstein hash function used by the DWARF accelerator tables.
|
inline |
This function takes a double and returns the bit equivalent 64-bit integer.
Note that copying doubles around changes the bits of NaNs on some hosts, notably x86, so this routine cannot be used if these bits are needed.
|
constexpr |
Drop the last N
elements of the array.
|
constexprnoexcept |
Return a string_view equal to str
but with the last n
elements dropped.
|
constexpr |
Drop the first N
elements of the array.
|
constexprnoexcept |
Return a string_view equal to str
but with the first n
elements dropped.
|
constexprnoexcept |
Checks if str
ends with the given suffix
.
|
constexprnoexcept |
Checks if str
ends with the given suffix
.
|
constexprnoexcept |
Checks if str
ends with the given suffix
.
|
constexprnoexcept |
Checks if str
ends with the given suffix
, ignoring case.
|
inlinenoexcept |
Checks if str
ends with the given suffix
, ignoring case.
|
noexcept |
Checks if str
ends with the given suffix
, ignoring case.
|
constexprnoexcept |
equals - Check for string equality, this is more efficient than compare() when the relative ordering of inequal strings isn't needed.
|
constexprnoexcept |
equals_lower - Check for string equality, ignoring case.
raw_fd_ostream & wpi::errs | ( | ) |
This returns a reference to a raw_ostream for standard error.
Use it like: errs() << "foo" << "bar"; By default, the stream is tied to stdout to ensure stdout is flushed before stderr is written, to ensure the error messages are written in their expected place.
std::string_view wpi::EscapeURI | ( | std::string_view | str, |
SmallVectorImpl< char > & | buf, | ||
bool | spacePlus = true |
||
) |
|
noexcept |
Search for the first character ch
in str
, ignoring case.
ch
, or npos if not found.
|
inlinenoexcept |
Search for the first string other
in str
, ignoring case.
other
, or npos if not found.
|
noexcept |
Search for the first string other
in str
, ignoring case.
other
, or npos if not found. T wpi::findFirstSet | ( | T | Val, |
ZeroBehavior | ZB = ZB_Max |
||
) |
Get the index of the first set bit starting from the least significant bit.
Only unsigned integral types are allowed.
ZB | the behavior on an input of 0. Only ZB_Max and ZB_Undefined are valid arguments. |
T wpi::findLastSet | ( | T | Val, |
ZeroBehavior | ZB = ZB_Max |
||
) |
Get the index of the last set bit starting from the least significant bit.
Only unsigned integral types are allowed.
ZB | the behavior on an input of 0. Only ZB_Max and ZB_Undefined are valid arguments. |
bool wpi::FindMultipartBoundary | ( | wpi::raw_istream & | is, |
std::string_view | boundary, | ||
std::string * | saveBuf | ||
) |
|
inline |
This function takes a float and returns the bit equivalent 32-bit integer.
Note that copying floats around changes the bits of NaNs on some hosts, notably x86, so this routine cannot be used if these bits are needed.
std::string wpi::GetHostname | ( | ) |
std::string_view wpi::GetHostname | ( | SmallVectorImpl< char > & | name | ) |
unsigned wpi::getNumBytesForUTF8 | ( | UTF8 | firstByte | ) |
std::string wpi::GetStackTrace | ( | int | offset | ) |
Get a stack trace, ignoring the first "offset" symbols.
offset | The number of symbols at the top of the stack to ignore |
std::string wpi::GetStackTraceDefault | ( | int | offset | ) |
The default implementation used for GetStackTrace().
offset | The number of symbols at the top of the stack to ignore |
|
inline |
Return the greatest common divisor of the values using Euclid's algorithm.
|
inline |
hash_code wpi::hash_combine | ( | const Ts &... | args | ) |
Combine values into a single hash_code.
This routine accepts a varying number of arguments of any type. It will attempt to combine them into a single hash_code. For user-defined types it attempts to call a
The result is suitable for returning from a user's hash_value implementation for their user-defined type. Consumers of a type should not call this routine, they should instead call 'hash_value'.
hash_code wpi::hash_combine_range | ( | InputIteratorT | first, |
InputIteratorT | last | ||
) |
hash_code wpi::hash_value | ( | const std::basic_string< T > & | arg | ) |
Compute a hash_code for a standard string.
hash_code wpi::hash_value | ( | const std::pair< T, U > & | arg | ) |
Compute a hash_code for a pair of objects.
hash_code wpi::hash_value | ( | const std::tuple< Ts... > & | arg | ) |
Compute a hash_code for a tuple.
hash_code wpi::hash_value | ( | const T * | ptr | ) |
Compute a hash_code for a pointer's address.
N.B.: This hashes the address. Not the value and not the type.
std::enable_if_t< is_integral_or_enum< T >::value, hash_code > wpi::hash_value | ( | T | value | ) |
Compute a hash_code for any integer value.
Note that this function is intended to compute the same hash_code for a particular value without regard to the pre-promotion type. This is in contrast to hash_combine which may produce different hash_codes for differing argument types even if they would implicit promote to a common type without changing the value.
bool wpi::hasUTF16ByteOrderMark | ( | std::span< const char > | SrcBytes | ) |
Returns true if a blob of text starts with a UTF-16 big or little endian byte order mark.
|
constexprnoexcept |
hexdigit - Return the hexadecimal character for the given number X
(which should be less than 16).
|
constexprnoexcept |
Interpret the given character C
as a hexadecimal digit and return its value.
If C
is not a valid hex digit, -1U is returned.
|
inlineconstexpr |
Return the high 32 bits of a 64 bit value.
int wpi::http_body_is_final | ( | const http_parser * | parser | ) |
const char * wpi::http_errno_description | ( | enum http_errno | err | ) |
const char * wpi::http_errno_name | ( | enum http_errno | err | ) |
const char * wpi::http_method_str | ( | enum http_method | m | ) |
size_t wpi::http_parser_execute | ( | http_parser * | parser, |
const http_parser_settings * | settings, | ||
const char * | data, | ||
size_t | len | ||
) |
void wpi::http_parser_init | ( | http_parser * | parser, |
enum http_parser_type | type | ||
) |
int wpi::http_parser_parse_url | ( | const char * | buf, |
size_t | buflen, | ||
int | is_connect, | ||
struct http_parser_url * | u | ||
) |
void wpi::http_parser_pause | ( | http_parser * | parser, |
int | paused | ||
) |
void wpi::http_parser_settings_init | ( | http_parser_settings * | settings | ) |
void wpi::http_parser_url_init | ( | struct http_parser_url * | u | ) |
unsigned long wpi::http_parser_version | ( | void | ) |
int wpi::http_should_keep_alive | ( | const http_parser * | parser | ) |
const char * wpi::http_status_str | ( | enum http_status | s | ) |
std::vector< T >::iterator wpi::insert_sorted | ( | std::vector< T > & | vec, |
T const & | item | ||
) |
void wpi::install_bad_alloc_error_handler | ( | fatal_error_handler_t | handler, |
void * | user_data = nullptr |
||
) |
Installs a new bad alloc error handler that should be used whenever a bad alloc error, e.g.
failing malloc/calloc, is encountered by LLVM.
The user can install a bad alloc handler, in order to define the behavior in case of failing allocations, e.g. throwing an exception. Note that this handler must not trigger any additional allocations itself.
If no error handler is installed the default is to print the error message to stderr, and call exit(1). If an error handler is installed then it is the handler's responsibility to log the message, it will no longer be printed to stderr. If the error handler returns, then exit(1) will be called.
user_data | - An argument which will be passed to the installed error handler. |
void wpi::install_fatal_error_handler | ( | fatal_error_handler_t | handler, |
void * | user_data = nullptr |
||
) |
install_fatal_error_handler - Installs a new error handler to be used whenever a serious (non-recoverable) error is encountered by LLVM.
If no error handler is installed the default is to print the error message to stderr, and call exit(1). If an error handler is installed then it is the handler's responsibility to log the message, it will no longer be printed to stderr. If the error handler returns, then exit(1) will be called.
It is dangerous to naively use an error handler which throws an exception. Even though some applications desire to gracefully recover from arbitrary faults, blindly throwing exceptions through unfamiliar code isn't a way to achieve this.
user_data | - An argument which will be passed to the install error handler. |
void wpi::install_out_of_memory_new_handler | ( | ) |
|
constexprnoexcept |
Checks whether character C
is either a decimal digit or an uppercase or lowercase letter as classified by "C" locale.
|
constexprnoexcept |
Checks if character C
is a valid letter as classified by "C" locale.
|
constexprnoexcept |
Checks whether character C
is valid ASCII (high bit is zero).
|
constexprnoexcept |
Checks if character C
is one of the 10 decimal digits.
|
constexprnoexcept |
Checks if character C
is a hexadecimal numeric character.
|
inlineconstexpr |
Checks if an integer fits into the given bit width.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
Checks if an signed integer fits into the given (dynamic) bit width.
|
inlineconstexpr |
Return true if the argument is a non-empty sequence of ones starting at the least significant bit with the remainder zero (32 bit version).
Ex. isMask_32(0x0000FFFFU) == true.
|
inlineconstexpr |
Return true if the argument is a non-empty sequence of ones starting at the least significant bit with the remainder zero (64 bit version).
|
inlineconstexpr |
Return true if the argument is a power of two > 0.
Ex. isPowerOf2_32(0x00100000U) == true (32 bit edition.)
|
inlineconstexpr |
Return true if the argument is a power of two > 0 (64 bit edition.)
|
constexprnoexcept |
Checks whether character C
is printable.
Locale-independent version of the C standard library isprint whose results may differ on different platforms.
|
inlineconstexpr |
Checks if a signed integer is an N bit number shifted left by S.
|
inlineconstexpr |
Return true if the argument contains a non-empty sequence of ones with the remainder zero (32 bit version.) Ex.
isShiftedMask_32(0x0000FF00U) == true.
|
inlineconstexpr |
Return true if the argument contains a non-empty sequence of ones with the remainder zero (64 bit version.)
|
inlineconstexpr |
Checks if a unsigned integer is an N bit number shifted left by S.
|
inlineconstexpr |
Checks if an unsigned integer fits into the given bit width.
This is written as two functions rather than as simply
return N >= 64 || X < (UINT64_C(1) << N);
to keep MSVC from (incorrectly) warning on isUInt<64> that we're shifting left too many places.
constexpr bool wpi::isUInt | ( | uint64_t | ) |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
Checks if an unsigned integer fits into the given (dynamic) bit width.
|
constexpr |
Linearly interpolates between two values.
startValue | The start value. |
endValue | The end value. |
t | The fraction for interpolation. |
|
inlineconstexpr |
Return the low 32 bits of a 64 bit value.
|
inline |
Return the log base 2 of the specified value.
|
inline |
Return the floor log base 2 of the specified value, -1 if the value is zero.
(32 bit edition.) Ex. Log2_32(32) == 5, Log2_32(1) == 0, Log2_32(0) == -1, Log2_32(6) == 2
|
inline |
Return the ceil log base 2 of the specified value, 32 if the value is zero.
(32 bit edition). Ex. Log2_32_Ceil(32) == 5, Log2_32_Ceil(1) == 0, Log2_32_Ceil(6) == 3
|
inline |
Return the floor log base 2 of the specified value, -1 if the value is zero.
(64 bit edition.)
|
inline |
Return the ceil log base 2 of the specified value, 64 if the value is zero.
(64 bit edition.)
|
constexprnoexcept |
Returns str
with consecutive ch
characters starting from the the left removed.
|
constexprnoexcept |
Returns str
with consecutive characters in chars
starting from the left removed.
|
inlineconstexpr |
Make a 64-bit integer from a high / low pair of 32-bit integers.
|
inline |
iterator_range< pointee_iterator< WrappedIteratorT > > wpi::make_pointee_range | ( | RangeT && | Range | ) |
iterator_range< pointer_iterator< WrappedIteratorT > > wpi::make_pointer_range | ( | RangeT && | Range | ) |
iterator_range< T > wpi::make_range | ( | std::pair< T, T > | p | ) |
iterator_range< T > wpi::make_range | ( | T | x, |
T | y | ||
) |
Convenience function for iterating over sub-ranges.
This provides a bit of syntactic sugar to make using sub-ranges in for loops a bit easier. Analogous to std::make_pair().
|
inline |
Constructs a valid future with the value set.
|
inline |
Constructs a valid future with the value set.
std::error_code wpi::mapWindowsError | ( | unsigned | EV | ) |
T wpi::maskLeadingOnes | ( | unsigned | N | ) |
Create a bitmask with the N left-most bits set to 1, and all other bits set to 0.
Only unsigned types are allowed.
T wpi::maskLeadingZeros | ( | unsigned | N | ) |
Create a bitmask with the N left-most bits set to 0, and all other bits set to 1.
Only unsigned types are allowed.
T wpi::maskTrailingOnes | ( | unsigned | N | ) |
Create a bitmask with the N right-most bits set to 1, and all other bits set to 0.
Only unsigned types are allowed.
T wpi::maskTrailingZeros | ( | unsigned | N | ) |
Create a bitmask with the N right-most bits set to 0, and all other bits set to 1.
Only unsigned types are allowed.
|
inline |
Gets the maximum value for a N-bit signed integer.
|
inline |
Gets the maximum value for a N-bit unsigned integer.
std::string_view wpi::MimeTypeFromPath | ( | std::string_view | path | ) |
|
inlineconstexpr |
A and B are either alignments or offsets.
Return the minimum alignment that may be assumed after adding the two together.
|
inline |
Gets the minimum value for a N-bit signed integer.
std::enable_if_t< std::is_signed< T >::value, T > wpi::MulOverflow | ( | T | X, |
T | Y, | ||
T & | Result | ||
) |
Multiply two signed integers, computing the two's complement truncated result, returning true if an overflow ocurred.
|
inline |
Returns the next power of two (in 64-bits) that is strictly greater than A.
Returns zero on overflow.
raw_ostream & wpi::nulls | ( | ) |
This returns a reference to a raw_ostream which simply discards output.
bool wpi::operator!= | ( | const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > & | LHS, |
const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > & | RHS | ||
) |
Inequality comparison for DenseMap.
Equivalent to !(LHS == RHS). See operator== for performance notes.
bool wpi::operator!= | ( | const SmallPtrSetImpl< PtrType > & | LHS, |
const SmallPtrSetImpl< PtrType > & | RHS | ||
) |
Inequality comparison for SmallPtrSet.
Equivalent to !(LHS == RHS).
bool wpi::operator!= | ( | const SmallSet< T, LN, C > & | LHS, |
const SmallSet< T, RN, C > & | RHS | ||
) |
Inequality comparison for SmallSet.
Equivalent to !(LHS == RHS). See operator== for performance notes.
|
inline |
bool wpi::operator!= | ( | PointerUnion< PTs... > | lhs, |
PointerUnion< PTs... > | rhs | ||
) |
bool wpi::operator< | ( | const StringMap< ValueTy > & | lhs, |
const StringMap< ValueTy > & | rhs | ||
) |
bool wpi::operator< | ( | PointerUnion< PTs... > | lhs, |
PointerUnion< PTs... > | rhs | ||
) |
std::enable_if_t<!std::is_reference< OStream >::value && std::is_base_of< raw_ostream, OStream >::value, OStream && > wpi::operator<< | ( | OStream && | OS, |
const T & | Value | ||
) |
Call the appropriate insertion operator, given an rvalue reference to a raw_ostream object and return a stream of the same type as the argument.
raw_ostream & wpi::operator<< | ( | raw_ostream & | OS, |
sys::TimePoint<> | TP | ||
) |
|
inline |
bool wpi::operator== | ( | const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > & | LHS, |
const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > & | RHS | ||
) |
Equality comparison for DenseMap.
Iterates over elements of LHS confirming that each (key, value) pair in LHS is also in RHS, and that no additional pairs are in RHS. Equivalent to N calls to RHS.find and N value comparisons. Amortized complexity is linear, worst case is O(N^2) (if every hash collides).
bool wpi::operator== | ( | const SmallPtrSetImpl< PtrType > & | LHS, |
const SmallPtrSetImpl< PtrType > & | RHS | ||
) |
Equality comparison for SmallPtrSet.
Iterates over elements of LHS confirming that each value from LHS is also in RHS, and that no additional values are in RHS.
bool wpi::operator== | ( | const SmallSet< T, LN, C > & | LHS, |
const SmallSet< T, RN, C > & | RHS | ||
) |
Equality comparison for SmallSet.
Iterates over elements of LHS confirming that each element is also a member of RHS, and that RHS contains no additional values. Equivalent to N calls to RHS.count. For small-set mode amortized complexity is O(N^2) For large-set mode amortized complexity is linear, worst case is O(N^2) (if every hash collides).
bool wpi::operator== | ( | const StringMap< ValueTy > & | lhs, |
const StringMap< ValueTy > & | rhs | ||
) |
bool wpi::operator== | ( | PointerUnion< PTs... > | lhs, |
PointerUnion< PTs... > | rhs | ||
) |
|
inline |
|
inline |
raw_fd_ostream & wpi::outs | ( | ) |
This returns a reference to a raw_fd_ostream for standard output.
Use it like: outs() << "foo" << "bar";
|
noexcept |
Parses the string str
as a floating point value.
If the string is invalid or if only a subset of the string is valid, this returns nullopt to signify the error. The string is considered erroneous if empty or if it overflows T.
|
noexcept |
|
noexcept |
|
noexcept |
|
inlinenoexcept |
Parses the string str
as an integer of the specified radix.
If radix
is specified as zero, this does radix autosensing using extended C rules: 0 is octal, 0x is hex, 0b is binary.
If the string is invalid or if only a subset of the string is valid, this returns nullopt to signify the error. The string is considered erroneous if empty or if it overflows T.
bool wpi::ParseHttpHeaders | ( | raw_istream & | is, |
SmallVectorImpl< char > * | contentType, | ||
SmallVectorImpl< char > * | contentLength | ||
) |
|
inline |
Returns the power of two which is greater than or equal to the given value.
Essentially, it is a ceil operation across the domain of powers of two.
|
inline |
Returns the power of two which is less than or equal to the given value.
Essentially, it is a floor operation across the domain of powers of two.
uint64_t wpi::ReadUleb128 | ( | const char * | addr, |
uint64_t * | ret | ||
) |
Read unsigned LEB128 data.
Decode an unsigned LEB128 encoded datum. The algorithm is taken from Appendix C of the DWARF 3 spec. For information on the encodings refer to section "7.6 - Variable Length Data". Return the number of bytes read.
addr | The address where the ULEB128 data is stored. |
ret | Address to store the result. |
bool wpi::ReadUleb128 | ( | raw_istream & | is, |
uint64_t * | ret | ||
) |
Read unsigned LEB128 data from a stream.
Decode an unsigned LEB128 encoded datum. The algorithm is taken from Appendix C of the DWARF 3 spec. For information on the encodings refer to section "7.6 - Variable Length Data". Return false on stream error, true on success.
is | The input stream where the ULEB128 data is to be read from. |
ret | Address to store the result. |
void wpi::remove_bad_alloc_error_handler | ( | ) |
Restores default bad alloc error handling behavior.
void wpi::remove_fatal_error_handler | ( | ) |
Restores default error handling behavior.
void wpi::report_bad_alloc_error | ( | const char * | Reason, |
bool | GenCrashDiag = true |
||
) |
Reports a bad alloc error, calling any user defined bad alloc error handler.
In contrast to the generic 'report_fatal_error' functions, this function might not terminate, e.g. the user defined error handler throws an exception, but it won't return.
Note: When throwing an exception in the bad alloc handler, make sure that the following unwind succeeds, e.g. do not trigger additional allocations in the unwind chain.
If no error handler is installed (default), throws a bad_alloc exception if LLVM is compiled with exception support. Otherwise prints the error to standard error and calls abort().
void wpi::report_fatal_error | ( | const char * | reason, |
bool | gen_crash_diag = true |
||
) |
Reports a serious error, calling any installed error handler.
These functions are intended to be used for error conditions which are outside the control of the compiler (I/O errors, invalid user input, etc.)
If no error handler is installed the default is to print the message to standard error, followed by a newline. After the error handler is called this function will call abort(), it does not return.
void wpi::report_fatal_error | ( | const std::string & | reason, |
bool | gen_crash_diag = true |
||
) |
void wpi::report_fatal_error | ( | std::string_view | reason, |
bool | gen_crash_diag = true |
||
) |
T wpi::reverseBits | ( | T | Val | ) |
Reverse the bits in Val
.
|
noexcept |
Search for the last character ch
in str
, ignoring case.
ch
, or npos if not found.
|
inlinenoexcept |
Search for the last string other
in str
, ignoring case.
other
, or npos if not found.
|
noexcept |
Search for the last string other
in str
, ignoring case.
other
, or npos if not found.
|
constexprnoexcept |
Splits str
into two substrings around the last occurrence of a separator character.
If separator
is in the string, then the result is a pair (LHS, RHS) such that (str == LHS + separator + RHS) is true and RHS is minimal. If separator
is not in the string, then the result is a pair (LHS, RHS) where (str == LHS) and (RHS == "").
separator | The string to split on. |
|
constexprnoexcept |
Splits str
into two substrings around the last occurrence of a separator string.
If separator
is in the string, then the result is a pair (LHS, RHS) such that (str == LHS + separator + RHS) is true and RHS is minimal. If separator
is not in the string, then the result is a pair (LHS, RHS) where (str == LHS) and (RHS == "").
separator | The string to split on. |
|
constexprnoexcept |
Returns str
with consecutive Char
characters starting from the right removed.
|
constexprnoexcept |
Returns str
with consecutive characters in chars
starting from the right removed.
|
inline |
|
inline |
|
inline |
std::enable_if_t< std::is_unsigned< T >::value, T > wpi::SaturatingAdd | ( | T | X, |
T | Y, | ||
bool * | ResultOverflowed = nullptr |
||
) |
Add two unsigned integers, X and Y, of type T.
Clamp the result to the maximum representable value of T on overflow. ResultOverflowed indicates if the result is larger than the maximum representable value of type T.
std::enable_if_t< std::is_unsigned< T >::value, T > wpi::SaturatingMultiply | ( | T | X, |
T | Y, | ||
bool * | ResultOverflowed = nullptr |
||
) |
Multiply two unsigned integers, X and Y, of type T.
Clamp the result to the maximum representable value of T on overflow. ResultOverflowed indicates if the result is larger than the maximum representable value of type T.
std::enable_if_t< std::is_unsigned< T >::value, T > wpi::SaturatingMultiplyAdd | ( | T | X, |
T | Y, | ||
T | A, | ||
bool * | ResultOverflowed = nullptr |
||
) |
Multiply two unsigned integers, X and Y, and add the unsigned integer, A to the product.
Clamp the result to the maximum representable value of T on overflow. ResultOverflowed indicates if the result is larger than the maximum representable value of type T.
void wpi::set_fixed_execution_hash_seed | ( | uint64_t | fixed_value | ) |
Override the execution seed with a fixed value.
This hashing library uses a per-execution seed designed to change on each run with high probability in order to ensure that the hash codes are not attackable and to ensure that output which is intended to be stable does not rely on the particulars of the hash codes produced.
That said, there are use cases where it is important to be able to reproduce exactly a specific behavior. To that end, we provide a function which will forcibly set the seed to a fixed value. This must be done at the start of the program, before any hashes are computed. Also, it cannot be undone. This makes it thread-hostile and very hard to use outside of immediately on start of a simple program designed for reproducible behavior.
void wpi::SetGetStackTraceImpl | ( | std::string(*)(int offset) | func | ) |
Set the implementation used by GetStackTrace().
func | Function called by GetStackTrace(). |
|
constexpr |
bool wpi::shouldReverseIterate | ( | ) |
|
inlineconstexpr |
Sign-extend the number in the bottom B bits of X to a 32-bit integer.
Requires 0 < B <= 32.
|
inline |
Sign-extend the number in the bottom B bits of X to a 32-bit integer.
Requires 0 < B <= 32.
|
inlineconstexpr |
Sign-extend the number in the bottom B bits of X to a 64-bit integer.
Requires 0 < B <= 64.
|
inline |
Sign-extend the number in the bottom B bits of X to a 64-bit integer.
Requires 0 < B <= 64.
uint64_t wpi::SizeUleb128 | ( | uint64_t | val | ) |
Get size of unsigned LEB128 data.
Determine the number of bytes required to encode an unsigned LEB128 datum. The algorithm is taken from Appendix C of the DWARF 3 spec. For information on the encodings refer to section "7.6 - Variable Length Data". Return the number of bytes required.
val | LEB128 data. |
|
constexprnoexcept |
Returns a reference to the substring of str
from [start, end).
start | The index of the starting character in the substring; if the index is npos or greater than the length of the string then the empty substring will be returned. |
end | The index following the last character to include in the substring. If this is npos or exceeds the number of characters remaining in the string, the string suffix (starting with start ) will be returned. If this is less than start , an empty string will be returned. |
int wpi::SocketErrno | ( | ) |
|
inline |
std::string wpi::SocketStrerror | ( | int | code | ) |
|
constexprnoexcept |
Splits str
into two substrings around the first occurrence of a separator character.
If separator
is in the string, then the result is a pair (LHS, RHS) such that (str == LHS + separator + RHS) is true and RHS is maximal. If separator
is not in the string, then the result is a pair (LHS, RHS) where (str == LHS) and (RHS == "").
separator | The character to split on. |
|
noexcept |
Splits str
into substrings around the occurrences of a separator character.
Each substring is stored in arr
. If maxSplit
is >= 0, at most maxSplit
splits are done and consequently <= maxSplit
+ 1 elements are added to arr. If keepEmpty
is false, empty strings are not added to arr
. They still count when considering maxSplit
An useful invariant is that separator.join(arr) == str if maxSplit == -1 and keepEmpty == true
arr | Where to put the substrings. |
separator | The character to split on. |
maxSplit | The maximum number of times the string is split. |
keepEmpty | True if empty substring should be added. |
|
noexcept |
Splits str
into substrings around the occurrences of a separator string.
Each substring is stored in arr
. If maxSplit
is >= 0, at most maxSplit
splits are done and consequently <= maxSplit
+ 1 elements are added to arr. If keepEmpty
is false, empty strings are not added to arr
. They still count when considering maxSplit
An useful invariant is that separator.join(arr) == str if maxSplit == -1 and keepEmpty == true
arr | Where to put the substrings. |
separator | The string to split on. |
maxSplit | The maximum number of times the string is split. |
keepEmpty | True if empty substring should be added. |
|
constexprnoexcept |
Splits str
into two substrings around the first occurrence of a separator string.
If separator
is in the string, then the result is a pair (LHS, RHS) such that (str == LHS + separator + RHS) is true and RHS is maximal. If separator
is not in the string, then the result is a pair (LHS, RHS) where (str == LHS) and (RHS == "").
separator | The string to split on. |
|
constexprnoexcept |
Checks if str
starts with the given prefix
.
|
constexprnoexcept |
Checks if str
starts with the given prefix
.
|
constexprnoexcept |
Checks if str
starts with the given prefix
.
|
constexprnoexcept |
Checks if str
starts with the given prefix
, ignoring case.
|
inlinenoexcept |
Checks if str
starts with the given prefix
, ignoring case.
|
noexcept |
Checks if str
starts with the given prefix
, ignoring case.
std::enable_if_t< std::is_signed< T >::value, T > wpi::SubOverflow | ( | T | X, |
T | Y, | ||
T & | Result | ||
) |
Subtract two signed integers, computing the two's complement truncated result, returning true if an overflow ocurred.
|
constexprnoexcept |
Returns the substring of str
from [start, start + n).
start | The index of the starting character in the substring; if the index is npos or greater than the length of the string then the empty substring will be returned. |
n | The number of characters to included in the substring. If n exceeds the number of characters remaining in the string, the string suffix (starting with start ) will be returned. |
|
constexprnoexcept |
Returns a view equal to str
but with only the last n
elements remaining.
If n
is greater than the length of the string, the entire string is returned.
|
constexprnoexcept |
Returns a view equal to str
but with only the first n
elements remaining.
If n
is greater than the length of the string, the entire string is returned.
SmallVector< ValueTypeFromRangeType< R >, Size > wpi::to_vector | ( | R && | Range | ) |
Given a range of type R, iterate the entire range and return a SmallVector with elements of the vector.
This is useful, for example, when you want to iterate a range and then sort the results.
SmallVector< ValueTypeFromRangeType< R >, CalculateSmallVectorDefaultInlinedElements< ValueTypeFromRangeType< R > >::value > wpi::to_vector | ( | R && | Range | ) |
|
constexprnoexcept |
Returns the corresponding lowercase character if x
is uppercase.
|
constexprnoexcept |
Returns the corresponding uppercase character if x
is lowercase.
|
constexprnoexcept |
Returns str
with consecutive ch
characters starting from the left and right removed.
|
constexprnoexcept |
Returns str
with consecutive characters in chars
starting from the left and right removed.
std::pair< std::string_view, std::string_view > wpi::UnescapeCString | ( | std::string_view | str, |
SmallVectorImpl< char > & | buf | ||
) |
Unescapes a C-style string (reverse operation to raw_ostream::write_escaped).
Scans through str
until either the end is reached or an unescaped double quote character is found.
str | input string |
buf | buffer for unescaped characters |
std::string_view wpi::UnescapeURI | ( | std::string_view | str, |
SmallVectorImpl< char > & | buf, | ||
bool * | error | ||
) |
|
inline |
void wpi::wpi_unreachable_internal | ( | const char * | msg = nullptr , |
const char * | file = nullptr , |
||
unsigned | line = 0 |
||
) |
This function calls abort(), and prints the optional message to stderr.
Use the wpi_unreachable macro (that adds location info), instead of calling this function directly.
void wpi::WriteUleb128 | ( | raw_ostream & | os, |
uint64_t | val | ||
) |
Write unsigned LEB128 data.
Encode an unsigned LEB128 encoded datum. The algorithm is taken from Appendix C of the DWARF 3 spec. For information on the encodings refer to section "7.6 - Variable Length Data".
os | Output stream. |
val | Value to be stored. |
uint64_t wpi::WriteUleb128 | ( | SmallVectorImpl< char > & | dest, |
uint64_t | val | ||
) |
Write unsigned LEB128 data.
Encode an unsigned LEB128 encoded datum. The algorithm is taken from Appendix C of the DWARF 3 spec. For information on the encodings refer to section "7.6 - Variable Length Data". Return the number of bytes written.
dest | The address where the ULEB128 data is to be stored. |
val | Value to be stored. |
|
static |
|
constexpr |
|
extern |
Use this rather than HUGE_VALF; the latter causes warnings on MSVC.
|
constexpr |
inline
in C++14. class LLVM_GSL_OWNER wpi::SmallVector |
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference sizeof(SmallVector<T, 0>)
.