WPILibC++ 2024.1.1-beta-4
wpi Namespace Reference

Namespaces

namespace  adl_detail
 
namespace  detail
 
namespace  hashing
 
namespace  impl
 
namespace  java
 Java Native Interface (JNI) utility functions.
 
namespace  literals
 
namespace  log
 
namespace  math
 
namespace  pointer_union_detail
 
namespace  sig
 
namespace  structparser
 
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_v< T > > >
 
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_v< T > > >
 
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
 
struct  cast_convert_val
 
struct  cast_convert_val< To, FromTy *, FromTy * >
 
struct  cast_convert_val< To, FromTy, FromTy >
 
struct  cast_retty
 
struct  cast_retty_impl
 
struct  cast_retty_impl< To, const From * >
 
struct  cast_retty_impl< To, const From *const >
 
struct  cast_retty_impl< To, const From >
 
struct  cast_retty_impl< To, From * >
 
struct  cast_retty_impl< To, std::unique_ptr< From > >
 
struct  cast_retty_wrap
 
struct  cast_retty_wrap< To, FromTy, FromTy >
 
struct  CastInfo
 This struct provides a method for customizing the way a cast is performed. More...
 
struct  CastInfo< To, const PointerUnion< PTs... > >
 
struct  CastInfo< To, From, std::enable_if_t<!is_simple_type< From >::value > >
 This struct provides an overload for CastInfo where From has simplify_type defined. More...
 
struct  CastInfo< To, PointerUnion< PTs... > >
 
struct  CastInfo< To, std::optional< From > >
 Provide a CastInfo specialized for std::optional<From>. More...
 
struct  CastInfo< To, std::unique_ptr< From > >
 Provide a CastInfo specialized for std::unique_ptr. More...
 
struct  CastInfoPointerUnionImpl
 We can't (at least, at this moment with C++14) declare CastInfo as a friend of PointerUnion like this: More...
 
struct  CastIsPossible
 This struct provides a way to check if a given cast is possible. More...
 
struct  CastIsPossible< To, From, std::enable_if_t< std::is_base_of_v< To, From > > >
 Upcasting (from derived to base) and casting from a type to itself should always be possible. More...
 
struct  CastIsPossible< To, std::optional< From > >
 
class  circular_buffer
 This is a simple circular buffer so we don't need to "bucket brigade" copy old values. More...
 
class  ConcurrentQueue
 
struct  const_pointer_or_const_ref
 
struct  const_pointer_or_const_ref< T, std::enable_if_t< std::is_pointer_v< T > > >
 
struct  ConstStrippingForwardingCast
 Provides a cast trait that strips const from types to make it easier to implement a const-version of a non-const cast. More...
 
struct  ct_string
 Fixed length string (array of character) for compile time use. More...
 
class  DebugEpochBase
 A base class for data structure classes wishing to make iterators ("handles") pointing into themselves fail-fast. More...
 
struct  DefaultDoCastIfPossible
 This cast trait just provides the default implementation of doCastIfPossible to make CastInfo specializations more declarative. 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< std::variant< 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
 
class  DsClient
 
class  DynamicStruct
 Dynamic (run-time) read-only access to a serialized raw struct. More...
 
class  DynamicStructObject
 Dynamic (run-time) mutable access to a serialized raw struct, with internal data storage. More...
 
struct  empty_array_t
 
class  Event
 An atomic signaling event for synchronization. More...
 
class  EventLoopRunner
 Executes an event loop on a separate thread. More...
 
struct  EventVector
 
struct  explicitly_convertible
 
struct  explicitly_convertible< From, To, std::void_t< decltype(static_cast< To >(std::declval< std::add_rvalue_reference_t< From > >()))> >
 
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... >
 
struct  ForwardToPointerCast
 Provides a cast trait that uses a defined pointer to pointer cast as a base for reference-to-reference casts. More...
 
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...
 
class  HashBuilderImpl
 
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...
 
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...
 
struct  is_simple_type
 
struct  isa_impl
 
struct  isa_impl< To, From, std::enable_if_t< std::is_base_of_v< To, From > > >
 
struct  isa_impl_cl
 
struct  isa_impl_cl< To, const From * >
 
struct  isa_impl_cl< To, const From *const >
 
struct  isa_impl_cl< To, const From >
 
struct  isa_impl_cl< To, const std::unique_ptr< From > >
 
struct  isa_impl_cl< To, From * >
 
struct  isa_impl_cl< To, From *const >
 
struct  isa_impl_wrap
 
struct  isa_impl_wrap< To, FromTy, FromTy >
 
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  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
 
class  MulticastServiceAnnouncer
 
class  MulticastServiceResolver
 
class  MutableDynamicStruct
 Dynamic (run-time) mutable access to a serialized raw struct. More...
 
class  NetworkAcceptor
 
class  NetworkStream
 
struct  NullableValueCastFailed
 All of these cast traits are meant to be implementations for useful casts that users may want to use that are outside the standard behavior. More...
 
struct  NullDeleter
 
struct  OptionalValueCast
 This cast trait provides std::optional<T> casting. More...
 
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...
 
struct  Protobuf
 Protobuf serialization template. More...
 
class  ProtobufMessage
 Owning wrapper (ala std::unique_ptr) for google::protobuf::Message* that does not require the protobuf headers be included. More...
 
class  ProtobufMessageDatabase
 Database of protobuf dynamic messages. 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...
 
struct  RawFrame
 
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
 
struct  SameType
 
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  Semaphore
 A semaphore for synchronization. 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  SignalObject
 RAII wrapper for signaling handles. More...
 
struct  simplify_type
 Define a template that can be specialized by smart pointers to reflect the fact that they are automatically dereferenced, and are not involved with the template selection process... the default implementation is a noop. More...
 
struct  simplify_type< const From >
 
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  Struct
 Struct serialization template. More...
 
struct  Struct< bool >
 Raw struct support for boolean values. More...
 
struct  Struct< double >
 Raw struct support for double values. More...
 
struct  Struct< float >
 Raw struct support for float values. More...
 
struct  Struct< int16_t >
 Raw struct support for int16_t values. More...
 
struct  Struct< int32_t >
 Raw struct support for int32_t values. More...
 
struct  Struct< int64_t >
 Raw struct support for int64_t values. More...
 
struct  Struct< int8_t >
 Raw struct support for int8_t values. More...
 
struct  Struct< std::array< T, N > >
 Raw struct support for fixed-size arrays of other structs. More...
 
struct  Struct< uint16_t >
 Raw struct support for uint16_t values. More...
 
struct  Struct< uint32_t >
 Raw struct support for uint32_t values. More...
 
struct  Struct< uint64_t >
 Raw struct support for uint64_t values. More...
 
struct  Struct< uint8_t >
 Raw struct support for uint8_t values. More...
 
class  StructArrayBuffer
 
class  StructDescriptor
 Raw struct dynamic struct descriptor. More...
 
class  StructDescriptorDatabase
 Database of raw struct dynamic descriptors. More...
 
class  StructFieldDescriptor
 Raw struct dynamic field descriptor. More...
 
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...)>
 
struct  UniquePtrCast
 This cast trait provides std::unique_ptr casting. More...
 
class  UrlParser
 Parses a URL into its constiuent components. More...
 
struct  ValueFromPointerCast
 This cast trait provides casting for the specific case of casting to a value-typed object from a pointer-typed object. More...
 
struct  ValueIsPresent
 ValueIsPresent provides a way to check if a value is, well, present. More...
 
struct  ValueIsPresent< std::optional< T > >
 
struct  ValueIsPresent< T, std::enable_if_t< IsNullable< T > > >
 
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...
 

Concepts

concept  DecayedDerivedFrom
 
concept  ProtobufSerializable
 Specifies that a type is capable of protobuf serialization and deserialization.
 
concept  MutableProtobufSerializable
 Specifies that a type is capable of in-place protobuf deserialization.
 
concept  StructSerializable
 Specifies that a type is capable of raw struct serialization and deserialization.
 
concept  MutableStructSerializable
 Specifies that a type is capable of in-place raw struct deserialization.
 
concept  HasNestedStruct
 Specifies that a struct type has nested struct declarations.
 

Functions

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)
 
std::string_view MimeTypeFromPath (std::string_view path)
 
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::convertible_to< T >... Ts>
 array (T, Ts...) -> array< T, 1+sizeof...(Ts)>
 
uint64_t NowDefault ()
 The default implementation used for Now(). More...
 
void SetNowImpl (uint64_t(*func)())
 Set the implementation used by Now(). More...
 
uint64_t Now ()
 Return a value representing the current time in microseconds. More...
 
uint64_t GetSystemTime ()
 Return the current system time in microseconds since the Unix epoch (January 1st, 1970 00:00 UTC). More...
 
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...
 
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...
 
WPI_EventHandle CreateEvent (bool manualReset=false, bool initialState=false)
 Creates an event. More...
 
void DestroyEvent (WPI_EventHandle handle)
 Destroys an event. More...
 
void SetEvent (WPI_EventHandle handle)
 Sets an event to signaled state. More...
 
void ResetEvent (WPI_EventHandle handle)
 Sets an event to non-signaled state. More...
 
WPI_SemaphoreHandle CreateSemaphore (int initialCount=0, int maximumCount=INT_MAX)
 Creates a semaphore. More...
 
void DestroySemaphore (WPI_SemaphoreHandle handle)
 Destroys a semaphore. More...
 
bool ReleaseSemaphore (WPI_SemaphoreHandle handle, int releaseCount=1, int *prevCount=nullptr)
 Releases N counts of a semaphore. More...
 
bool WaitForObject (WPI_Handle handle)
 Waits for an handle to be signaled. More...
 
bool WaitForObject (WPI_Handle handle, double timeout, bool *timedOut)
 Waits for an handle to be signaled, with timeout. More...
 
std::span< WPI_HandleWaitForObjects (std::span< const WPI_Handle > handles, std::span< WPI_Handle > signaled)
 Waits for one or more handles to be signaled. More...
 
std::span< WPI_HandleWaitForObjects (std::initializer_list< WPI_Handle > handles, std::span< WPI_Handle > signaled)
 Waits for one or more handles to be signaled. More...
 
std::span< WPI_HandleWaitForObjects (std::span< const WPI_Handle > handles, std::span< WPI_Handle > signaled, double timeout, bool *timedOut)
 Waits for one or more handles to be signaled, with timeout. More...
 
std::span< WPI_HandleWaitForObjects (std::initializer_list< WPI_Handle > handles, std::span< WPI_Handle > signaled, double timeout, bool *timedOut)
 Waits for one or more handles to be signaled, with timeout. More...
 
void CreateSignalObject (WPI_Handle handle, bool manualReset=false, bool initialState=false)
 Sets up signaling for an arbitrary handle. More...
 
void SetSignalObject (WPI_Handle handle)
 Sets a handle to signaled state. More...
 
void ResetSignalObject (WPI_Handle handle)
 Sets a handle to non-signaled state. More...
 
void DestroySignalObject (WPI_Handle handle)
 Cleans up signaling for a handle. More...
 
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)
 
template<ProtobufSerializable T>
UnpackProtobuf (const google::protobuf::Message &msg)
 Unpack a serialized protobuf message. More...
 
template<ProtobufSerializable T>
void PackProtobuf (google::protobuf::Message *msg, const T &value)
 Pack a serialized protobuf message. More...
 
template<ProtobufSerializable T>
void UnpackProtobufInto (T *out, const google::protobuf::Message &msg)
 Unpack a serialized struct into an existing object, overwriting its contents. 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...
 
template<typename T , size_t N>
constexpr std::span< T > drop_front (std::span< T, N > in, typename std::span< T >::size_type n=1)
 Drop the first N elements of the array. More...
 
template<typename T , size_t N>
constexpr std::span< T > drop_back (std::span< T, N > in, typename std::span< T >::size_type n=1)
 Drop the last N elements of the array. More...
 
template<typename T , size_t N>
constexpr std::span< T > take_front (std::span< T, N > in, typename std::span< T >::size_type n=1)
 Returns a span equal to in but with only the first n elements remaining. More...
 
template<typename T , size_t N>
constexpr std::span< T > take_back (std::span< T, N > in, typename std::span< T >::size_type n=1)
 Returns a span equal to in but with only the last n elements remaining. More...
 
template<StructSerializable T>
UnpackStruct (std::span< const uint8_t > data)
 Unpack a serialized struct. More...
 
template<StructSerializable T, size_t Offset>
UnpackStruct (std::span< const uint8_t > data)
 Unpack a serialized struct starting at a given offset within the data. More...
 
template<StructSerializable T>
void PackStruct (std::span< uint8_t > data, T &&value)
 Pack a serialized struct. More...
 
template<size_t Offset, StructSerializable T>
void PackStruct (std::span< uint8_t > data, T &&value)
 Pack a serialized struct starting at a given offset within the data. More...
 
template<StructSerializable T>
void UnpackStructInto (T *out, std::span< const uint8_t > data)
 Unpack a serialized struct into an existing object, overwriting its contents. More...
 
template<size_t Offset, StructSerializable T>
void UnpackStructInto (T *out, std::span< const uint8_t > data)
 Unpack a serialized struct into an existing object, overwriting its contents, and starting at a given offset within the data. More...
 
template<StructSerializable T>
constexpr auto GetStructTypeString ()
 Get the type string for a raw struct serializable type. More...
 
template<StructSerializable T>
constexpr size_t GetStructSize ()
 Get the size for a raw struct serializable type. More...
 
template<StructSerializable T, size_t N>
constexpr auto MakeStructArrayTypeString ()
 
template<StructSerializable T, size_t N>
consteval auto MakeStructArraySchema ()
 
template<StructSerializable T>
constexpr std::string_view GetStructSchema ()
 
template<StructSerializable T>
constexpr std::span< const uint8_t > GetStructSchemaBytes ()
 
template<StructSerializable T>
void ForEachStructSchema (std::invocable< std::string_view, std::string_view > auto fn)
 
template<typename Char , size_t M>
 ct_string (Char const (&s)[M]) -> ct_string< Char, std::char_traits< Char >, M - 1 >
 
template<ct_string S>
constexpr auto operator""_ct_string ()
 
template<typename Char , typename Traits , size_t N1, size_t N2>
constexpr auto operator+ (ct_string< Char, Traits, N1 > const &s1, ct_string< Char, Traits, N2 > const &s2) noexcept
 
template<typename Char , typename Traits , size_t N1, size_t... N>
constexpr auto Concat (ct_string< Char, Traits, N1 > const &s1, ct_string< Char, Traits, N > const &... s)
 Concatenates multiple fixed_strings into a larger fixed_string at compile time. More...
 
template<intmax_t N, int Base = 10, typename Char = char, typename Traits = std::char_traits<Char>>
requires (Base >= 2 && Base <= 36)
constexpr auto NumToCtString ()
 Converts any integral to a ct_string at compile-time. More...
 
template<typename T >
std::vector< T >::iterator insert_sorted (std::vector< T > &vec, T const &item)
 
template<typename F , typename... Ts>
constexpr void for_each (F &&f, Ts &&... elems)
 Calls f(i, elem) for each element of elems where i is the index of the element in elems and elem is the element. More...
 
std::string Demangle (std::string_view mangledSymbol)
 Demangle a C++ symbol. More...
 
template<typename T >
std::string GetTypeName (const T &type)
 Returns the type name of an object. More...
 
template<typename To , typename From >
bool isa (const From &Val)
 isa<X> - Return true if the parameter to the template is an instance of one of the template type arguments. More...
 
template<typename First , typename Second , typename... Rest, typename From >
bool isa (const From &Val)
 
template<typename To , typename From >
decltype(auto) cast (const From &Val)
 cast<X> - Return the argument parameter cast to the specified type. More...
 
template<typename To , typename From >
decltype(auto) cast (From &Val)
 
template<typename To , typename From >
decltype(auto) cast (From *Val)
 
template<typename To , typename From >
decltype(auto) cast (std::unique_ptr< From > &&Val)
 
template<typename To , typename From >
decltype(auto) dyn_cast (const From &Val)
 dyn_cast<X> - Return the argument parameter cast to the specified type. More...
 
template<typename To , typename From >
decltype(auto) dyn_cast (From &Val)
 
template<typename To , typename From >
decltype(auto) dyn_cast (From *Val)
 
template<typename To , typename From >
decltype(auto) dyn_cast (std::unique_ptr< From > &&Val)
 
template<typename... X, class Y >
bool isa_and_present (const Y &Val)
 isa_and_present<X> - Functionally identical to isa, except that a null value is accepted. More...
 
template<typename... X, class Y >
bool isa_and_nonnull (const Y &Val)
 
template<class X , class Y >
auto cast_if_present (const Y &Val)
 cast_if_present<X> - Functionally identical to cast, except that a null value is accepted. More...
 
template<class X , class Y >
auto cast_if_present (Y &Val)
 
template<class X , class Y >
auto cast_if_present (Y *Val)
 
template<class X , class Y >
auto cast_if_present (std::unique_ptr< Y > &&Val)
 
template<class X , class Y >
auto cast_or_null (const Y &Val)
 
template<class X , class Y >
auto cast_or_null (Y &Val)
 
template<class X , class Y >
auto cast_or_null (Y *Val)
 
template<class X , class Y >
auto cast_or_null (std::unique_ptr< Y > &&Val)
 
template<class X , class Y >
auto dyn_cast_if_present (const Y &Val)
 dyn_cast_if_present<X> - Functionally identical to dyn_cast, except that a null (or none in the case of optionals) value is accepted. More...
 
template<class X , class Y >
auto dyn_cast_if_present (Y &Val)
 
template<class X , class Y >
auto dyn_cast_if_present (Y *Val)
 
template<class X , class Y >
auto dyn_cast_or_null (const Y &Val)
 
template<class X , class Y >
auto dyn_cast_or_null (Y &Val)
 
template<class X , class Y >
auto dyn_cast_or_null (Y *Val)
 
template<class X , class Y >
CastInfo< X, std::unique_ptr< Y > >::CastResultType unique_dyn_cast (std::unique_ptr< Y > &Val)
 unique_dyn_cast<X> - Given a unique_ptr<Y>, try to return a unique_ptr<X>, taking ownership of the input pointer iff isa<X>(Val) is true. More...
 
template<class X , class Y >
auto unique_dyn_cast (std::unique_ptr< Y > &&Val)
 
template<class X , class Y >
CastInfo< X, std::unique_ptr< Y > >::CastResultType unique_dyn_cast_or_null (std::unique_ptr< Y > &Val)
 
template<class X , class Y >
auto unique_dyn_cast_or_null (std::unique_ptr< Y > &&Val)
 
std::error_code make_error_code (errc E)
 
template<typename OStream , typename T >
std::enable_if_t<!std::is_reference_v< OStream > &&std::is_base_of_v< raw_ostream, OStream >, 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_ostreamouts ()
 This returns a reference to a raw_fd_ostream for standard output. More...
 
raw_fd_ostreamerrs ()
 This returns a reference to a raw_ostream for standard error. More...
 
raw_ostreamnulls ()
 This returns a reference to a raw_ostream which simply discards output. More...
 
template<class Lambda , int = (Lambda{}(), 0)>
constexpr bool is_constexpr (Lambda)
 
constexpr bool is_constexpr (...)
 
template<std::size_t Index, typename ValueTy >
decltype(auto) get (const StringMapEntry< ValueTy > &E)
 
std::error_code mapWindowsError (unsigned EV)
 
template<typename Container >
 iterator_range (Container &&) -> iterator_range< detail::IterOfRange< Container > >
 
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 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...
 
template<typename T >
std::enable_if_t< is_integral_or_enum< T >::value, hash_codehash_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...
 
template<typename T >
hash_code hash_value (const std::optional< 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...
 
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 getUTF8SequenceSize (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 convertUTF32ToUTF8String (std::span< const char > SrcBytes, std::string &Out)
 Converts a stream of raw bytes assumed to be UTF32 into a UTF8 std::string. More...
 
bool convertUTF32ToUTF8String (std::span< const UTF32 > Src, std::string &Out)
 Converts a UTF32 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...
 
template<std::size_t I, typename PointerTy , unsigned IntBits, typename IntType , typename PtrTraits , typename Info >
decltype(auto) get (const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
 
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)
 
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 behaviour. 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...
 
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)
 
template<class T = void *>
bool shouldReverseIterate ()
 
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...
 
raw_ostreamoperator<< (raw_ostream &OS, sys::TimePoint<> TP)
 
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<typename 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 >
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 >
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 >
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 >
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<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 bool isUInt (uint64_t x)
 Checks if an unsigned integer fits into the given bit width. More...
 
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...
 
bool isShiftedMask_32 (uint32_t Value, unsigned &MaskIdx, unsigned &MaskLen)
 Return true if the argument contains a non-empty sequence of ones with the remainder zero (32 bit version.) Ex. More...
 
bool isShiftedMask_64 (uint64_t Value, unsigned &MaskIdx, unsigned &MaskLen)
 Return true if the argument contains a non-empty sequence of ones with the remainder zero (64 bit version.) If true, MaskIdx will specify the index of the lowest set bit and MaskLen is updated to specify the length of the mask, else neither are updated. More...
 
template<size_t kValue>
constexpr size_t CTLog2 ()
 Compile time Log2. More...
 
template<>
constexpr size_t CTLog2< 1 > ()
 
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...
 
constexpr uint64_t MinAlign (uint64_t A, uint64_t B)
 A and B are either alignments or offsets. More...
 
constexpr uint64_t NextPowerOf2 (uint64_t A)
 Returns the next power of two (in 64-bits) that is strictly greater than A. 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)
 Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Align. More...
 
uint64_t alignToPowerOf2 (uint64_t Value, uint64_t Align)
 
uint64_t alignTo (uint64_t Value, uint64_t Align, uint64_t Skew)
 If non-zero Skew is specified, the return value will be a minimal integer that is greater than or equal to Size and equal to A * N + Skew for some integer N. 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_v< T >, 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_v< T >, T > SaturatingAdd (T X, T Y, bool *ResultOverflowed=nullptr)
 Add two unsigned integers, X and Y, of type T. More...
 
template<class T , class... Ts>
std::enable_if_t< std::is_unsigned_v< T >, T > SaturatingAdd (T X, T Y, T Z, Ts... Args)
 Add multiple unsigned integers of type T. More...
 
template<typename T >
std::enable_if_t< std::is_unsigned_v< T >, 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_v< T >, 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_v< T >, T > AddOverflow (T X, T Y, T &Result)
 Add two signed integers, computing the two's complement truncated result, returning true if overflow occurred. More...
 
template<typename T >
std::enable_if_t< std::is_signed_v< T >, 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_v< T >, 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...
 
template<typename RangeT >
constexpr auto adl_begin (RangeT &&range) -> decltype(adl_detail::begin_impl(std::forward< RangeT >(range)))
 Returns the begin iterator to range using std::begin and function found through Argument-Dependent Lookup (ADL). More...
 
template<typename RangeT >
constexpr auto adl_end (RangeT &&range) -> decltype(adl_detail::end_impl(std::forward< RangeT >(range)))
 Returns the end iterator to range using std::end and functions found through Argument-Dependent Lookup (ADL). More...
 
template<typename T >
constexpr void adl_swap (T &&lhs, T &&rhs) noexcept(noexcept(adl_detail::swap_impl(std::declval< T >(), std::declval< T >())))
 Swaps lhs with rhs using std::swap and functions found through Argument-Dependent Lookup (ADL). More...
 
template<typename RangeT >
constexpr auto adl_size (RangeT &&range) -> decltype(adl_detail::size_impl(std::forward< RangeT >(range)))
 Returns the size of range using std::size and functions found through Argument-Dependent Lookup (ADL). More...
 
template<typename T , typename Function >
auto transformOptional (const std::optional< T > &O, const Function &F) -> std::optional< decltype(F(*O))>
 
template<typename T , typename Function >
auto transformOptional (std::optional< T > &&O, const Function &F) -> std::optional< decltype(F(*std::move(O)))>
 
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_viewsplit (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_viewsplit (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_viewrsplit (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_viewrsplit (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_viewUnescapeCString (std::string_view str, SmallVectorImpl< char > &buf)
 Unescapes a C-style string (reverse operation to raw_ostream::write_escaped). More...
 
template<class OutputIt , class... Args>
void format_to_n_c_str (OutputIt out, std::iter_difference_t< OutputIt > n, fmt::format_string< Args... > fmt, Args &&... args)
 Like std::format_to_n() in that it writes at most n bytes to the output buffer, but also includes a terminating null byte in n. 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...
 
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 > > to_vector (R &&Range)
 
template<typename Out , unsigned Size, typename R >
SmallVector< Out, Size > to_vector_of (R &&Range)
 
template<typename Out , typename R >
SmallVector< Out > to_vector_of (R &&Range)
 
uint64_t xxHash64 (std::string_view Data)
 
uint64_t xxHash64 (std::span< const uint8_t > Data)
 
uint64_t xxh3_64bits (std::span< const uint8_t > data)
 
uint64_t xxh3_64bits (std::string_view data)
 
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 To , typename From , typename = std::enable_if_t<sizeof(To) == sizeof(From)>, typename = std::enable_if_t<std::is_trivially_constructible<To>::value>, typename = std::enable_if_t<std::is_trivially_copyable<To>::value>, typename = std::enable_if_t<std::is_trivially_copyable<From>::value>>
To bit_cast (const From &from) noexcept
 
template<typename T , typename = std::enable_if_t<std::is_integral_v<T>>>
constexpr T byteswap (T V) noexcept
 Reverses the bytes in the given integer value V. More...
 

Function Documentation

◆ AbsoluteDifference()

template<typename T >
std::enable_if_t< std::is_unsigned_v< T >, T > wpi::AbsoluteDifference ( X,
Y 
)

Subtract two unsigned integers, X and Y, of type T and return the absolute value of the result.

◆ AddOverflow()

template<typename T >
std::enable_if_t< std::is_signed_v< T >, T > wpi::AddOverflow ( X,
Y,
T &  Result 
)

Add two signed integers, computing the two's complement truncated result, returning true if overflow occurred.

◆ adl_begin()

template<typename RangeT >
constexpr auto wpi::adl_begin ( RangeT &&  range) -> decltype(adl_detail::begin_impl(std::forward<RangeT>(range)))
constexpr

Returns the begin iterator to range using std::begin and function found through Argument-Dependent Lookup (ADL).

◆ adl_end()

template<typename RangeT >
constexpr auto wpi::adl_end ( RangeT &&  range) -> decltype(adl_detail::end_impl(std::forward<RangeT>(range)))
constexpr

Returns the end iterator to range using std::end and functions found through Argument-Dependent Lookup (ADL).

◆ adl_size()

template<typename RangeT >
constexpr auto wpi::adl_size ( RangeT &&  range) -> decltype(adl_detail::size_impl(std::forward<RangeT>(range)))
constexpr

Returns the size of range using std::size and functions found through Argument-Dependent Lookup (ADL).

◆ adl_swap()

template<typename T >
constexpr void wpi::adl_swap ( T &&  lhs,
T &&  rhs 
)
constexprnoexcept

Swaps lhs with rhs using std::swap and functions found through Argument-Dependent Lookup (ADL).

◆ alignDown()

uint64_t wpi::alignDown ( uint64_t  Value,
uint64_t  Align,
uint64_t  Skew = 0 
)
inline

Returns the largest uint64_t less than or equal to Value and is Skew mod Align.

Align must be non-zero

◆ alignTo() [1/3]

template<uint64_t Align>
constexpr uint64_t wpi::alignTo ( uint64_t  Value)
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.

◆ alignTo() [2/3]

uint64_t wpi::alignTo ( uint64_t  Value,
uint64_t  Align 
)
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.

Examples:

alignTo(5, 8) = 8
alignTo(17, 8) = 24
alignTo(~0LL, 8) = 0
alignTo(321, 255) = 510
uint64_t alignTo(uint64_t Value, uint64_t Align)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
Definition: MathExtras.h:351

◆ alignTo() [3/3]

uint64_t wpi::alignTo ( uint64_t  Value,
uint64_t  Align,
uint64_t  Skew 
)
inline

If non-zero Skew is specified, the return value will be a minimal integer that is greater than or equal to Size and equal to A * N + Skew for some integer N.

If Skew is larger than A, its value is adjusted to 'Skew mod A'. Align must be non-zero.

Examples:

alignTo(5, 8, 7) = 7
alignTo(17, 8, 1) = 17
alignTo(~0LL, 8, 3) = 3
alignTo(321, 255, 42) = 552

◆ alignToPowerOf2()

uint64_t wpi::alignToPowerOf2 ( uint64_t  Value,
uint64_t  Align 
)
inline

◆ allocate_buffer()

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.

◆ array()

template<typename T , std::convertible_to< T >... Ts>
wpi::array ( ,
Ts...   
) -> array< T, 1+sizeof...(Ts)>

◆ Base64Decode() [1/5]

size_t wpi::Base64Decode ( raw_ostream os,
std::string_view  encoded 
)

◆ Base64Decode() [2/5]

std::string_view wpi::Base64Decode ( std::string_view  encoded,
size_t *  num_read,
SmallVectorImpl< char > &  buf 
)

◆ Base64Decode() [3/5]

std::span< uint8_t > wpi::Base64Decode ( std::string_view  encoded,
size_t *  num_read,
SmallVectorImpl< uint8_t > &  buf 
)

◆ Base64Decode() [4/5]

size_t wpi::Base64Decode ( std::string_view  encoded,
std::string *  plain 
)

◆ Base64Decode() [5/5]

size_t wpi::Base64Decode ( std::string_view  encoded,
std::vector< uint8_t > *  plain 
)

◆ Base64Encode() [1/6]

void wpi::Base64Encode ( raw_ostream os,
std::span< const uint8_t >  plain 
)

◆ Base64Encode() [2/6]

void wpi::Base64Encode ( raw_ostream os,
std::string_view  plain 
)

◆ Base64Encode() [3/6]

std::string_view wpi::Base64Encode ( std::span< const uint8_t >  plain,
SmallVectorImpl< char > &  buf 
)

◆ Base64Encode() [4/6]

void wpi::Base64Encode ( std::span< const uint8_t >  plain,
std::string *  encoded 
)

◆ Base64Encode() [5/6]

std::string_view wpi::Base64Encode ( std::string_view  plain,
SmallVectorImpl< char > &  buf 
)

◆ Base64Encode() [6/6]

void wpi::Base64Encode ( std::string_view  plain,
std::string *  encoded 
)

◆ bit_cast()

template<typename To , typename From , typename = std::enable_if_t<sizeof(To) == sizeof(From)>, typename = std::enable_if_t<std::is_trivially_constructible<To>::value>, typename = std::enable_if_t<std::is_trivially_copyable<To>::value>, typename = std::enable_if_t<std::is_trivially_copyable<From>::value>>
To wpi::bit_cast ( const From &  from)
inlinenoexcept

◆ byteswap()

template<typename T , typename = std::enable_if_t<std::is_integral_v<T>>>
constexpr T wpi::byteswap ( V)
constexprnoexcept

Reverses the bytes in the given integer value V.

◆ capacity_in_bytes() [1/2]

template<typename KeyT , typename ValueT , typename KeyInfoT >
size_t wpi::capacity_in_bytes ( const DenseMap< KeyT, ValueT, KeyInfoT > &  X)
inline

◆ capacity_in_bytes() [2/2]

template<typename T , unsigned N>
size_t wpi::capacity_in_bytes ( const SmallVector< T, N > &  X)
inline

◆ cast() [1/4]

template<typename To , typename From >
decltype(auto) wpi::cast ( const From &  Val)
inline

cast<X> - Return the argument parameter cast to the specified type.

This casting operator asserts that the type is correct, so it does not return null on failure. It does not allow a null argument (use cast_if_present for that). It is typically used like this:

cast<Instruction>(myVal)->getParent()

◆ cast() [2/4]

template<typename To , typename From >
decltype(auto) wpi::cast ( From &  Val)
inline

◆ cast() [3/4]

template<typename To , typename From >
decltype(auto) wpi::cast ( From *  Val)
inline

◆ cast() [4/4]

template<typename To , typename From >
decltype(auto) wpi::cast ( std::unique_ptr< From > &&  Val)
inline

◆ cast_if_present() [1/4]

template<class X , class Y >
auto wpi::cast_if_present ( const Y &  Val)
inline

cast_if_present<X> - Functionally identical to cast, except that a null value is accepted.

◆ cast_if_present() [2/4]

template<class X , class Y >
auto wpi::cast_if_present ( std::unique_ptr< Y > &&  Val)
inline

◆ cast_if_present() [3/4]

template<class X , class Y >
auto wpi::cast_if_present ( Y &  Val)
inline

◆ cast_if_present() [4/4]

template<class X , class Y >
auto wpi::cast_if_present ( Y *  Val)
inline

◆ cast_or_null() [1/4]

template<class X , class Y >
auto wpi::cast_or_null ( const Y &  Val)

◆ cast_or_null() [2/4]

template<class X , class Y >
auto wpi::cast_or_null ( std::unique_ptr< Y > &&  Val)

◆ cast_or_null() [3/4]

template<class X , class Y >
auto wpi::cast_or_null ( Y &  Val)

◆ cast_or_null() [4/4]

template<class X , class Y >
auto wpi::cast_or_null ( Y *  Val)

◆ compare_lower()

int wpi::compare_lower ( std::string_view  lhs,
std::string_view  rhs 
)
noexcept

compare_lower - Compare two strings, ignoring case.

◆ Concat()

template<typename Char , typename Traits , size_t N1, size_t... N>
constexpr auto wpi::Concat ( ct_string< Char, Traits, N1 > const &  s1,
ct_string< Char, Traits, N > const &...  s 
)
constexpr

Concatenates multiple fixed_strings into a larger fixed_string at compile time.

Parameters
s1first string
ssecond and later strings
Returns
concatenated string

◆ consume_integer()

template<typename T , std::enable_if_t< std::numeric_limits< T >::is_signed, bool > = true>
std::optional< T > wpi::consume_integer ( std::string_view str,
unsigned  radix 
)
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.

◆ contains() [1/3]

constexpr bool wpi::contains ( std::string_view  str,
char  ch 
)
constexprnoexcept

Checks if str contains the substring other.

◆ contains() [2/3]

constexpr bool wpi::contains ( std::string_view  str,
const char *  other 
)
constexprnoexcept

Checks if str contains the substring other.

◆ contains() [3/3]

constexpr bool wpi::contains ( std::string_view  str,
std::string_view  other 
)
constexprnoexcept

Checks if str contains the substring other.

◆ contains_lower() [1/3]

bool wpi::contains_lower ( std::string_view  str,
char  ch 
)
inlinenoexcept

Checks if str contains the substring other, ignoring case.

◆ contains_lower() [2/3]

bool wpi::contains_lower ( std::string_view  str,
const char *  other 
)
inlinenoexcept

Checks if str contains the substring other, ignoring case.

◆ contains_lower() [3/3]

bool wpi::contains_lower ( std::string_view  str,
std::string_view  other 
)
inlinenoexcept

Checks if str contains the substring other, ignoring case.

◆ ConvertCodePointToUTF8()

bool wpi::ConvertCodePointToUTF8 ( unsigned  Source,
char *&  ResultPtr 
)

Convert an Unicode code point to UTF8 sequence.

Parameters
Sourcea Unicode code point.
[in,out]ResultPtrpointer 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.
Returns
true on success.

◆ ConvertUTF16toUTF32()

ConversionResult wpi::ConvertUTF16toUTF32 ( const UTF16 **  sourceStart,
const UTF16 sourceEnd,
UTF32 **  targetStart,
UTF32 targetEnd,
ConversionFlags  flags 
)

◆ ConvertUTF16toUTF8()

ConversionResult wpi::ConvertUTF16toUTF8 ( const UTF16 **  sourceStart,
const UTF16 sourceEnd,
UTF8 **  targetStart,
UTF8 targetEnd,
ConversionFlags  flags 
)

◆ convertUTF16ToUTF8String() [1/2]

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.

Parameters
[in]SrcBytesA buffer of what is assumed to be UTF-16 encoded text.
[out]OutConverted UTF-8 is stored here on success.
Returns
true on success

◆ convertUTF16ToUTF8String() [2/2]

bool wpi::convertUTF16ToUTF8String ( std::span< const UTF16 Src,
SmallVectorImpl< char > &  Out 
)

Converts a UTF16 string into a UTF8 std::string.

Parameters
[in]SrcA buffer of UTF-16 encoded text.
[out]OutConverted UTF-8 is stored here on success.
Returns
true on success

◆ ConvertUTF32toUTF16()

ConversionResult wpi::ConvertUTF32toUTF16 ( const UTF32 **  sourceStart,
const UTF32 sourceEnd,
UTF16 **  targetStart,
UTF16 targetEnd,
ConversionFlags  flags 
)

◆ ConvertUTF32toUTF8()

ConversionResult wpi::ConvertUTF32toUTF8 ( const UTF32 **  sourceStart,
const UTF32 sourceEnd,
UTF8 **  targetStart,
UTF8 targetEnd,
ConversionFlags  flags 
)

◆ convertUTF32ToUTF8String() [1/2]

bool wpi::convertUTF32ToUTF8String ( std::span< const char >  SrcBytes,
std::string &  Out 
)

Converts a stream of raw bytes assumed to be UTF32 into a UTF8 std::string.

Parameters
[in]SrcBytesA buffer of what is assumed to be UTF-32 encoded text.
[out]OutConverted UTF-8 is stored here on success.
Returns
true on success

◆ convertUTF32ToUTF8String() [2/2]

bool wpi::convertUTF32ToUTF8String ( std::span< const UTF32 Src,
std::string &  Out 
)

Converts a UTF32 string into a UTF8 std::string.

Parameters
[in]SrcA buffer of UTF-32 encoded text.
[out]OutConverted UTF-8 is stored here on success.
Returns
true on success

◆ convertUTF8Sequence()

ConversionResult wpi::convertUTF8Sequence ( const UTF8 **  source,
const UTF8 sourceEnd,
UTF32 target,
ConversionFlags  flags 
)
inline

Convert the first UTF8 sequence in the given source buffer to a UTF32 code point.

Parameters
[in,out]sourceA 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.
sourceEndA pointer just past the end of the source buffer.
[out]targetThe converted code
flagsWhether the conversion is strict or lenient.
Returns
conversionOK on success
See also
ConvertUTF8toUTF32

◆ ConvertUTF8toUTF16()

ConversionResult wpi::ConvertUTF8toUTF16 ( const UTF8 **  sourceStart,
const UTF8 sourceEnd,
UTF16 **  targetStart,
UTF16 targetEnd,
ConversionFlags  flags 
)

◆ convertUTF8ToUTF16String()

bool wpi::convertUTF8ToUTF16String ( std::string_view  SrcUTF8,
SmallVectorImpl< UTF16 > &  DstUTF16 
)

Converts a UTF-8 string into a UTF-16 string with native endianness.

Returns
true on success

◆ ConvertUTF8toUTF32()

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.

◆ ConvertUTF8toUTF32Partial()

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.

◆ ConvertUTF8toWide() [1/3]

bool wpi::ConvertUTF8toWide ( const char *  Source,
std::wstring &  Result 
)

Converts a UTF-8 C-string to a std::wstring.

Returns
true on success.

◆ ConvertUTF8toWide() [2/3]

bool wpi::ConvertUTF8toWide ( std::string_view  Source,
std::wstring &  Result 
)

Converts a UTF-8 string_view to a std::wstring.

Returns
true on success.

◆ ConvertUTF8toWide() [3/3]

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.

Returns
true on success.

◆ convertWideToUTF8()

bool wpi::convertWideToUTF8 ( const std::wstring &  Source,
SmallVectorImpl< char > &  Result 
)

Converts a std::wstring to a UTF-8 encoded std::string.

Returns
true on success.

◆ CreateEvent()

WPI_EventHandle wpi::CreateEvent ( bool  manualReset = false,
bool  initialState = false 
)

Creates an event.

Events have binary state (signaled or not signaled) and may be either automatically reset or manually reset. Automatic-reset events go to non-signaled state when a WaitForObject is woken up by the event; manual-reset events require ResetEvent() to be called to set the event to non-signaled state; if ResetEvent() is not called, any waiter on that event will immediately wake when called.

Parameters
manualResettrue for manual reset, false for automatic reset
initialStatetrue to make the event initially in signaled state
Returns
Event handle

◆ CreateSemaphore()

WPI_SemaphoreHandle wpi::CreateSemaphore ( int  initialCount = 0,
int  maximumCount = INT_MAX 
)

Creates a semaphore.

Semaphores keep an internal counter. Releasing the semaphore increases the count. A semaphore with a non-zero count is considered signaled. When a waiter wakes up it atomically decrements the count by 1. This is generally useful in a single-supplier, multiple-consumer scenario.

Parameters
initialCountinitial value for the semaphore's internal counter
maximumCountmaximum value for the samephore's internal counter
Returns
Semaphore handle

◆ CreateSignalObject()

void wpi::CreateSignalObject ( WPI_Handle  handle,
bool  manualReset = false,
bool  initialState = false 
)

Sets up signaling for an arbitrary handle.

With this function, any handle can operate like an event handle.

Parameters
handleEvent handle
manualResettrue for manual reset, false for automatic reset
initialStatetrue to make the handle initially in signaled state

◆ ct_string()

template<typename Char , size_t M>
wpi::ct_string ( Char const (&)  s[M]) -> ct_string< Char, std::char_traits< Char >, M - 1 >

◆ CTLog2()

template<size_t kValue>
constexpr size_t wpi::CTLog2 ( )
inlineconstexpr

Compile time Log2.

Valid only for positive powers of two.

◆ CTLog2< 1 >()

template<>
constexpr size_t wpi::CTLog2< 1 > ( )
inlineconstexpr

◆ deallocate_buffer()

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.

◆ Demangle()

std::string wpi::Demangle ( std::string_view  mangledSymbol)

Demangle a C++ symbol.

Parameters
mangledSymbolthe mangled symbol.
Returns
The demangled symbol, or mangledSymbol if demangling fails.

◆ DestroyEvent()

void wpi::DestroyEvent ( WPI_EventHandle  handle)

Destroys an event.

Destruction wakes up any waiters.

Parameters
handleevent handle

◆ DestroySemaphore()

void wpi::DestroySemaphore ( WPI_SemaphoreHandle  handle)

Destroys a semaphore.

Destruction wakes up any waiters.

Parameters
handlesemaphore handle

◆ DestroySignalObject()

void wpi::DestroySignalObject ( WPI_Handle  handle)

Cleans up signaling for a handle.

Destruction wakes up any waiters.

Parameters
handlehandle

◆ divideCeil()

uint64_t wpi::divideCeil ( uint64_t  Numerator,
uint64_t  Denominator 
)
inline

Returns the integer ceil(Numerator / Denominator).

◆ divideNearest()

uint64_t wpi::divideNearest ( uint64_t  Numerator,
uint64_t  Denominator 
)
inline

Returns the integer nearest(Numerator / Denominator).

◆ drop_back() [1/2]

template<typename T , size_t N>
constexpr std::span< T > wpi::drop_back ( std::span< T, N >  in,
typename std::span< T >::size_type  n = 1 
)
constexpr

Drop the last N elements of the array.

◆ drop_back() [2/2]

constexpr std::string_view wpi::drop_back ( std::string_view  str,
std::string_view::size_type  n = 1 
)
constexprnoexcept

Return a string_view equal to str but with the last n elements dropped.

◆ drop_front() [1/2]

template<typename T , size_t N>
constexpr std::span< T > wpi::drop_front ( std::span< T, N >  in,
typename std::span< T >::size_type  n = 1 
)
constexpr

Drop the first N elements of the array.

◆ drop_front() [2/2]

constexpr std::string_view wpi::drop_front ( std::string_view  str,
std::string_view::size_type  n = 1 
)
constexprnoexcept

Return a string_view equal to str but with the first n elements dropped.

◆ dyn_cast() [1/4]

template<typename To , typename From >
decltype(auto) wpi::dyn_cast ( const From &  Val)
inline

dyn_cast<X> - Return the argument parameter cast to the specified type.

This casting operator returns null if the argument is of the wrong type, so it can be used to test for a type as well as cast if successful. The value passed in must be present, if not, use dyn_cast_if_present. This should be used in the context of an if statement like this:

if (const Instruction *I = dyn_cast<Instruction>(myVal)) { ... }

◆ dyn_cast() [2/4]

template<typename To , typename From >
decltype(auto) wpi::dyn_cast ( From &  Val)
inline

◆ dyn_cast() [3/4]

template<typename To , typename From >
decltype(auto) wpi::dyn_cast ( From *  Val)
inline

◆ dyn_cast() [4/4]

template<typename To , typename From >
decltype(auto) wpi::dyn_cast ( std::unique_ptr< From > &&  Val)
inline

◆ dyn_cast_if_present() [1/3]

template<class X , class Y >
auto wpi::dyn_cast_if_present ( const Y &  Val)

dyn_cast_if_present<X> - Functionally identical to dyn_cast, except that a null (or none in the case of optionals) value is accepted.

◆ dyn_cast_if_present() [2/3]

template<class X , class Y >
auto wpi::dyn_cast_if_present ( Y &  Val)

◆ dyn_cast_if_present() [3/3]

template<class X , class Y >
auto wpi::dyn_cast_if_present ( Y *  Val)

◆ dyn_cast_or_null() [1/3]

template<class X , class Y >
auto wpi::dyn_cast_or_null ( const Y &  Val)

◆ dyn_cast_or_null() [2/3]

template<class X , class Y >
auto wpi::dyn_cast_or_null ( Y &  Val)

◆ dyn_cast_or_null() [3/3]

template<class X , class Y >
auto wpi::dyn_cast_or_null ( Y *  Val)

◆ ends_with() [1/3]

constexpr bool wpi::ends_with ( std::string_view  str,
char  suffix 
)
constexprnoexcept

Checks if str ends with the given suffix.

◆ ends_with() [2/3]

constexpr bool wpi::ends_with ( std::string_view  str,
const char *  suffix 
)
constexprnoexcept

Checks if str ends with the given suffix.

◆ ends_with() [3/3]

constexpr bool wpi::ends_with ( std::string_view  str,
std::string_view  suffix 
)
constexprnoexcept

Checks if str ends with the given suffix.

◆ ends_with_lower() [1/3]

constexpr bool wpi::ends_with_lower ( std::string_view  str,
char  suffix 
)
constexprnoexcept

Checks if str ends with the given suffix, ignoring case.

◆ ends_with_lower() [2/3]

bool wpi::ends_with_lower ( std::string_view  str,
const char *  suffix 
)
inlinenoexcept

Checks if str ends with the given suffix, ignoring case.

◆ ends_with_lower() [3/3]

bool wpi::ends_with_lower ( std::string_view  str,
std::string_view  suffix 
)
noexcept

Checks if str ends with the given suffix, ignoring case.

◆ equals()

constexpr bool wpi::equals ( std::string_view  lhs,
std::string_view  rhs 
)
constexprnoexcept

equals - Check for string equality, this is more efficient than compare() when the relative ordering of inequal strings isn't needed.

◆ equals_lower()

constexpr bool wpi::equals_lower ( std::string_view  lhs,
std::string_view  rhs 
)
constexprnoexcept

equals_lower - Check for string equality, ignoring case.

◆ errs()

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.

◆ EscapeURI()

std::string_view wpi::EscapeURI ( std::string_view  str,
SmallVectorImpl< char > &  buf,
bool  spacePlus = true 
)

◆ find_lower() [1/3]

std::string_view::size_type wpi::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.

Returns
The index of the first occurrence of ch, or npos if not found.

◆ find_lower() [2/3]

std::string_view::size_type wpi::find_lower ( std::string_view  str,
const char *  other,
std::string_view::size_type  from = 0 
)
inlinenoexcept

Search for the first string other in str, ignoring case.

Returns
The index of the first occurrence of other, or npos if not found.

◆ find_lower() [3/3]

std::string_view::size_type wpi::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.

Returns
The index of the first occurrence of other, or npos if not found.

◆ FindMultipartBoundary()

bool wpi::FindMultipartBoundary ( wpi::raw_istream is,
std::string_view  boundary,
std::string *  saveBuf 
)

◆ for_each()

template<typename F , typename... Ts>
constexpr void wpi::for_each ( F &&  f,
Ts &&...  elems 
)
constexpr

Calls f(i, elem) for each element of elems where i is the index of the element in elems and elem is the element.

Parameters
fThe callback.
elemsThe elements.

◆ ForEachStructSchema()

template<StructSerializable T>
void wpi::ForEachStructSchema ( std::invocable< std::string_view, std::string_view > auto  fn)

◆ format_to_n_c_str()

template<class OutputIt , class... Args>
void wpi::format_to_n_c_str ( OutputIt  out,
std::iter_difference_t< OutputIt >  n,
fmt::format_string< Args... >  fmt,
Args &&...  args 
)
inline

Like std::format_to_n() in that it writes at most n bytes to the output buffer, but also includes a terminating null byte in n.

This is essentially a more performant replacement for std::snprintf().

Parameters
outThe output buffer.
nThe size of the output buffer.
fmtThe format string.
argsThe format string arguments.

◆ get() [1/2]

template<std::size_t I, typename PointerTy , unsigned IntBits, typename IntType , typename PtrTraits , typename Info >
decltype(auto) wpi::get ( const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &  Pair)

◆ get() [2/2]

template<std::size_t Index, typename ValueTy >
decltype(auto) wpi::get ( const StringMapEntry< ValueTy > &  E)

◆ GetHostname() [1/2]

std::string wpi::GetHostname ( )

◆ GetHostname() [2/2]

std::string_view wpi::GetHostname ( SmallVectorImpl< char > &  name)

◆ getNumBytesForUTF8()

unsigned wpi::getNumBytesForUTF8 ( UTF8  firstByte)

◆ GetStackTrace()

std::string wpi::GetStackTrace ( int  offset)

Get a stack trace, ignoring the first "offset" symbols.

Parameters
offsetThe number of symbols at the top of the stack to ignore

◆ GetStackTraceDefault()

std::string wpi::GetStackTraceDefault ( int  offset)

The default implementation used for GetStackTrace().

Parameters
offsetThe number of symbols at the top of the stack to ignore

◆ GetStructSchema()

template<StructSerializable T>
constexpr std::string_view wpi::GetStructSchema ( )
constexpr

◆ GetStructSchemaBytes()

template<StructSerializable T>
constexpr std::span< const uint8_t > wpi::GetStructSchemaBytes ( )
constexpr

◆ GetStructSize()

template<StructSerializable T>
constexpr size_t wpi::GetStructSize ( )
constexpr

Get the size for a raw struct serializable type.

Template Parameters
Tserializable type
Returns
size

◆ GetStructTypeString()

template<StructSerializable T>
constexpr auto wpi::GetStructTypeString ( )
constexpr

Get the type string for a raw struct serializable type.

Template Parameters
Tserializable type
Returns
type string

◆ GetSystemTime()

uint64_t wpi::GetSystemTime ( )

Return the current system time in microseconds since the Unix epoch (January 1st, 1970 00:00 UTC).

Returns
Time in microseconds.

◆ GetTypeName()

template<typename T >
std::string wpi::GetTypeName ( const T &  type)

Returns the type name of an object.

Parameters
typeThe object

◆ getUTF8SequenceSize()

unsigned wpi::getUTF8SequenceSize ( const UTF8 source,
const UTF8 sourceEnd 
)

◆ hash_combine()

template<typename ... Ts>
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

See also
hash_value overload (via ADL) for the type. For integer and pointer types it directly combines their data into the resulting hash_code.

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_combine_range()

template<typename InputIteratorT >
hash_code wpi::hash_combine_range ( InputIteratorT  first,
InputIteratorT  last 
)

Compute a hash_code for a sequence of values.

This hashes a sequence of values. It produces the same hash_code as 'hash_combine(a, b, c, ...)', but can run over arbitrary sized sequences and is significantly faster given pointers and types which can be hashed as a sequence of bytes.

◆ hash_value() [1/6]

template<typename T >
hash_code wpi::hash_value ( const std::basic_string< T > &  arg)

Compute a hash_code for a standard string.

◆ hash_value() [2/6]

template<typename T >
hash_code wpi::hash_value ( const std::optional< T > &  arg)

Compute a hash_code for a standard string.

◆ hash_value() [3/6]

template<typename T , typename U >
hash_code wpi::hash_value ( const std::pair< T, U > &  arg)

Compute a hash_code for a pair of objects.

◆ hash_value() [4/6]

template<typename... Ts>
hash_code wpi::hash_value ( const std::tuple< Ts... > &  arg)

Compute a hash_code for a tuple.

◆ hash_value() [5/6]

template<typename T >
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.

◆ hash_value() [6/6]

template<typename T >
std::enable_if_t< is_integral_or_enum< T >::value, hash_code > wpi::hash_value ( 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.

◆ hasUTF16ByteOrderMark()

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.

◆ hexdigit()

constexpr char wpi::hexdigit ( unsigned  X,
bool  LowerCase = false 
)
constexprnoexcept

hexdigit - Return the hexadecimal character for the given number X (which should be less than 16).

◆ hexDigitValue()

constexpr unsigned wpi::hexDigitValue ( char  C)
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.

◆ Hi_32()

constexpr uint32_t wpi::Hi_32 ( uint64_t  Value)
inlineconstexpr

Return the high 32 bits of a 64 bit value.

◆ http_body_is_final()

int wpi::http_body_is_final ( const http_parser *  parser)

◆ http_errno_description()

const char * wpi::http_errno_description ( enum http_errno  err)

◆ http_errno_name()

const char * wpi::http_errno_name ( enum http_errno  err)

◆ http_method_str()

const char * wpi::http_method_str ( enum http_method  m)

◆ http_parser_execute()

size_t wpi::http_parser_execute ( http_parser *  parser,
const http_parser_settings settings,
const char *  data,
size_t  len 
)

◆ http_parser_init()

void wpi::http_parser_init ( http_parser *  parser,
enum http_parser_type  type 
)

◆ http_parser_parse_url()

int wpi::http_parser_parse_url ( const char *  buf,
size_t  buflen,
int  is_connect,
struct http_parser_url u 
)

◆ http_parser_pause()

void wpi::http_parser_pause ( http_parser *  parser,
int  paused 
)

◆ http_parser_settings_init()

void wpi::http_parser_settings_init ( http_parser_settings settings)

◆ http_parser_url_init()

void wpi::http_parser_url_init ( struct http_parser_url u)

◆ http_parser_version()

unsigned long wpi::http_parser_version ( void  )

◆ http_should_keep_alive()

int wpi::http_should_keep_alive ( const http_parser *  parser)

◆ http_status_str()

const char * wpi::http_status_str ( enum http_status  s)

◆ insert_sorted()

template<typename T >
std::vector< T >::iterator wpi::insert_sorted ( std::vector< T > &  vec,
T const &  item 
)

◆ install_bad_alloc_error_handler()

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.

Parameters
user_data- An argument which will be passed to the installed error handler.

◆ install_fatal_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.

Parameters
user_data- An argument which will be passed to the install error handler.

◆ install_out_of_memory_new_handler()

void wpi::install_out_of_memory_new_handler ( )

◆ is_constexpr() [1/2]

constexpr bool wpi::is_constexpr (   ...)
constexpr

◆ is_constexpr() [2/2]

template<class Lambda , int = (Lambda{}(), 0)>
constexpr bool wpi::is_constexpr ( Lambda  )
constexpr

◆ isa() [1/2]

template<typename To , typename From >
bool wpi::isa ( const From &  Val)
inline

isa<X> - Return true if the parameter to the template is an instance of one of the template type arguments.

Used like this:

if (isa<Type>(myVal)) { ... } if (isa<Type0, Type1, Type2>(myVal)) { ... }

◆ isa() [2/2]

template<typename First , typename Second , typename... Rest, typename From >
bool wpi::isa ( const From &  Val)
inline

◆ isa_and_nonnull()

template<typename... X, class Y >
bool wpi::isa_and_nonnull ( const Y &  Val)
inline

◆ isa_and_present()

template<typename... X, class Y >
bool wpi::isa_and_present ( const Y &  Val)
inline

isa_and_present<X> - Functionally identical to isa, except that a null value is accepted.

◆ isAlnum()

constexpr bool wpi::isAlnum ( char  C)
constexprnoexcept

Checks whether character C is either a decimal digit or an uppercase or lowercase letter as classified by "C" locale.

◆ isAlpha()

constexpr bool wpi::isAlpha ( char  C)
constexprnoexcept

Checks if character C is a valid letter as classified by "C" locale.

◆ isASCII()

constexpr bool wpi::isASCII ( char  C)
constexprnoexcept

Checks whether character C is valid ASCII (high bit is zero).

◆ isDigit()

constexpr bool wpi::isDigit ( char  C)
constexprnoexcept

Checks if character C is one of the 10 decimal digits.

◆ isHexDigit()

constexpr bool wpi::isHexDigit ( char  C)
constexprnoexcept

Checks if character C is a hexadecimal numeric character.

◆ isInt()

template<unsigned N>
constexpr bool wpi::isInt ( int64_t  x)
inlineconstexpr

Checks if an integer fits into the given bit width.

◆ isIntN()

bool wpi::isIntN ( unsigned  N,
int64_t  x 
)
inline

Checks if an signed integer fits into the given (dynamic) bit width.

◆ isLegalUTF8Sequence()

Boolean wpi::isLegalUTF8Sequence ( const UTF8 source,
const UTF8 sourceEnd 
)

◆ isLegalUTF8String()

Boolean wpi::isLegalUTF8String ( const UTF8 **  source,
const UTF8 sourceEnd 
)

◆ isMask_32()

constexpr bool wpi::isMask_32 ( uint32_t  Value)
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.

◆ isMask_64()

constexpr bool wpi::isMask_64 ( uint64_t  Value)
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).

◆ isPowerOf2_32()

constexpr bool wpi::isPowerOf2_32 ( uint32_t  Value)
inlineconstexpr

Return true if the argument is a power of two > 0.

Ex. isPowerOf2_32(0x00100000U) == true (32 bit edition.)

◆ isPowerOf2_64()

constexpr bool wpi::isPowerOf2_64 ( uint64_t  Value)
inlineconstexpr

Return true if the argument is a power of two > 0 (64 bit edition.)

◆ isPrint()

constexpr bool wpi::isPrint ( char  C)
constexprnoexcept

Checks whether character C is printable.

Locale-independent version of the C standard library isprint whose results may differ on different platforms.

◆ isShiftedInt()

template<unsigned N, unsigned S>
constexpr bool wpi::isShiftedInt ( int64_t  x)
inlineconstexpr

Checks if a signed integer is an N bit number shifted left by S.

◆ isShiftedMask_32() [1/2]

constexpr bool wpi::isShiftedMask_32 ( uint32_t  Value)
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.

◆ isShiftedMask_32() [2/2]

bool wpi::isShiftedMask_32 ( uint32_t  Value,
unsigned &  MaskIdx,
unsigned &  MaskLen 
)
inline

Return true if the argument contains a non-empty sequence of ones with the remainder zero (32 bit version.) Ex.

isShiftedMask_32(0x0000FF00U) == true. If true, MaskIdx will specify the index of the lowest set bit and MaskLen is updated to specify the length of the mask, else neither are updated.

◆ isShiftedMask_64() [1/2]

constexpr bool wpi::isShiftedMask_64 ( uint64_t  Value)
inlineconstexpr

Return true if the argument contains a non-empty sequence of ones with the remainder zero (64 bit version.)

◆ isShiftedMask_64() [2/2]

bool wpi::isShiftedMask_64 ( uint64_t  Value,
unsigned &  MaskIdx,
unsigned &  MaskLen 
)
inline

Return true if the argument contains a non-empty sequence of ones with the remainder zero (64 bit version.) If true, MaskIdx will specify the index of the lowest set bit and MaskLen is updated to specify the length of the mask, else neither are updated.

◆ isShiftedUInt()

template<unsigned N, unsigned S>
constexpr bool wpi::isShiftedUInt ( uint64_t  x)
inlineconstexpr

Checks if a unsigned integer is an N bit number shifted left by S.

◆ isUInt()

template<unsigned N>
constexpr bool wpi::isUInt ( uint64_t  x)
inlineconstexpr

Checks if an unsigned integer fits into the given bit width.

◆ isUIntN()

bool wpi::isUIntN ( unsigned  N,
uint64_t  x 
)
inline

Checks if an unsigned integer fits into the given (dynamic) bit width.

◆ iterator_range()

template<typename Container >
wpi::iterator_range ( Container &&  ) -> iterator_range< detail::IterOfRange< Container > >

◆ Lerp()

template<typename T >
constexpr T wpi::Lerp ( const T &  startValue,
const T &  endValue,
double  t 
)
constexpr

Linearly interpolates between two values.

Parameters
startValueThe start value.
endValueThe end value.
tThe fraction for interpolation.
Returns
The interpolated value.

◆ Lo_32()

constexpr uint32_t wpi::Lo_32 ( uint64_t  Value)
inlineconstexpr

Return the low 32 bits of a 64 bit value.

◆ Log2_32()

unsigned wpi::Log2_32 ( uint32_t  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

◆ Log2_32_Ceil()

unsigned wpi::Log2_32_Ceil ( uint32_t  Value)
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

◆ Log2_64()

unsigned wpi::Log2_64 ( uint64_t  Value)
inline

Return the floor log base 2 of the specified value, -1 if the value is zero.

(64 bit edition.)

◆ Log2_64_Ceil()

unsigned wpi::Log2_64_Ceil ( uint64_t  Value)
inline

Return the ceil log base 2 of the specified value, 64 if the value is zero.

(64 bit edition.)

◆ ltrim() [1/2]

constexpr std::string_view wpi::ltrim ( std::string_view  str,
char  ch 
)
constexprnoexcept

Returns str with consecutive ch characters starting from the the left removed.

◆ ltrim() [2/2]

constexpr std::string_view wpi::ltrim ( std::string_view  str,
std::string_view  chars = " \t\n\v\f\r" 
)
constexprnoexcept

Returns str with consecutive characters in chars starting from the left removed.

◆ Make_64()

constexpr uint64_t wpi::Make_64 ( uint32_t  High,
uint32_t  Low 
)
inlineconstexpr

Make a 64-bit integer from a high / low pair of 32-bit integers.

◆ make_error_code()

std::error_code wpi::make_error_code ( errc  E)
inline

◆ make_pointee_range()

template<typename RangeT , typename WrappedIteratorT = decltype(std::begin(std::declval<RangeT>()))>
iterator_range< pointee_iterator< WrappedIteratorT > > wpi::make_pointee_range ( RangeT &&  Range)

◆ make_pointer_range()

template<typename RangeT , typename WrappedIteratorT = decltype(std::begin(std::declval<RangeT>()))>
iterator_range< pointer_iterator< WrappedIteratorT > > wpi::make_pointer_range ( RangeT &&  Range)

◆ make_range() [1/2]

template<typename T >
iterator_range< T > wpi::make_range ( std::pair< T, T >  p)

◆ make_range() [2/2]

template<class T >
iterator_range< T > wpi::make_range ( x,
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().

◆ make_ready_future() [1/2]

future< void > wpi::make_ready_future ( )
inline

Constructs a valid future with the value set.

◆ make_ready_future() [2/2]

template<typename T >
future< T > wpi::make_ready_future ( T &&  value)
inline

Constructs a valid future with the value set.

◆ MakeStructArraySchema()

template<StructSerializable T, size_t N>
consteval auto wpi::MakeStructArraySchema ( )

◆ MakeStructArrayTypeString()

template<StructSerializable T, size_t N>
constexpr auto wpi::MakeStructArrayTypeString ( )
constexpr

◆ mapWindowsError()

std::error_code wpi::mapWindowsError ( unsigned  EV)

◆ maskLeadingOnes()

template<typename T >
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.

◆ maskLeadingZeros()

template<typename T >
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.

◆ maskTrailingOnes()

template<typename T >
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.

◆ maskTrailingZeros()

template<typename T >
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.

◆ maxIntN()

int64_t wpi::maxIntN ( int64_t  N)
inline

Gets the maximum value for a N-bit signed integer.

◆ maxUIntN()

uint64_t wpi::maxUIntN ( uint64_t  N)
inline

Gets the maximum value for a N-bit unsigned integer.

◆ MimeTypeFromPath()

std::string_view wpi::MimeTypeFromPath ( std::string_view  path)

◆ MinAlign()

constexpr uint64_t wpi::MinAlign ( uint64_t  A,
uint64_t  B 
)
inlineconstexpr

A and B are either alignments or offsets.

Return the minimum alignment that may be assumed after adding the two together.

◆ minIntN()

int64_t wpi::minIntN ( int64_t  N)
inline

Gets the minimum value for a N-bit signed integer.

◆ MulOverflow()

template<typename T >
std::enable_if_t< std::is_signed_v< T >, T > wpi::MulOverflow ( X,
Y,
T &  Result 
)

Multiply two signed integers, computing the two's complement truncated result, returning true if an overflow ocurred.

◆ NextPowerOf2()

constexpr uint64_t wpi::NextPowerOf2 ( uint64_t  A)
inlineconstexpr

Returns the next power of two (in 64-bits) that is strictly greater than A.

Returns zero on overflow.

◆ Now()

uint64_t wpi::Now ( )

Return a value representing the current time in microseconds.

This is a monotonic clock with an undefined epoch.

Returns
Time in microseconds.

◆ NowDefault()

uint64_t wpi::NowDefault ( )

The default implementation used for Now().

In general this is the time returned by the operating system.

Returns
Time in microseconds.

◆ nulls()

raw_ostream & wpi::nulls ( )

This returns a reference to a raw_ostream which simply discards output.

◆ NumToCtString()

template<intmax_t N, int Base = 10, typename Char = char, typename Traits = std::char_traits<Char>>
requires (Base >= 2 && Base <= 36)
constexpr auto wpi::NumToCtString ( )
constexpr

Converts any integral to a ct_string at compile-time.

Template Parameters
Nnumber to convert
Basedesired base, can be from 2 to 36
Charcharacter type
Traitscharacter traits

◆ operator!=() [1/5]

template<typename DerivedT , typename KeyT , typename ValueT , typename KeyInfoT , typename BucketT >
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.

◆ operator!=() [2/5]

template<typename PtrType >
bool wpi::operator!= ( const SmallPtrSetImpl< PtrType > &  LHS,
const SmallPtrSetImpl< PtrType > &  RHS 
)

Inequality comparison for SmallPtrSet.

Equivalent to !(LHS == RHS).

◆ operator!=() [3/5]

template<typename T , unsigned LN, unsigned RN, typename C >
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.

◆ operator!=() [4/5]

template<typename ValueTy >
bool wpi::operator!= ( const StringMap< ValueTy > &  lhs,
const StringMap< ValueTy > &  rhs 
)
inline

◆ operator!=() [5/5]

template<typename ... PTs>
bool wpi::operator!= ( PointerUnion< PTs... >  lhs,
PointerUnion< PTs... >  rhs 
)

◆ operator+()

template<typename Char , typename Traits , size_t N1, size_t N2>
constexpr auto wpi::operator+ ( ct_string< Char, Traits, N1 > const &  s1,
ct_string< Char, Traits, N2 > const &  s2 
)
constexprnoexcept

◆ operator<() [1/2]

template<typename ValueTy >
bool wpi::operator< ( const StringMap< ValueTy > &  lhs,
const StringMap< ValueTy > &  rhs 
)

◆ operator<() [2/2]

template<typename ... PTs>
bool wpi::operator< ( PointerUnion< PTs... >  lhs,
PointerUnion< PTs... >  rhs 
)

◆ operator<<() [1/2]

template<typename OStream , typename T >
std::enable_if_t<!std::is_reference_v< OStream > && std::is_base_of_v< raw_ostream, OStream >, 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.

◆ operator<<() [2/2]

raw_ostream & wpi::operator<< ( raw_ostream OS,
sys::TimePoint<>  TP 
)

◆ operator<=()

template<typename ValueTy >
bool wpi::operator<= ( const StringMap< ValueTy > &  lhs,
const StringMap< ValueTy > &  rhs 
)
inline

◆ operator==() [1/5]

template<typename DerivedT , typename KeyT , typename ValueT , typename KeyInfoT , typename BucketT >
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).

◆ operator==() [2/5]

template<typename PtrType >
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.

◆ operator==() [3/5]

template<typename T , unsigned LN, unsigned RN, typename C >
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).

◆ operator==() [4/5]

template<typename ValueTy >
bool wpi::operator== ( const StringMap< ValueTy > &  lhs,
const StringMap< ValueTy > &  rhs 
)

◆ operator==() [5/5]

template<typename ... PTs>
bool wpi::operator== ( PointerUnion< PTs... >  lhs,
PointerUnion< PTs... >  rhs 
)

◆ operator>()

template<typename ValueTy >
bool wpi::operator> ( const StringMap< ValueTy > &  lhs,
const StringMap< ValueTy > &  rhs 
)
inline

◆ operator>=()

template<typename ValueTy >
bool wpi::operator>= ( const StringMap< ValueTy > &  lhs,
const StringMap< ValueTy > &  rhs 
)
inline

◆ outs()

raw_fd_ostream & wpi::outs ( )

This returns a reference to a raw_fd_ostream for standard output.

Use it like: outs() << "foo" << "bar";

◆ PackProtobuf()

template<ProtobufSerializable T>
void wpi::PackProtobuf ( google::protobuf::Message *  msg,
const T &  value 
)
inline

Pack a serialized protobuf message.

Parameters
msgprotobuf message (mutable, output)
valueobject

◆ PackStruct() [1/2]

template<StructSerializable T>
void wpi::PackStruct ( std::span< uint8_t >  data,
T &&  value 
)
inline

Pack a serialized struct.

Parameters
datastruct storage (mutable, output)
valueobject

◆ PackStruct() [2/2]

template<size_t Offset, StructSerializable T>
void wpi::PackStruct ( std::span< uint8_t >  data,
T &&  value 
)
inline

Pack a serialized struct starting at a given offset within the data.

This is primarily useful in pack implementations to pack nested structs.

Template Parameters
Offsetstarting offset
Parameters
datastruct storage (mutable, output)
valueobject

◆ parse_float()

template<typename T >
std::optional< T > wpi::parse_float ( std::string_view  str)
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.

◆ parse_float< double >()

template<>
std::optional< double > wpi::parse_float< double > ( std::string_view  str)
noexcept

◆ parse_float< float >()

template<>
std::optional< float > wpi::parse_float< float > ( std::string_view  str)
noexcept

◆ parse_float< long double >()

template<>
std::optional< long double > wpi::parse_float< long double > ( std::string_view  str)
noexcept

◆ parse_integer()

template<typename T , std::enable_if_t< std::numeric_limits< T >::is_signed, bool > = true>
std::optional< T > wpi::parse_integer ( std::string_view  str,
unsigned  radix 
)
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.

◆ ParseHttpHeaders()

bool wpi::ParseHttpHeaders ( raw_istream is,
SmallVectorImpl< char > *  contentType,
SmallVectorImpl< char > *  contentLength 
)

◆ PowerOf2Ceil()

uint64_t wpi::PowerOf2Ceil ( uint64_t  A)
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.

◆ ReadUleb128() [1/2]

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.

Parameters
addrThe address where the ULEB128 data is stored.
retAddress to store the result.

◆ ReadUleb128() [2/2]

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.

Parameters
isThe input stream where the ULEB128 data is to be read from.
retAddress to store the result.

◆ ReleaseSemaphore()

bool wpi::ReleaseSemaphore ( WPI_SemaphoreHandle  handle,
int  releaseCount = 1,
int *  prevCount = nullptr 
)

Releases N counts of a semaphore.

Parameters
handlesemaphore handle
releaseCountamount to add to semaphore's internal counter; must be positive
prevCountif non-null, previous count (output parameter)
Returns
True on successful release, false on failure (e.g. release count would exceed maximum value, or handle invalid)

◆ remove_bad_alloc_error_handler()

void wpi::remove_bad_alloc_error_handler ( )

Restores default bad alloc error handling behavior.

◆ remove_fatal_error_handler()

void wpi::remove_fatal_error_handler ( )

Restores default error handling behaviour.

◆ report_bad_alloc_error()

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().

◆ report_fatal_error() [1/3]

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.

◆ report_fatal_error() [2/3]

void wpi::report_fatal_error ( const std::string &  reason,
bool  gen_crash_diag = true 
)

◆ report_fatal_error() [3/3]

void wpi::report_fatal_error ( std::string_view  reason,
bool  gen_crash_diag = true 
)

◆ ResetEvent()

void wpi::ResetEvent ( WPI_EventHandle  handle)

Sets an event to non-signaled state.

Parameters
handleevent handle

◆ ResetSignalObject()

void wpi::ResetSignalObject ( WPI_Handle  handle)

Sets a handle to non-signaled state.

Parameters
handlehandle

◆ reverseBits()

template<typename T >
T wpi::reverseBits ( Val)

Reverse the bits in Val.

◆ rfind_lower() [1/3]

std::string_view::size_type wpi::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.

Returns
The index of the last occurrence of ch, or npos if not found.

◆ rfind_lower() [2/3]

std::string_view::size_type wpi::rfind_lower ( std::string_view  str,
const char *  other 
)
inlinenoexcept

Search for the last string other in str, ignoring case.

Returns
The index of the last occurrence of other, or npos if not found.

◆ rfind_lower() [3/3]

std::string_view::size_type wpi::rfind_lower ( std::string_view  str,
std::string_view  other 
)
noexcept

Search for the last string other in str, ignoring case.

Returns
The index of the last occurrence of other, or npos if not found.

◆ rsplit() [1/2]

constexpr std::pair< std::string_view, std::string_view > wpi::rsplit ( std::string_view  str,
char  separator 
)
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 == "").

Parameters
separatorThe string to split on.
Returns
The split substrings.

◆ rsplit() [2/2]

constexpr std::pair< std::string_view, std::string_view > wpi::rsplit ( std::string_view  str,
std::string_view  separator 
)
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 == "").

Parameters
separatorThe string to split on.
Returns
The split substrings.

◆ rtrim() [1/2]

constexpr std::string_view wpi::rtrim ( std::string_view  str,
char  ch 
)
constexprnoexcept

Returns str with consecutive Char characters starting from the right removed.

◆ rtrim() [2/2]

constexpr std::string_view wpi::rtrim ( std::string_view  str,
std::string_view  chars = " \t\n\v\f\r" 
)
constexprnoexcept

Returns str with consecutive characters in chars starting from the right removed.

◆ safe_calloc()

LLVM_ATTRIBUTE_RETURNS_NONNULL void * wpi::safe_calloc ( size_t  Count,
size_t  Sz 
)
inline

◆ safe_malloc()

LLVM_ATTRIBUTE_RETURNS_NONNULL void * wpi::safe_malloc ( size_t  Sz)
inline

◆ safe_realloc()

LLVM_ATTRIBUTE_RETURNS_NONNULL void * wpi::safe_realloc ( void *  Ptr,
size_t  Sz 
)
inline

◆ SaturatingAdd() [1/2]

template<typename T >
std::enable_if_t< std::is_unsigned_v< T >, T > wpi::SaturatingAdd ( X,
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.

◆ SaturatingAdd() [2/2]

template<class T , class... Ts>
std::enable_if_t< std::is_unsigned_v< T >, T > wpi::SaturatingAdd ( X,
Y,
Z,
Ts...  Args 
)

Add multiple unsigned integers of type T.

Clamp the result to the maximum representable value of T on overflow.

◆ SaturatingMultiply()

template<typename T >
std::enable_if_t< std::is_unsigned_v< T >, T > wpi::SaturatingMultiply ( X,
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.

◆ SaturatingMultiplyAdd()

template<typename T >
std::enable_if_t< std::is_unsigned_v< T >, T > wpi::SaturatingMultiplyAdd ( X,
Y,
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.

◆ set_fixed_execution_hash_seed()

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.

◆ SetEvent()

void wpi::SetEvent ( WPI_EventHandle  handle)

Sets an event to signaled state.

Parameters
handleevent handle

◆ SetGetStackTraceImpl()

void wpi::SetGetStackTraceImpl ( std::string(*)(int offset)  func)

Set the implementation used by GetStackTrace().

Parameters
funcFunction called by GetStackTrace().

◆ SetNowImpl()

void wpi::SetNowImpl ( uint64_t(*)()  func)

Set the implementation used by Now().

The implementation must return monotonic time in microseconds to maintain the contract of Now().

Parameters
funcFunction called by Now() to return the time.

◆ SetSignalObject()

void wpi::SetSignalObject ( WPI_Handle  handle)

Sets a handle to signaled state.

Parameters
handlehandle

◆ sgn()

template<typename T >
constexpr int wpi::sgn ( val)
constexpr

◆ shouldReverseIterate()

template<class T = void *>
bool wpi::shouldReverseIterate ( )

◆ SignExtend32() [1/2]

template<unsigned B>
constexpr int32_t wpi::SignExtend32 ( uint32_t  X)
inlineconstexpr

Sign-extend the number in the bottom B bits of X to a 32-bit integer.

Requires 0 < B <= 32.

◆ SignExtend32() [2/2]

int32_t wpi::SignExtend32 ( uint32_t  X,
unsigned  B 
)
inline

Sign-extend the number in the bottom B bits of X to a 32-bit integer.

Requires 0 < B <= 32.

◆ SignExtend64() [1/2]

template<unsigned B>
constexpr int64_t wpi::SignExtend64 ( uint64_t  x)
inlineconstexpr

Sign-extend the number in the bottom B bits of X to a 64-bit integer.

Requires 0 < B <= 64.

◆ SignExtend64() [2/2]

int64_t wpi::SignExtend64 ( uint64_t  X,
unsigned  B 
)
inline

Sign-extend the number in the bottom B bits of X to a 64-bit integer.

Requires 0 < B <= 64.

◆ SizeUleb128()

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.

Parameters
valLEB128 data.

◆ slice()

constexpr std::string_view wpi::slice ( std::string_view  str,
std::string_view::size_type  start,
std::string_view::size_type  end 
)
constexprnoexcept

Returns a reference to the substring of str from [start, end).

Parameters
startThe 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.
endThe 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.

◆ SocketErrno()

int wpi::SocketErrno ( )

◆ SocketStrerror() [1/2]

std::string wpi::SocketStrerror ( )
inline

◆ SocketStrerror() [2/2]

std::string wpi::SocketStrerror ( int  code)

◆ split() [1/4]

constexpr std::pair< std::string_view, std::string_view > wpi::split ( std::string_view  str,
char  separator 
)
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 == "").

Parameters
separatorThe character to split on.
Returns
The split substrings.

◆ split() [2/4]

void wpi::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.

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

Parameters
arrWhere to put the substrings.
separatorThe character to split on.
maxSplitThe maximum number of times the string is split.
keepEmptyTrue if empty substring should be added.

◆ split() [3/4]

void wpi::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.

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

Parameters
arrWhere to put the substrings.
separatorThe string to split on.
maxSplitThe maximum number of times the string is split.
keepEmptyTrue if empty substring should be added.

◆ split() [4/4]

constexpr std::pair< std::string_view, std::string_view > wpi::split ( std::string_view  str,
std::string_view  separator 
)
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 == "").

Parameters
separatorThe string to split on.
Returns
The split substrings.

◆ starts_with() [1/3]

constexpr bool wpi::starts_with ( std::string_view  str,
char  prefix 
)
constexprnoexcept

Checks if str starts with the given prefix.

◆ starts_with() [2/3]

constexpr bool wpi::starts_with ( std::string_view  str,
const char *  prefix 
)
constexprnoexcept

Checks if str starts with the given prefix.

◆ starts_with() [3/3]

constexpr bool wpi::starts_with ( std::string_view  str,
std::string_view  prefix 
)
constexprnoexcept

Checks if str starts with the given prefix.

◆ starts_with_lower() [1/3]

constexpr bool wpi::starts_with_lower ( std::string_view  str,
char  prefix 
)
constexprnoexcept

Checks if str starts with the given prefix, ignoring case.

◆ starts_with_lower() [2/3]

bool wpi::starts_with_lower ( std::string_view  str,
const char *  prefix 
)
inlinenoexcept

Checks if str starts with the given prefix, ignoring case.

◆ starts_with_lower() [3/3]

bool wpi::starts_with_lower ( std::string_view  str,
std::string_view  prefix 
)
noexcept

Checks if str starts with the given prefix, ignoring case.

◆ SubOverflow()

template<typename T >
std::enable_if_t< std::is_signed_v< T >, T > wpi::SubOverflow ( X,
Y,
T &  Result 
)

Subtract two signed integers, computing the two's complement truncated result, returning true if an overflow ocurred.

◆ substr()

constexpr std::string_view wpi::substr ( std::string_view  str,
std::string_view::size_type  start,
std::string_view::size_type  n = std::string_view::npos 
)
constexprnoexcept

Returns the substring of str from [start, start + n).

Parameters
startThe 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.
nThe 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.

◆ take_back() [1/2]

template<typename T , size_t N>
constexpr std::span< T > wpi::take_back ( std::span< T, N >  in,
typename std::span< T >::size_type  n = 1 
)
constexpr

Returns a span equal to in but with only the last n elements remaining.

If n is greater than the length of the span, the entire span is returned.

◆ take_back() [2/2]

constexpr std::string_view wpi::take_back ( std::string_view  str,
std::string_view::size_type  n = 1 
)
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.

◆ take_front() [1/2]

template<typename T , size_t N>
constexpr std::span< T > wpi::take_front ( std::span< T, N >  in,
typename std::span< T >::size_type  n = 1 
)
constexpr

Returns a span equal to in but with only the first n elements remaining.

If n is greater than the length of the span, the entire span is returned.

◆ take_front() [2/2]

constexpr std::string_view wpi::take_front ( std::string_view  str,
std::string_view::size_type  n = 1 
)
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.

◆ to_vector() [1/2]

template<unsigned Size, typename R >
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.

◆ to_vector() [2/2]

template<typename R >
SmallVector< ValueTypeFromRangeType< R > > wpi::to_vector ( R &&  Range)

◆ to_vector_of() [1/2]

template<typename Out , unsigned Size, typename R >
SmallVector< Out, Size > wpi::to_vector_of ( R &&  Range)

◆ to_vector_of() [2/2]

template<typename Out , typename R >
SmallVector< Out > wpi::to_vector_of ( R &&  Range)

◆ toLower()

constexpr char wpi::toLower ( char  x)
constexprnoexcept

Returns the corresponding lowercase character if x is uppercase.

◆ toUpper()

constexpr char wpi::toUpper ( char  x)
constexprnoexcept

Returns the corresponding uppercase character if x is lowercase.

◆ transformOptional() [1/2]

template<typename T , typename Function >
auto wpi::transformOptional ( const std::optional< T > &  O,
const Function &  F 
) -> std::optional<decltype(F(*O))>

◆ transformOptional() [2/2]

template<typename T , typename Function >
auto wpi::transformOptional ( std::optional< T > &&  O,
const Function &  F 
) -> std::optional<decltype(F(*std::move(O)))>

◆ trim() [1/2]

constexpr std::string_view wpi::trim ( std::string_view  str,
char  ch 
)
constexprnoexcept

Returns str with consecutive ch characters starting from the left and right removed.

◆ trim() [2/2]

constexpr std::string_view wpi::trim ( std::string_view  str,
std::string_view  chars = " \t\n\v\f\r" 
)
constexprnoexcept

Returns str with consecutive characters in chars starting from the left and right removed.

◆ UnescapeCString()

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.

Parameters
strinput string
bufbuffer for unescaped characters
Returns
pair of the unescaped string and any remaining input

◆ UnescapeURI()

std::string_view wpi::UnescapeURI ( std::string_view  str,
SmallVectorImpl< char > &  buf,
bool *  error 
)

◆ unique_dyn_cast() [1/2]

template<class X , class Y >
auto wpi::unique_dyn_cast ( std::unique_ptr< Y > &&  Val)
inline

◆ unique_dyn_cast() [2/2]

template<class X , class Y >
CastInfo< X, std::unique_ptr< Y > >::CastResultType wpi::unique_dyn_cast ( std::unique_ptr< Y > &  Val)
inline

unique_dyn_cast<X> - Given a unique_ptr<Y>, try to return a unique_ptr<X>, taking ownership of the input pointer iff isa<X>(Val) is true.

If the cast is successful, From refers to nullptr on exit and the casted value is returned. If the cast is unsuccessful, the function returns nullptr and From is unchanged.

◆ unique_dyn_cast_or_null() [1/2]

template<class X , class Y >
auto wpi::unique_dyn_cast_or_null ( std::unique_ptr< Y > &&  Val)
inline

◆ unique_dyn_cast_or_null() [2/2]

template<class X , class Y >
CastInfo< X, std::unique_ptr< Y > >::CastResultType wpi::unique_dyn_cast_or_null ( std::unique_ptr< Y > &  Val)
inline

◆ UnpackProtobuf()

template<ProtobufSerializable T>
T wpi::UnpackProtobuf ( const google::protobuf::Message &  msg)
inline

Unpack a serialized protobuf message.

Template Parameters
Tobject type
Parameters
msgprotobuf message
Returns
Deserialized object

◆ UnpackProtobufInto()

template<ProtobufSerializable T>
void wpi::UnpackProtobufInto ( T *  out,
const google::protobuf::Message &  msg 
)
inline

Unpack a serialized struct into an existing object, overwriting its contents.

Parameters
outobject (output)
msgprotobuf message

◆ UnpackStruct() [1/2]

template<StructSerializable T>
T wpi::UnpackStruct ( std::span< const uint8_t >  data)
inline

Unpack a serialized struct.

Template Parameters
Tobject type
Parameters
dataraw struct data
Returns
Deserialized object

◆ UnpackStruct() [2/2]

template<StructSerializable T, size_t Offset>
T wpi::UnpackStruct ( std::span< const uint8_t >  data)
inline

Unpack a serialized struct starting at a given offset within the data.

This is primarily useful in unpack implementations to unpack nested structs.

Template Parameters
Tobject type
Offsetstarting offset
Parameters
dataraw struct data
Returns
Deserialized object

◆ UnpackStructInto() [1/2]

template<StructSerializable T>
void wpi::UnpackStructInto ( T *  out,
std::span< const uint8_t >  data 
)
inline

Unpack a serialized struct into an existing object, overwriting its contents.

Parameters
outobject (output)
dataraw struct data

◆ UnpackStructInto() [2/2]

template<size_t Offset, StructSerializable T>
void wpi::UnpackStructInto ( T *  out,
std::span< const uint8_t >  data 
)
inline

Unpack a serialized struct into an existing object, overwriting its contents, and starting at a given offset within the data.

This is primarily useful in unpack implementations to unpack nested structs.

Template Parameters
Offsetstarting offset
Parameters
outobject (output)
dataraw struct data

◆ utohexstr()

std::string wpi::utohexstr ( unsigned long long  val,
bool  lowerCase = false 
)
inline

◆ WaitForObject() [1/2]

bool wpi::WaitForObject ( WPI_Handle  handle)

Waits for an handle to be signaled.

Parameters
handlehandle to wait on
Returns
True if handle was signaled, false otherwise (e.g. object was destroyed)

◆ WaitForObject() [2/2]

bool wpi::WaitForObject ( WPI_Handle  handle,
double  timeout,
bool *  timedOut 
)

Waits for an handle to be signaled, with timeout.

Parameters
handlehandle to wait on
timeouttimeout in seconds
timedOutif non-null, set to true if timeout reached without handle being signaled; set to false otherwise (output)
Returns
True if handle was signaled, false otherwise (e.g. object was destroyed or timed out)

◆ WaitForObjects() [1/4]

std::span< WPI_Handle > wpi::WaitForObjects ( std::initializer_list< WPI_Handle handles,
std::span< WPI_Handle signaled 
)
inline

Waits for one or more handles to be signaled.

Invalid handles are treated as signaled; the returned array will have the handle error bit set for any invalid handles.

Parameters
handlesarray of handles to wait on
signaledoutput array for storage of signaled handles; must be at least the size of the handles input array
Returns
array of signaled handles (points into signaled array)

◆ WaitForObjects() [2/4]

std::span< WPI_Handle > wpi::WaitForObjects ( std::initializer_list< WPI_Handle handles,
std::span< WPI_Handle signaled,
double  timeout,
bool *  timedOut 
)
inline

Waits for one or more handles to be signaled, with timeout.

Invalid handles are treated as signaled; the returned array will have the handle error bit set for any invalid handles.

Parameters
handlesarray of handles to wait on
signaledoutput array for storage of signaled handles; must be at least the size of the handles input array
timeouttimeout in seconds
timedOutif non-null, set to true if timeout reached without any handle being signaled; set to false otherwise (output)
Returns
array of signaled handles (points into signaled array)

◆ WaitForObjects() [3/4]

std::span< WPI_Handle > wpi::WaitForObjects ( std::span< const WPI_Handle handles,
std::span< WPI_Handle signaled 
)

Waits for one or more handles to be signaled.

Invalid handles are treated as signaled; the returned array will have the handle error bit set for any invalid handles.

Parameters
handlesarray of handles to wait on
signaledoutput array for storage of signaled handles; must be at least the size of the handles input array
Returns
array of signaled handles (points into signaled array)

◆ WaitForObjects() [4/4]

std::span< WPI_Handle > wpi::WaitForObjects ( std::span< const WPI_Handle handles,
std::span< WPI_Handle signaled,
double  timeout,
bool *  timedOut 
)

Waits for one or more handles to be signaled, with timeout.

Invalid handles are treated as signaled; the returned array will have the handle error bit set for any invalid handles.

Parameters
handlesarray of handles to wait on
signaledoutput array for storage of signaled handles; must be at least the size of the handles input array
timeouttimeout in seconds
timedOutif non-null, set to true if timeout reached without any handle being signaled; set to false otherwise (output)
Returns
array of signaled handles (points into signaled array)

◆ wpi_unreachable_internal()

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.

◆ WriteUleb128() [1/2]

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".

Parameters
osOutput stream.
valValue to be stored.

◆ WriteUleb128() [2/2]

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.

Parameters
destThe address where the ULEB128 data is to be stored.
valValue to be stored.

◆ xxh3_64bits() [1/2]

uint64_t wpi::xxh3_64bits ( std::span< const uint8_t >  data)

◆ xxh3_64bits() [2/2]

uint64_t wpi::xxh3_64bits ( std::string_view  data)
inline

◆ xxHash64() [1/2]

uint64_t wpi::xxHash64 ( std::span< const uint8_t >  Data)

◆ xxHash64() [2/2]

uint64_t wpi::xxHash64 ( std::string_view  Data)