WPILibC++ 2023.4.3
wpi Namespace Reference

/file This file defines the SmallVector class. More...

Namespaces

namespace  detail
 detail namespace with internal helper functions
 
namespace  hashing
 
namespace  impl
 
namespace  java
 Java Native Interface (JNI) utility functions.
 
namespace  log
 
namespace  math
 
namespace  pointer_union_detail
 
namespace  sig
 
namespace  support
 
namespace  sys
 
namespace  uv
 

Classes

struct  add_const_past_pointer
 If T is a pointer to X, return a pointer to const X. More...
 
struct  add_const_past_pointer< T, std::enable_if_t< std::is_pointer< T >::value > >
 
struct  add_lvalue_reference_if_not_pointer
 If T is a pointer, just return it. If it is not, return T&. More...
 
struct  add_lvalue_reference_if_not_pointer< T, std::enable_if_t< std::is_pointer< T >::value > >
 
struct  adl_serializer
 default JSONSerializer template argument More...
 
struct  AlignedCharArrayUnion
 A suitably aligned and sized character array member which can hold elements of any type. More...
 
class  AllocatorBase
 CRTP base class providing obvious overloads for the core Allocate() methods of LLVM-style allocators. More...
 
class  array
 This class is a wrapper around std::array that does compile time size checking. More...
 
class  buffer_ostream
 
class  buffer_unique_ostream
 
struct  CalculateSmallVectorDefaultInlinedElements
 Helper class for calculating the default number of inline elements for SmallVector<T>. More...
 
class  CallbackListenerData
 
class  CallbackManager
 
class  CallbackThread
 
class  circular_buffer
 This is a simple circular buffer so we don't need to "bucket brigade" copy old values. More...
 
class  ConcurrentQueue
 
struct  conjunction
 
struct  conjunction< B1 >
 
struct  conjunction< B1, Bn... >
 
struct  const_pointer_or_const_ref
 
struct  const_pointer_or_const_ref< T, std::enable_if_t< std::is_pointer< T >::value > >
 
class  DebugEpochBase
 A base class for data structure classes wishing to make iterators ("handles") pointing into themselves fail-fast. More...
 
class  DenseMap
 
class  DenseMapBase
 
struct  DenseMapInfo
 An information struct used to provide DenseMap with the various necessary components for a given value type T. More...
 
struct  DenseMapInfo< char >
 
struct  DenseMapInfo< hash_code, void >
 
struct  DenseMapInfo< int >
 
struct  DenseMapInfo< long >
 
struct  DenseMapInfo< long long >
 
struct  DenseMapInfo< PointerIntPair< PointerTy, IntBits, IntType >, void >
 
struct  DenseMapInfo< PointerUnion< PTs... > >
 
struct  DenseMapInfo< short >
 
struct  DenseMapInfo< std::pair< T, U > >
 
struct  DenseMapInfo< std::tuple< Ts... > >
 
struct  DenseMapInfo< T * >
 
struct  DenseMapInfo< unsigned >
 
struct  DenseMapInfo< unsigned char >
 
struct  DenseMapInfo< unsigned long >
 
struct  DenseMapInfo< unsigned long long >
 
struct  DenseMapInfo< unsigned short >
 
class  DenseMapIterator
 
struct  disjunction
 
struct  disjunction< B1 >
 
struct  disjunction< B1, Bn... >
 
class  DsClient
 
struct  empty_array_t
 
class  EventLoopRunner
 Executes an event loop on a separate thread. More...
 
struct  EventVector
 
struct  FirstIndexOfType
 Find the first index where a type appears in a list of types. More...
 
struct  FirstIndexOfType< T, T, Us... >
 
struct  FirstIndexOfType< T, U, Us... >
 
class  function_ref
 An efficient, type-erasing, non-owning reference to a callable. More...
 
class  function_ref< Ret(Params...)>
 
struct  FunctionPointerLikeTypeTraits
 Provide suitable custom traits struct for function pointers. More...
 
class  future
 A lightweight version of std::future. More...
 
class  future< void >
 Explicit specialization for future<void>. More...
 
class  hash_code
 An opaque object representing a hash code. More...
 
struct  http_parser
 
struct  http_parser_settings
 
struct  http_parser_url
 
class  HttpConnection
 
class  HttpLocation
 
class  HttpMultipartScanner
 
class  HttpParser
 HTTP protocol parser. More...
 
class  HttpPath
 Class for HTTP path matching. More...
 
class  HttpPathRef
 Proxy reference object for a portion of a HttpPath. More...
 
class  HttpQueryMap
 Map for looking up elements of the query portion of a URI. More...
 
class  HttpRequest
 
class  HttpServerConnection
 
class  HttpWebSocketServerConnection
 A server-side HTTP connection that also accepts WebSocket upgrades. More...
 
struct  in_place_index_t
 
struct  in_place_t
 
struct  in_place_type_t
 
class  interpolating_map
 Implements a table of key-value pairs with linear interpolation between values. More...
 
class  is_integral_or_enum
 Metafunction that determines whether the given type is either an integral type or an enumeration type, including enum classes. More...
 
class  iterator_adaptor_base
 CRTP base class for adapting an iterator to a different type. More...
 
class  iterator_facade_base
 CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of the interface. More...
 
class  iterator_range
 A range adaptor for a pair of iterators. More...
 
class  json
 a class to store JSON values More...
 
class  json_pointer
 
class  Logger
 
class  MallocAllocator
 
class  MappedFileRegion
 
class  MapVector
 This class implements a map that also provides access to all stored values in a deterministic order. More...
 
class  MemoryBuffer
 This interface provides simple read-only access to a block of memory, and provides simple methods for reading files and standard input into a memory buffer. More...
 
class  MemoryBufferRef
 
struct  negation
 
class  NetworkAcceptor
 
class  NetworkStream
 
struct  NullDeleter
 
class  ParallelTcpConnector
 Parallel TCP connector. More...
 
struct  pointee_iterator
 An iterator type that allows iterating over the pointees via some other iterator. More...
 
class  pointer_iterator
 
class  PointerIntPair
 PointerIntPair - This class implements a pair of a pointer and small integer. More...
 
struct  PointerIntPairInfo
 
struct  PointerLikeTypeTraits
 A traits type that is used to handle pointer types and things that are just wrappers for pointers as a uniform entity. More...
 
struct  PointerLikeTypeTraits< const T * >
 
struct  PointerLikeTypeTraits< const T >
 
struct  PointerLikeTypeTraits< PointerIntPair< PointerTy, IntBits, IntType, PtrTraits > >
 
struct  PointerLikeTypeTraits< PointerUnion< PTs... > >
 
struct  PointerLikeTypeTraits< ReturnT(*)(ParamTs...)>
 Provide a default specialization for function pointers that assumes 4-byte alignment. More...
 
struct  PointerLikeTypeTraits< T * >
 
struct  PointerLikeTypeTraits< uintptr_t >
 
struct  PointerLikeTypeTraits< void * >
 
class  PointerUnion
 A discriminated union of two or more pointer types, with the discriminator in the low bit of the pointer. More...
 
class  PortForwarder
 Forward ports to another host. More...
 
class  priority_queue
 This class is the same as std::priority_queue with two changes: More...
 
class  promise
 A lightweight version of std::promise. More...
 
class  promise< void >
 Explicit specialization for promise<void>. More...
 
class  PromiseFactory
 A promise factory for lightweight futures. More...
 
class  PromiseFactory< void >
 Explicit specialization for PromiseFactory<void>. More...
 
class  raw_fd_istream
 
class  raw_fd_ostream
 A raw_ostream that writes to a file descriptor. More...
 
class  raw_fd_stream
 A raw_ostream of a file for reading/writing/seeking. More...
 
class  raw_istream
 
class  raw_mem_istream
 
class  raw_null_ostream
 A raw_ostream that discards all output. More...
 
class  raw_os_ostream
 raw_os_ostream - A raw_ostream that writes to an std::ostream. More...
 
class  raw_ostream
 This class implements an extremely fast bulk output stream that can only output to a stream. More...
 
class  raw_pwrite_stream
 An abstract base class for streams implementations that also support a pwrite operation. More...
 
class  raw_socket_istream
 
class  raw_socket_ostream
 
class  raw_string_ostream
 A raw_ostream that writes to an std::string. More...
 
class  raw_svector_ostream
 A raw_ostream that writes to an SmallVector or SmallString. More...
 
class  raw_usvector_ostream
 A raw_ostream that writes to an SmallVector or SmallString. More...
 
class  raw_uv_ostream
 raw_ostream style output to a SmallVector of uv::Buffer buffers. More...
 
class  raw_uvector_ostream
 A raw_ostream that writes to a vector. More...
 
class  raw_vector_ostream
 A raw_ostream that writes to a vector. More...
 
class  recursive_spinlock1
 A recursive spinlock mutex. More...
 
class  recursive_spinlock2
 A recursive spinlock mutex. More...
 
struct  remove_cvref
 
struct  RoundUpToPowerOfTwo
 RoundUpToPowerOfTwo - This is a helper template that rounds N up to the next power of two (which means N itself if N is already a power of two). More...
 
struct  RoundUpToPowerOfTwoH
 RoundUpToPowerOfTwoH - If N is not a power of two, increase it. More...
 
struct  RoundUpToPowerOfTwoH< N, false >
 
class  SafeThread
 
class  SafeThreadBase
 Base class for SafeThreadOwner threads. More...
 
class  SafeThreadEvent
 
class  SafeThreadOwner
 
class  scope_exit
 
struct  ScopedFatalErrorHandler
 ScopedFatalErrorHandler - This is a simple helper class which just calls install_fatal_error_handler in its constructor and remove_fatal_error_handler in its destructor. More...
 
class  Sendable
 Interface for Sendable objects. More...
 
class  SendableBuilder
 
class  SendableHelper
 A helper class for use with objects that add themselves to SendableRegistry. More...
 
class  SendableRegistry
 The SendableRegistry class is the public interface for registering sensors and actuators for use on dashboards and LiveWindow. More...
 
class  SHA1
 
class  SmallDenseMap
 
struct  SmallMapVector
 A MapVector that performs no allocations if smaller than a certain size. More...
 
class  SmallPtrSet
 SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements. More...
 
class  SmallPtrSetImpl
 A templated base class for SmallPtrSet which provides the typesafe interface that is common across all small sizes. More...
 
class  SmallPtrSetImplBase
 SmallPtrSetImplBase - This is the common code shared among all the SmallPtrSet<>'s, which is almost everything. More...
 
class  SmallPtrSetIterator
 SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet. More...
 
class  SmallPtrSetIteratorImpl
 SmallPtrSetIteratorImpl - This is the common base class shared between all instances of SmallPtrSetIterator. More...
 
class  SmallSet
 SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less than N). More...
 
class  SmallSet< PointeeType *, N >
 If this set is of pointer values, transparently switch over to using SmallPtrSet for performance. More...
 
class  SmallSetIterator
 SmallSetIterator - This class implements a const_iterator for SmallSet by delegating to the underlying SmallVector or Set iterators. More...
 
class  SmallString
 SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better as a string (e.g. More...
 
class  SmallVector
 This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small. More...
 
struct  SmallVectorAlignmentAndSize
 Figure out the offset of the first element. More...
 
class  SmallVectorBase
 This is all the stuff common to all SmallVectors. More...
 
class  SmallVectorImpl
 This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter. More...
 
class  SmallVectorMemoryBuffer
 SmallVector-backed MemoryBuffer instance. More...
 
struct  SmallVectorStorage
 Storage for the SmallVector elements. More...
 
struct  SmallVectorStorage< T, 0 >
 We need the storage to be properly aligned even for small-size of 0 so that the pointer math in SmallVectorTemplateCommon::getFirstEl() is well-defined. More...
 
class  SmallVectorTemplateBase
 SmallVectorTemplateBase<TriviallyCopyable = false> - This is where we put method implementations that are designed to work with non-trivial T's. More...
 
class  SmallVectorTemplateBase< T, true >
 SmallVectorTemplateBase<TriviallyCopyable = true> - This is where we put method implementations that are designed to work with trivially copyable T's. More...
 
class  SmallVectorTemplateCommon
 This is the part of SmallVectorTemplateBase which does not depend on whether the type T is a POD. More...
 
class  spinlock
 A spinlock mutex. More...
 
class  static_circular_buffer
 This is a simple circular buffer so we don't need to "bucket brigade" copy old values. More...
 
class  StringMap
 StringMap - This is an unconventional map that is specialized for handling keys that are "strings", which are basically ranges of bytes. More...
 
class  StringMapConstIterator
 
class  StringMapEntry
 StringMapEntry - This is used to represent one value that is inserted into a StringMap. More...
 
class  StringMapEntryBase
 StringMapEntryBase - Shared base class of StringMapEntry instances. More...
 
class  StringMapEntryStorage
 StringMapEntryStorage - Holds the value in a StringMapEntry. More...
 
class  StringMapEntryStorage< std::nullopt_t >
 
class  StringMapImpl
 StringMapImpl - This is the base class of StringMap that is shared among all of its instantiations. More...
 
class  StringMapIterator
 
class  StringMapIterBase
 
class  StringMapKeyIterator
 
struct  TypesAreDistinct
 Determine if all types in Ts are distinct. More...
 
struct  TypesAreDistinct<>
 
class  UDPClient
 
class  UidVector
 Vector which provides an integrated freelist for removal and reuse of individual elements. More...
 
class  Uleb128Reader
 Unsigned LEB128 streaming reader. More...
 
class  unique_function
 unique_function is a type-erasing functor similar to std::function. More...
 
class  unique_function< R(P...) const >
 
class  unique_function< R(P...)>
 
class  UrlParser
 Parses a URL into its constiuent components. More...
 
class  VersionTuple
 Represents a version number in the form major[.minor[.subminor[.build]]]. More...
 
class  WebSocket
 RFC 6455 compliant WebSocket client and server implementation. More...
 
class  WebSocketServer
 Dedicated WebSocket server. More...
 
class  WebSocketServerHelper
 WebSocket HTTP server helper. More...
 
class  WorkerThread
 
class  WorkerThread< R(T...)>
 
class  WritableMemoryBuffer
 This class is an extension of MemoryBuffer, which allows copy-on-write access to the underlying contents. More...
 
class  WriteThroughMemoryBuffer
 This class is an extension of MemoryBuffer, which allows write access to the underlying contents and committing those changes to the original source. More...
 

Typedefs

typedef int(* http_data_cb) (http_parser *, const char *at, size_t length)
 
typedef int(* http_cb) (http_parser *)
 
using recursive_spinlock = recursive_spinlock1
 
using mutex = ::std::mutex
 
using recursive_mutex = ::std::recursive_mutex
 
using condition_variable = ::std::condition_variable
 
template<size_t I, typename... Ts>
using TypeAtIndex = std::tuple_element_t< I, std::tuple< Ts... > >
 Find the type at a given index in a list of types. More...
 
template<typename T >
using is_trivially_move_constructible = std::is_trivially_move_constructible< T >
 
template<typename T >
using is_trivially_copy_constructible = std::is_trivially_copy_constructible< T >
 
template<typename WrappedIteratorT , typename T1 = std::remove_reference_t<decltype( **std::declval<WrappedIteratorT>())>, typename T2 = std::add_pointer_t<T1>>
using raw_pointer_iterator = pointer_iterator< pointee_iterator< WrappedIteratorT, T1 >, T2 >
 
template<typename T >
using remove_cvref_t = typename wpi::remove_cvref< T >::type
 
typedef unsigned int UTF32
 
typedef unsigned short UTF16
 
typedef unsigned char UTF8
 
typedef bool Boolean
 
typedef void(* fatal_error_handler_t) (void *user_data, const char *reason, bool gen_crash_diag)
 An error handler callback. More...
 
template<typename RangeType >
using ValueTypeFromRangeType = typename std::remove_const< typename std::remove_reference< decltype(*std::begin(std::declval< RangeType & >()))>::type >::type
 

Enumerations

enum  http_status
 
enum  http_method
 
enum  http_parser_type { HTTP_REQUEST , HTTP_RESPONSE , HTTP_BOTH }
 
enum  flags {
  F_CHUNKED = 1 << 0 , F_CONNECTION_KEEP_ALIVE = 1 << 1 , F_CONNECTION_CLOSE = 1 << 2 , F_CONNECTION_UPGRADE = 1 << 3 ,
  F_TRAILING = 1 << 4 , F_UPGRADE = 1 << 5 , F_SKIPBODY = 1 << 6 , F_CONTENTLENGTH = 1 << 7
}
 
enum  http_errno
 
enum  http_parser_url_fields {
  UF_SCHEMA = 0 , UF_HOST = 1 , UF_PORT = 2 , UF_PATH = 3 ,
  UF_QUERY = 4 , UF_FRAGMENT = 5 , UF_USERINFO = 6 , UF_MAX = 7
}
 
enum  LogLevel {
  WPI_LOG_CRITICAL = 50 , WPI_LOG_ERROR = 40 , WPI_LOG_WARNING = 30 , WPI_LOG_INFO = 20 ,
  WPI_LOG_DEBUG = 10 , WPI_LOG_DEBUG1 = 9 , WPI_LOG_DEBUG2 = 8 , WPI_LOG_DEBUG3 = 7 ,
  WPI_LOG_DEBUG4 = 6
}
 
enum  ZeroBehavior { ZB_Undefined , ZB_Max , ZB_Width }
 The behavior an operation has on an input of 0. More...
 
enum  ConversionResult { conversionOK , sourceExhausted , targetExhausted , sourceIllegal }
 
enum  ConversionFlags { strictConversion = 0 , lenientConversion }
 
enum class  errc {
  argument_list_too_long = int(std::errc::argument_list_too_long) , argument_out_of_domain = int(std::errc::argument_out_of_domain) , bad_address = int(std::errc::bad_address) , bad_file_descriptor = int(std::errc::bad_file_descriptor) ,
  broken_pipe = int(std::errc::broken_pipe) , device_or_resource_busy = int(std::errc::device_or_resource_busy) , directory_not_empty = int(std::errc::directory_not_empty) , executable_format_error = int(std::errc::executable_format_error) ,
  file_exists = int(std::errc::file_exists) , file_too_large = int(std::errc::file_too_large) , filename_too_long = int(std::errc::filename_too_long) , function_not_supported = int(std::errc::function_not_supported) ,
  illegal_byte_sequence = int(std::errc::illegal_byte_sequence) , inappropriate_io_control_operation , interrupted = int(std::errc::interrupted) , invalid_argument = int(std::errc::invalid_argument) ,
  invalid_seek = int(std::errc::invalid_seek) , io_error = int(std::errc::io_error) , is_a_directory = int(std::errc::is_a_directory) , no_child_process = int(std::errc::no_child_process) ,
  no_lock_available = int(std::errc::no_lock_available) , no_space_on_device = int(std::errc::no_space_on_device) , no_such_device_or_address = int(std::errc::no_such_device_or_address) , no_such_device = int(std::errc::no_such_device) ,
  no_such_file_or_directory = int(std::errc::no_such_file_or_directory) , no_such_process = int(std::errc::no_such_process) , not_a_directory = int(std::errc::not_a_directory) , not_enough_memory = int(std::errc::not_enough_memory) ,
  not_supported = int(std::errc::not_supported) , operation_not_permitted = int(std::errc::operation_not_permitted) , permission_denied = int(std::errc::permission_denied) , read_only_file_system = int(std::errc::read_only_file_system) ,
  resource_deadlock_would_occur = int(std::errc::resource_deadlock_would_occur) , resource_unavailable_try_again , result_out_of_range = int(std::errc::result_out_of_range) , too_many_files_open_in_system = int(std::errc::too_many_files_open_in_system) ,
  too_many_files_open = int(std::errc::too_many_files_open) , too_many_links = int(std::errc::too_many_links)
}
 

Functions

std::string_view MimeTypeFromPath (std::string_view path)
 
std::string_view UnescapeURI (std::string_view str, SmallVectorImpl< char > &buf, bool *error)
 
std::string_view EscapeURI (std::string_view str, SmallVectorImpl< char > &buf, bool spacePlus=true)
 
bool ParseHttpHeaders (raw_istream &is, SmallVectorImpl< char > *contentType, SmallVectorImpl< char > *contentLength)
 
bool FindMultipartBoundary (wpi::raw_istream &is, std::string_view boundary, std::string *saveBuf)
 
std::string GetHostname ()
 
std::string_view GetHostname (SmallVectorImpl< char > &name)
 
int SocketErrno ()
 
std::string SocketStrerror (int code)
 
std::string SocketStrerror ()
 
unsigned long http_parser_version (void)
 
void http_parser_init (http_parser *parser, enum http_parser_type type)
 
void http_parser_settings_init (http_parser_settings *settings)
 
size_t http_parser_execute (http_parser *parser, const http_parser_settings *settings, const char *data, size_t len)
 
int http_should_keep_alive (const http_parser *parser)
 
const char * http_method_str (enum http_method m)
 
const char * http_status_str (enum http_status s)
 
const char * http_errno_name (enum http_errno err)
 
const char * http_errno_description (enum http_errno err)
 
void http_parser_url_init (struct http_parser_url *u)
 
int http_parser_parse_url (const char *buf, size_t buflen, int is_connect, struct http_parser_url *u)
 
void http_parser_pause (http_parser *parser, int paused)
 
int http_body_is_final (const http_parser *parser)
 
template<typename T >
std::vector< T >::iterator insert_sorted (std::vector< T > &vec, T const &item)
 
uint64_t SizeUleb128 (uint64_t val)
 Get size of unsigned LEB128 data. More...
 
uint64_t WriteUleb128 (SmallVectorImpl< char > &dest, uint64_t val)
 Write unsigned LEB128 data. More...
 
void WriteUleb128 (raw_ostream &os, uint64_t val)
 Write unsigned LEB128 data. More...
 
uint64_t ReadUleb128 (const char *addr, uint64_t *ret)
 Read unsigned LEB128 data. More...
 
bool ReadUleb128 (raw_istream &is, uint64_t *ret)
 Read unsigned LEB128 data from a stream. More...
 
template<typename T >
future< T > make_ready_future (T &&value)
 Constructs a valid future with the value set. More...
 
future< void > make_ready_future ()
 Constructs a valid future with the value set. More...
 
std::string Demangle (std::string_view mangledSymbol)
 Demangle a C++ symbol. More...
 
std::string GetStackTrace (int offset)
 Get a stack trace, ignoring the first "offset" symbols. More...
 
std::string GetStackTraceDefault (int offset)
 The default implementation used for GetStackTrace(). More...
 
void SetGetStackTraceImpl (std::string(*func)(int offset))
 Set the implementation used by GetStackTrace(). More...
 
template<typename T >
constexpr std::span< T > drop_front (std::span< T > in, typename std::span< T >::size_type n=1)
 Drop the first N elements of the array. More...
 
template<typename T >
constexpr std::span< T > drop_back (std::span< T > in, typename std::span< T >::size_type n=1)
 Drop the last N elements of the array. More...
 
template<typename T , typename... Ts>
 array (T, Ts...) -> array< std::enable_if_t<(std::is_same_v< T, Ts > &&...), T >, 1+sizeof...(Ts)>
 
size_t Base64Decode (raw_ostream &os, std::string_view encoded)
 
size_t Base64Decode (std::string_view encoded, std::string *plain)
 
std::string_view Base64Decode (std::string_view encoded, size_t *num_read, SmallVectorImpl< char > &buf)
 
size_t Base64Decode (std::string_view encoded, std::vector< uint8_t > *plain)
 
std::span< uint8_t > Base64Decode (std::string_view encoded, size_t *num_read, SmallVectorImpl< uint8_t > &buf)
 
void Base64Encode (raw_ostream &os, std::string_view plain)
 
void Base64Encode (std::string_view plain, std::string *encoded)
 
std::string_view Base64Encode (std::string_view plain, SmallVectorImpl< char > &buf)
 
void Base64Encode (raw_ostream &os, std::span< const uint8_t > plain)
 
void Base64Encode (std::span< const uint8_t > plain, std::string *encoded)
 
std::string_view Base64Encode (std::span< const uint8_t > plain, SmallVectorImpl< char > &buf)
 
std::error_code mapWindowsError (unsigned EV)
 
template<typename ... PTs>
bool operator== (PointerUnion< PTs... > lhs, PointerUnion< PTs... > rhs)
 
template<typename ... PTs>
bool operator!= (PointerUnion< PTs... > lhs, PointerUnion< PTs... > rhs)
 
template<typename ... PTs>
bool operator< (PointerUnion< PTs... > lhs, PointerUnion< PTs... > rhs)
 
template<class T >
iterator_range< T > make_range (T x, T y)
 Convenience function for iterating over sub-ranges. More...
 
template<typename T >
iterator_range< T > make_range (std::pair< T, T > p)
 
template<typename RangeT , typename WrappedIteratorT = decltype(std::begin(std::declval<RangeT>()))>
iterator_range< pointee_iterator< WrappedIteratorT > > make_pointee_range (RangeT &&Range)
 
template<typename RangeT , typename WrappedIteratorT = decltype(std::begin(std::declval<RangeT>()))>
iterator_range< pointer_iterator< WrappedIteratorT > > make_pointer_range (RangeT &&Range)
 
raw_ostreamoperator<< (raw_ostream &OS, sys::TimePoint<> TP)
 
template<typename T >
unsigned countTrailingZeros (T Val, ZeroBehavior ZB=ZB_Width)
 Count number of 0's from the least significant bit to the most stopping at the first 1. More...
 
template<typename T >
unsigned countLeadingZeros (T Val, ZeroBehavior ZB=ZB_Width)
 Count number of 0's from the most significant bit to the least stopping at the first 1. More...
 
template<typename T >
findFirstSet (T Val, ZeroBehavior ZB=ZB_Max)
 Get the index of the first set bit starting from the least significant bit. More...
 
template<typename T >
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 >
findLastSet (T Val, ZeroBehavior ZB=ZB_Max)
 Get the index of the last set bit starting from the least significant bit. More...
 
template<typename T >
reverseBits (T Val)
 Reverse the bits in Val. More...
 
constexpr uint32_t Hi_32 (uint64_t Value)
 Return the high 32 bits of a 64 bit value. More...
 
constexpr uint32_t Lo_32 (uint64_t Value)
 Return the low 32 bits of a 64 bit value. More...
 
constexpr uint64_t Make_64 (uint32_t High, uint32_t Low)
 Make a 64-bit integer from a high / low pair of 32-bit integers. More...
 
template<unsigned N>
constexpr bool isInt (int64_t x)
 Checks if an integer fits into the given bit width. More...
 
template<>
constexpr bool isInt< 8 > (int64_t x)
 
template<>
constexpr bool isInt< 16 > (int64_t x)
 
template<>
constexpr bool isInt< 32 > (int64_t x)
 
template<unsigned N, unsigned S>
constexpr bool isShiftedInt (int64_t x)
 Checks if a signed integer is an N bit number shifted left by S. More...
 
template<unsigned N>
constexpr std::enable_if_t<(N< 64), bool > isUInt (uint64_t X)
 Checks if an unsigned integer fits into the given bit width. More...
 
constexpr bool isUInt (uint64_t)
 
template<>
constexpr bool isUInt< 8 > (uint64_t x)
 
template<>
constexpr bool isUInt< 16 > (uint64_t x)
 
template<>
constexpr bool isUInt< 32 > (uint64_t x)
 
template<unsigned N, unsigned S>
constexpr bool isShiftedUInt (uint64_t x)
 Checks if a unsigned integer is an N bit number shifted left by S. More...
 
uint64_t maxUIntN (uint64_t N)
 Gets the maximum value for a N-bit unsigned integer. More...
 
int64_t minIntN (int64_t N)
 Gets the minimum value for a N-bit signed integer. More...
 
int64_t maxIntN (int64_t N)
 Gets the maximum value for a N-bit signed integer. More...
 
bool isUIntN (unsigned N, uint64_t x)
 Checks if an unsigned integer fits into the given (dynamic) bit width. More...
 
bool isIntN (unsigned N, int64_t x)
 Checks if an signed integer fits into the given (dynamic) bit width. More...
 
constexpr bool isMask_32 (uint32_t Value)
 Return true if the argument is a non-empty sequence of ones starting at the least significant bit with the remainder zero (32 bit version). More...
 
constexpr bool isMask_64 (uint64_t Value)
 Return true if the argument is a non-empty sequence of ones starting at the least significant bit with the remainder zero (64 bit version). More...
 
constexpr bool isShiftedMask_32 (uint32_t Value)
 Return true if the argument contains a non-empty sequence of ones with the remainder zero (32 bit version.) Ex. More...
 
constexpr bool isShiftedMask_64 (uint64_t Value)
 Return true if the argument contains a non-empty sequence of ones with the remainder zero (64 bit version.) More...
 
constexpr bool isPowerOf2_32 (uint32_t Value)
 Return true if the argument is a power of two > 0. More...
 
constexpr bool isPowerOf2_64 (uint64_t Value)
 Return true if the argument is a power of two > 0 (64 bit edition.) More...
 
template<typename T >
unsigned countLeadingOnes (T Value, ZeroBehavior ZB=ZB_Width)
 Count the number of ones from the most significant bit to the first zero bit. More...
 
template<typename T >
unsigned countTrailingOnes (T Value, ZeroBehavior ZB=ZB_Width)
 Count the number of ones from the least significant bit to the first zero bit. More...
 
template<typename T >
unsigned countPopulation (T Value)
 Count the number of set bits in a value. More...
 
template<size_t kValue>
constexpr size_t CTLog2 ()
 Compile time Log2. More...
 
template<>
constexpr size_t CTLog2< 1 > ()
 
double Log2 (double Value)
 Return the log base 2 of the specified value. More...
 
unsigned Log2_32 (uint32_t Value)
 Return the floor log base 2 of the specified value, -1 if the value is zero. More...
 
unsigned Log2_64 (uint64_t Value)
 Return the floor log base 2 of the specified value, -1 if the value is zero. More...
 
unsigned Log2_32_Ceil (uint32_t Value)
 Return the ceil log base 2 of the specified value, 32 if the value is zero. More...
 
unsigned Log2_64_Ceil (uint64_t Value)
 Return the ceil log base 2 of the specified value, 64 if the value is zero. More...
 
template<typename T >
greatestCommonDivisor (T A, T B)
 Return the greatest common divisor of the values using Euclid's algorithm. More...
 
uint64_t GreatestCommonDivisor64 (uint64_t A, uint64_t B)
 
double BitsToDouble (uint64_t Bits)
 This function takes a 64-bit integer and returns the bit equivalent double. More...
 
float BitsToFloat (uint32_t Bits)
 This function takes a 32-bit integer and returns the bit equivalent float. More...
 
uint64_t DoubleToBits (double Double)
 This function takes a double and returns the bit equivalent 64-bit integer. More...
 
uint32_t FloatToBits (float Float)
 This function takes a float and returns the bit equivalent 32-bit integer. More...
 
constexpr uint64_t MinAlign (uint64_t A, uint64_t B)
 A and B are either alignments or offsets. More...
 
uint64_t NextPowerOf2 (uint64_t A)
 Returns the next power of two (in 64-bits) that is strictly greater than A. More...
 
uint64_t PowerOf2Floor (uint64_t A)
 Returns the power of two which is less than or equal to the given value. More...
 
uint64_t PowerOf2Ceil (uint64_t A)
 Returns the power of two which is greater than or equal to the given value. More...
 
uint64_t alignTo (uint64_t Value, uint64_t Align, uint64_t Skew=0)
 Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Align. More...
 
template<uint64_t Align>
constexpr uint64_t alignTo (uint64_t Value)
 Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Align. More...
 
uint64_t divideCeil (uint64_t Numerator, uint64_t Denominator)
 Returns the integer ceil(Numerator / Denominator). More...
 
uint64_t divideNearest (uint64_t Numerator, uint64_t Denominator)
 Returns the integer nearest(Numerator / Denominator). More...
 
uint64_t alignDown (uint64_t Value, uint64_t Align, uint64_t Skew=0)
 Returns the largest uint64_t less than or equal to Value and is Skew mod Align. More...
 
template<unsigned B>
constexpr int32_t SignExtend32 (uint32_t X)
 Sign-extend the number in the bottom B bits of X to a 32-bit integer. More...
 
int32_t SignExtend32 (uint32_t X, unsigned B)
 Sign-extend the number in the bottom B bits of X to a 32-bit integer. More...
 
template<unsigned B>
constexpr int64_t SignExtend64 (uint64_t x)
 Sign-extend the number in the bottom B bits of X to a 64-bit integer. More...
 
int64_t SignExtend64 (uint64_t X, unsigned B)
 Sign-extend the number in the bottom B bits of X to a 64-bit integer. More...
 
template<typename T >
std::enable_if_t< std::is_unsigned< T >::value, T > AbsoluteDifference (T X, T Y)
 Subtract two unsigned integers, X and Y, of type T and return the absolute value of the result. More...
 
template<typename T >
std::enable_if_t< std::is_unsigned< T >::value, T > SaturatingAdd (T X, T Y, bool *ResultOverflowed=nullptr)
 Add two unsigned integers, X and Y, of type T. More...
 
template<typename T >
std::enable_if_t< std::is_unsigned< T >::value, T > SaturatingMultiply (T X, T Y, bool *ResultOverflowed=nullptr)
 Multiply two unsigned integers, X and Y, of type T. More...
 
template<typename T >
std::enable_if_t< std::is_unsigned< T >::value, T > SaturatingMultiplyAdd (T X, T Y, T A, bool *ResultOverflowed=nullptr)
 Multiply two unsigned integers, X and Y, and add the unsigned integer, A to the product. More...
 
template<typename T >
std::enable_if_t< std::is_signed< T >::value, T > AddOverflow (T X, T Y, T &Result)
 Add two signed integers, computing the two's complement truncated result, returning true if overflow occured. More...
 
template<typename T >
std::enable_if_t< std::is_signed< T >::value, T > SubOverflow (T X, T Y, T &Result)
 Subtract two signed integers, computing the two's complement truncated result, returning true if an overflow ocurred. More...
 
template<typename T >
std::enable_if_t< std::is_signed< T >::value, T > MulOverflow (T X, T Y, T &Result)
 Multiply two signed integers, computing the two's complement truncated result, returning true if an overflow ocurred. More...
 
template<typename T >
constexpr int sgn (T val)
 
template<typename T >
constexpr T Lerp (const T &startValue, const T &endValue, double t)
 Linearly interpolates between two values. More...
 
ConversionResult ConvertUTF8toUTF16 (const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF8toUTF32Partial (const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags)
 Convert a partial UTF8 sequence to UTF32. More...
 
ConversionResult ConvertUTF8toUTF32 (const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags)
 Convert a partial UTF8 sequence to UTF32. More...
 
ConversionResult ConvertUTF16toUTF8 (const UTF16 **sourceStart, const UTF16 *sourceEnd, UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF32toUTF8 (const UTF32 **sourceStart, const UTF32 *sourceEnd, UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF16toUTF32 (const UTF16 **sourceStart, const UTF16 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF32toUTF16 (const UTF32 **sourceStart, const UTF32 *sourceEnd, UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags)
 
Boolean isLegalUTF8Sequence (const UTF8 *source, const UTF8 *sourceEnd)
 
Boolean isLegalUTF8String (const UTF8 **source, const UTF8 *sourceEnd)
 
unsigned getNumBytesForUTF8 (UTF8 firstByte)
 
bool ConvertUTF8toWide (unsigned WideCharWidth, std::string_view Source, char *&ResultPtr, const UTF8 *&ErrorPtr)
 Convert an UTF8 string_view to UTF8, UTF16, or UTF32 depending on WideCharWidth. More...
 
bool ConvertUTF8toWide (std::string_view Source, std::wstring &Result)
 Converts a UTF-8 string_view to a std::wstring. More...
 
bool ConvertUTF8toWide (const char *Source, std::wstring &Result)
 Converts a UTF-8 C-string to a std::wstring. More...
 
bool convertWideToUTF8 (const std::wstring &Source, SmallVectorImpl< char > &Result)
 Converts a std::wstring to a UTF-8 encoded std::string. More...
 
bool ConvertCodePointToUTF8 (unsigned Source, char *&ResultPtr)
 Convert an Unicode code point to UTF8 sequence. More...
 
ConversionResult convertUTF8Sequence (const UTF8 **source, const UTF8 *sourceEnd, UTF32 *target, ConversionFlags flags)
 Convert the first UTF8 sequence in the given source buffer to a UTF32 code point. More...
 
bool hasUTF16ByteOrderMark (std::span< const char > SrcBytes)
 Returns true if a blob of text starts with a UTF-16 big or little endian byte order mark. More...
 
bool convertUTF16ToUTF8String (std::span< const char > SrcBytes, SmallVectorImpl< char > &Out)
 Converts a stream of raw bytes assumed to be UTF16 into a UTF8 std::string. More...
 
bool convertUTF16ToUTF8String (std::span< const UTF16 > Src, SmallVectorImpl< char > &Out)
 Converts a UTF16 string into a UTF8 std::string. More...
 
bool convertUTF8ToUTF16String (std::string_view SrcUTF8, SmallVectorImpl< UTF16 > &DstUTF16)
 Converts a UTF-8 string into a UTF-16 string with native endianness. More...
 
constexpr char hexdigit (unsigned X, bool LowerCase=false) noexcept
 hexdigit - Return the hexadecimal character for the given number X (which should be less than 16). More...
 
constexpr unsigned hexDigitValue (char C) noexcept
 Interpret the given character C as a hexadecimal digit and return its value. More...
 
constexpr bool isDigit (char C) noexcept
 Checks if character C is one of the 10 decimal digits. More...
 
constexpr bool isHexDigit (char C) noexcept
 Checks if character C is a hexadecimal numeric character. More...
 
constexpr bool isAlpha (char C) noexcept
 Checks if character C is a valid letter as classified by "C" locale. More...
 
constexpr bool isAlnum (char C) noexcept
 Checks whether character C is either a decimal digit or an uppercase or lowercase letter as classified by "C" locale. More...
 
constexpr bool isASCII (char C) noexcept
 Checks whether character C is valid ASCII (high bit is zero). More...
 
constexpr bool isPrint (char C) noexcept
 Checks whether character C is printable. More...
 
constexpr char toLower (char x) noexcept
 Returns the corresponding lowercase character if x is uppercase. More...
 
constexpr char toUpper (char x) noexcept
 Returns the corresponding uppercase character if x is lowercase. More...
 
std::string utohexstr (unsigned long long val, bool lowerCase=false)
 
constexpr bool equals (std::string_view lhs, std::string_view rhs) noexcept
 equals - Check for string equality, this is more efficient than compare() when the relative ordering of inequal strings isn't needed. More...
 
int compare_lower (std::string_view lhs, std::string_view rhs) noexcept
 compare_lower - Compare two strings, ignoring case. More...
 
constexpr bool equals_lower (std::string_view lhs, std::string_view rhs) noexcept
 equals_lower - Check for string equality, ignoring case. More...
 
std::string_view::size_type find_lower (std::string_view str, char ch, std::string_view::size_type from=0) noexcept
 Search for the first character ch in str, ignoring case. More...
 
std::string_view::size_type find_lower (std::string_view str, std::string_view other, std::string_view::size_type from=0) noexcept
 Search for the first string other in str, ignoring case. More...
 
std::string_view::size_type find_lower (std::string_view str, const char *other, std::string_view::size_type from=0) noexcept
 Search for the first string other in str, ignoring case. More...
 
std::string_view::size_type rfind_lower (std::string_view str, char ch, std::string_view::size_type from=std::string_view::npos) noexcept
 Search for the last character ch in str, ignoring case. More...
 
std::string_view::size_type rfind_lower (std::string_view str, std::string_view other) noexcept
 Search for the last string other in str, ignoring case. More...
 
std::string_view::size_type rfind_lower (std::string_view str, const char *other) noexcept
 Search for the last string other in str, ignoring case. More...
 
constexpr std::string_view substr (std::string_view str, std::string_view::size_type start, std::string_view::size_type n=std::string_view::npos) noexcept
 Returns the substring of str from [start, start + n). More...
 
constexpr bool starts_with (std::string_view str, std::string_view prefix) noexcept
 Checks if str starts with the given prefix. More...
 
constexpr bool starts_with (std::string_view str, char prefix) noexcept
 Checks if str starts with the given prefix. More...
 
constexpr bool starts_with (std::string_view str, const char *prefix) noexcept
 Checks if str starts with the given prefix. More...
 
bool starts_with_lower (std::string_view str, std::string_view prefix) noexcept
 Checks if str starts with the given prefix, ignoring case. More...
 
constexpr bool starts_with_lower (std::string_view str, char prefix) noexcept
 Checks if str starts with the given prefix, ignoring case. More...
 
bool starts_with_lower (std::string_view str, const char *prefix) noexcept
 Checks if str starts with the given prefix, ignoring case. More...
 
constexpr bool ends_with (std::string_view str, std::string_view suffix) noexcept
 Checks if str ends with the given suffix. More...
 
constexpr bool ends_with (std::string_view str, char suffix) noexcept
 Checks if str ends with the given suffix. More...
 
constexpr bool ends_with (std::string_view str, const char *suffix) noexcept
 Checks if str ends with the given suffix. More...
 
bool ends_with_lower (std::string_view str, std::string_view suffix) noexcept
 Checks if str ends with the given suffix, ignoring case. More...
 
constexpr bool ends_with_lower (std::string_view str, char suffix) noexcept
 Checks if str ends with the given suffix, ignoring case. More...
 
bool ends_with_lower (std::string_view str, const char *suffix) noexcept
 Checks if str ends with the given suffix, ignoring case. More...
 
constexpr bool contains (std::string_view str, std::string_view other) noexcept
 Checks if str contains the substring other. More...
 
constexpr bool contains (std::string_view str, char ch) noexcept
 Checks if str contains the substring other. More...
 
constexpr bool contains (std::string_view str, const char *other) noexcept
 Checks if str contains the substring other. More...
 
bool contains_lower (std::string_view str, std::string_view other) noexcept
 Checks if str contains the substring other, ignoring case. More...
 
bool contains_lower (std::string_view str, char ch) noexcept
 Checks if str contains the substring other, ignoring case. More...
 
bool contains_lower (std::string_view str, const char *other) noexcept
 Checks if str contains the substring other, ignoring case. More...
 
constexpr std::string_view drop_front (std::string_view str, std::string_view::size_type n=1) noexcept
 Return a string_view equal to str but with the first n elements dropped. More...
 
constexpr std::string_view drop_back (std::string_view str, std::string_view::size_type n=1) noexcept
 Return a string_view equal to str but with the last n elements dropped. More...
 
constexpr std::string_view take_front (std::string_view str, std::string_view::size_type n=1) noexcept
 Returns a view equal to str but with only the first n elements remaining. More...
 
constexpr std::string_view take_back (std::string_view str, std::string_view::size_type n=1) noexcept
 Returns a view equal to str but with only the last n elements remaining. More...
 
constexpr std::string_view slice (std::string_view str, std::string_view::size_type start, std::string_view::size_type end) noexcept
 Returns a reference to the substring of str from [start, end). More...
 
constexpr std::pair< std::string_view, std::string_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...
 
void install_fatal_error_handler (fatal_error_handler_t handler, void *user_data=nullptr)
 install_fatal_error_handler - Installs a new error handler to be used whenever a serious (non-recoverable) error is encountered by LLVM. More...
 
void remove_fatal_error_handler ()
 Restores default error handling behavior. More...
 
void report_fatal_error (const char *reason, bool gen_crash_diag=true)
 Reports a serious error, calling any installed error handler. More...
 
void report_fatal_error (const std::string &reason, bool gen_crash_diag=true)
 
void report_fatal_error (std::string_view reason, bool gen_crash_diag=true)
 
void install_bad_alloc_error_handler (fatal_error_handler_t handler, void *user_data=nullptr)
 Installs a new bad alloc error handler that should be used whenever a bad alloc error, e.g. More...
 
void remove_bad_alloc_error_handler ()
 Restores default bad alloc error handling behavior. More...
 
void install_out_of_memory_new_handler ()
 
void report_bad_alloc_error (const char *Reason, bool GenCrashDiag=true)
 Reports a bad alloc error, calling any user defined bad alloc error handler. More...
 
void wpi_unreachable_internal (const char *msg=nullptr, const char *file=nullptr, unsigned line=0)
 This function calls abort(), and prints the optional message to stderr. More...
 
uint16_t ByteSwap_16 (uint16_t value)
 ByteSwap_16 - This function returns a byte-swapped representation of the 16-bit argument. More...
 
uint32_t ByteSwap_32 (uint32_t value)
 This function returns a byte-swapped representation of the 32-bit argument. More...
 
uint64_t ByteSwap_64 (uint64_t value)
 This function returns a byte-swapped representation of the 64-bit argument. More...
 
template<typename ValueTy >
bool operator== (const StringMap< ValueTy > &lhs, const StringMap< ValueTy > &rhs)
 
template<typename ValueTy >
bool operator!= (const StringMap< ValueTy > &lhs, const StringMap< ValueTy > &rhs)
 
template<typename ValueTy >
bool operator< (const StringMap< ValueTy > &lhs, const StringMap< ValueTy > &rhs)
 
template<typename ValueTy >
bool operator<= (const StringMap< ValueTy > &lhs, const StringMap< ValueTy > &rhs)
 
template<typename ValueTy >
bool operator> (const StringMap< ValueTy > &lhs, const StringMap< ValueTy > &rhs)
 
template<typename ValueTy >
bool operator>= (const StringMap< ValueTy > &lhs, const StringMap< ValueTy > &rhs)
 
template<typename T >
std::enable_if_t< is_integral_or_enum< T >::value, hash_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...
 
void set_fixed_execution_hash_seed (uint64_t fixed_value)
 Override the execution seed with a fixed value. More...
 
template<typename InputIteratorT >
hash_code hash_combine_range (InputIteratorT first, InputIteratorT last)
 Compute a hash_code for a sequence of values. More...
 
template<typename ... Ts>
hash_code hash_combine (const Ts &...args)
 Combine values into a single hash_code. More...
 
template<typename T , unsigned LN, unsigned RN, typename C >
bool operator== (const SmallSet< T, LN, C > &LHS, const SmallSet< T, RN, C > &RHS)
 Equality comparison for SmallSet. More...
 
template<typename T , unsigned LN, unsigned RN, typename C >
bool operator!= (const SmallSet< T, LN, C > &LHS, const SmallSet< T, RN, C > &RHS)
 Inequality comparison for SmallSet. More...
 
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_malloc (size_t Sz)
 
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_calloc (size_t Count, size_t Sz)
 
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_realloc (void *Ptr, size_t Sz)
 
LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * allocate_buffer (size_t Size, size_t Alignment)
 Allocate a buffer of memory with the given size and alignment. More...
 
void deallocate_buffer (void *Ptr, size_t Size, size_t Alignment)
 Deallocate a buffer of memory with the given size and alignment. More...
 
template<typename T , unsigned N>
size_t capacity_in_bytes (const SmallVector< T, N > &X)
 
template<unsigned Size, typename R >
SmallVector< ValueTypeFromRangeType< R >, Size > to_vector (R &&Range)
 Given a range of type R, iterate the entire range and return a SmallVector with elements of the vector. More...
 
template<typename R >
SmallVector< ValueTypeFromRangeType< R >, CalculateSmallVectorDefaultInlinedElements< ValueTypeFromRangeType< R > >::valueto_vector (R &&Range)
 
template<class T = void *>
bool shouldReverseIterate ()
 
std::error_code make_error_code (errc E)
 
uint32_t djbHash (std::string_view Buffer, uint32_t H=5381)
 The Bernstein hash function used by the DWARF accelerator tables. More...
 
template<typename DerivedT , typename KeyT , typename ValueT , typename KeyInfoT , typename BucketT >
bool operator== (const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > &LHS, const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > &RHS)
 Equality comparison for DenseMap. More...
 
template<typename DerivedT , typename KeyT , typename ValueT , typename KeyInfoT , typename BucketT >
bool operator!= (const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > &LHS, const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > &RHS)
 Inequality comparison for DenseMap. More...
 
template<typename KeyT , typename ValueT , typename KeyInfoT >
size_t capacity_in_bytes (const DenseMap< KeyT, ValueT, KeyInfoT > &X)
 
template<typename OStream , typename T >
std::enable_if_t<!std::is_reference< OStream >::value &&std::is_base_of< raw_ostream, OStream >::value, OStream && > operator<< (OStream &&OS, const T &Value)
 Call the appropriate insertion operator, given an rvalue reference to a raw_ostream object and return a stream of the same type as the argument. More...
 
raw_fd_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<typename PtrType >
bool operator== (const SmallPtrSetImpl< PtrType > &LHS, const SmallPtrSetImpl< PtrType > &RHS)
 Equality comparison for SmallPtrSet. More...
 
template<typename PtrType >
bool operator!= (const SmallPtrSetImpl< PtrType > &LHS, const SmallPtrSetImpl< PtrType > &RHS)
 Inequality comparison for SmallPtrSet. More...
 

Variables

constexpr empty_array_t empty_array
 
static const unsigned char BitReverseTable256 [256]
 Macro compressed bit reversal table for 256 bits. More...
 
const float huge_valf
 Use this rather than HUGE_VALF; the latter causes warnings on MSVC. More...
 
constexpr in_place_t in_place
 
template<typename T , unsigned N>
class LLVM_GSL_OWNER SmallVector
 Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference sizeof(SmallVector<T, 0>). More...
 

Detailed Description

/file This file defines the SmallVector class.

Typedef Documentation

◆ Boolean

typedef bool wpi::Boolean

◆ condition_variable

using wpi::condition_variable = typedef ::std::condition_variable

◆ fatal_error_handler_t

typedef void(* wpi::fatal_error_handler_t) (void *user_data, const char *reason, bool gen_crash_diag)

An error handler callback.

◆ http_cb

typedef int(* wpi::http_cb) (http_parser *)

◆ http_data_cb

typedef int(* wpi::http_data_cb) (http_parser *, const char *at, size_t length)

◆ is_trivially_copy_constructible

template<typename T >
using wpi::is_trivially_copy_constructible = typedef std::is_trivially_copy_constructible<T>

◆ is_trivially_move_constructible

template<typename T >
using wpi::is_trivially_move_constructible = typedef std::is_trivially_move_constructible<T>

◆ mutex

using wpi::mutex = typedef ::std::mutex

◆ raw_pointer_iterator

template<typename WrappedIteratorT , typename T1 = std::remove_reference_t<decltype( **std::declval<WrappedIteratorT>())>, typename T2 = std::add_pointer_t<T1>>
using wpi::raw_pointer_iterator = typedef pointer_iterator<pointee_iterator<WrappedIteratorT, T1>, T2>

◆ recursive_mutex

using wpi::recursive_mutex = typedef ::std::recursive_mutex

◆ recursive_spinlock

◆ remove_cvref_t

template<typename T >
using wpi::remove_cvref_t = typedef typename wpi::remove_cvref<T>::type

◆ TypeAtIndex

template<size_t I, typename... Ts>
using wpi::TypeAtIndex = typedef std::tuple_element_t<I, std::tuple<Ts...> >

Find the type at a given index in a list of types.

TypeAtIndex<I, Ts...> is the type at index I in Ts.

◆ UTF16

typedef unsigned short wpi::UTF16

◆ UTF32

typedef unsigned int wpi::UTF32

◆ UTF8

typedef unsigned char wpi::UTF8

◆ ValueTypeFromRangeType

template<typename RangeType >
using wpi::ValueTypeFromRangeType = typedef typename std::remove_const<typename std::remove_reference< decltype(*std::begin(std::declval<RangeType &>()))>::type>::type

Enumeration Type Documentation

◆ ConversionFlags

Enumerator
strictConversion 
lenientConversion 

◆ ConversionResult

Enumerator
conversionOK 
sourceExhausted 
targetExhausted 
sourceIllegal 

◆ errc

enum class wpi::errc
strong
Enumerator
argument_list_too_long 
argument_out_of_domain 
bad_address 
bad_file_descriptor 
broken_pipe 
device_or_resource_busy 
directory_not_empty 
executable_format_error 
file_exists 
file_too_large 
filename_too_long 
function_not_supported 
illegal_byte_sequence 
inappropriate_io_control_operation 
interrupted 
invalid_argument 
invalid_seek 
io_error 
is_a_directory 
no_child_process 
no_lock_available 
no_space_on_device 
no_such_device_or_address 
no_such_device 
no_such_file_or_directory 
no_such_process 
not_a_directory 
not_enough_memory 
not_supported 
operation_not_permitted 
permission_denied 
read_only_file_system 
resource_deadlock_would_occur 
resource_unavailable_try_again 
result_out_of_range 
too_many_files_open_in_system 
too_many_files_open 
too_many_links 

◆ flags

enum wpi::flags
Enumerator
F_CHUNKED 
F_CONNECTION_KEEP_ALIVE 
F_CONNECTION_CLOSE 
F_CONNECTION_UPGRADE 
F_TRAILING 
F_UPGRADE 
F_SKIPBODY 
F_CONTENTLENGTH 

◆ http_errno

◆ http_method

◆ http_parser_type

Enumerator
HTTP_REQUEST 
HTTP_RESPONSE 
HTTP_BOTH 

◆ http_parser_url_fields

Enumerator
UF_SCHEMA 
UF_HOST 
UF_PORT 
UF_PATH 
UF_QUERY 
UF_FRAGMENT 
UF_USERINFO 
UF_MAX 

◆ http_status

◆ LogLevel

Enumerator
WPI_LOG_CRITICAL 
WPI_LOG_ERROR 
WPI_LOG_WARNING 
WPI_LOG_INFO 
WPI_LOG_DEBUG 
WPI_LOG_DEBUG1 
WPI_LOG_DEBUG2 
WPI_LOG_DEBUG3 
WPI_LOG_DEBUG4 

◆ ZeroBehavior

The behavior an operation has on an input of 0.

Enumerator
ZB_Undefined 

The returned value is undefined.

ZB_Max 

The returned value is numeric_limits<T>::max()

ZB_Width 

The returned value is numeric_limits<T>::digits.

Function Documentation

◆ AbsoluteDifference()

template<typename T >
std::enable_if_t< std::is_unsigned< T >::value, 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< T >::value, T > wpi::AddOverflow ( X,
Y,
T &  Result 
)

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

◆ 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/2]

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/2]

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

Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Align.

Align must be non-zero.

If non-zero Skew is specified, the return value will be a minimal integer that is greater than or equal to Value and equal to Align * N + Skew for some integer N. If Skew is larger than Align, its value is adjusted to 'Skew mod Align'.

Examples:

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

◆ 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 , typename... Ts>
wpi::array ( ,
Ts...   
) -> array< std::enable_if_t<(std::is_same_v< T, Ts > &&...), 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 
)

◆ BitsToDouble()

double wpi::BitsToDouble ( uint64_t  Bits)
inline

This function takes a 64-bit integer and returns the bit equivalent double.

◆ BitsToFloat()

float wpi::BitsToFloat ( uint32_t  Bits)
inline

This function takes a 32-bit integer and returns the bit equivalent float.

◆ ByteSwap_16()

uint16_t wpi::ByteSwap_16 ( uint16_t  value)
inline

ByteSwap_16 - This function returns a byte-swapped representation of the 16-bit argument.

◆ ByteSwap_32()

uint32_t wpi::ByteSwap_32 ( uint32_t  value)
inline

This function returns a byte-swapped representation of the 32-bit argument.

◆ ByteSwap_64()

uint64_t wpi::ByteSwap_64 ( uint64_t  value)
inline

This function returns a byte-swapped representation of the 64-bit argument.

◆ 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

◆ compare_lower()

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

compare_lower - Compare two strings, ignoring case.

◆ 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 
)

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

◆ countLeadingOnes()

template<typename T >
unsigned wpi::countLeadingOnes ( Value,
ZeroBehavior  ZB = ZB_Width 
)

Count the number of ones from the most significant bit to the first zero bit.

Ex. countLeadingOnes(0xFF0FFF00) == 8. Only unsigned integral types are allowed.

Parameters
ZBthe behavior on an input of all ones. Only ZB_Width and ZB_Undefined are valid arguments.

◆ countLeadingZeros()

template<typename T >
unsigned wpi::countLeadingZeros ( Val,
ZeroBehavior  ZB = ZB_Width 
)

Count number of 0's from the most significant bit to the least stopping at the first 1.

Only unsigned integral types are allowed.

Parameters
ZBthe behavior on an input of 0. Only ZB_Width and ZB_Undefined are valid arguments.

◆ countPopulation()

template<typename T >
unsigned wpi::countPopulation ( Value)
inline

Count the number of set bits in a value.

Ex. countPopulation(0xF000F000) = 8 Returns 0 if the word is zero.

◆ countTrailingOnes()

template<typename T >
unsigned wpi::countTrailingOnes ( Value,
ZeroBehavior  ZB = ZB_Width 
)

Count the number of ones from the least significant bit to the first zero bit.

Ex. countTrailingOnes(0x00FF00FF) == 8. Only unsigned integral types are allowed.

Parameters
ZBthe behavior on an input of all ones. Only ZB_Width and ZB_Undefined are valid arguments.

◆ countTrailingZeros()

template<typename T >
unsigned wpi::countTrailingZeros ( Val,
ZeroBehavior  ZB = ZB_Width 
)

Count number of 0's from the least significant bit to the most stopping at the first 1.

Only unsigned integral types are allowed.

Parameters
ZBthe behavior on an input of 0. Only ZB_Width and ZB_Undefined are valid arguments.

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

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

◆ djbHash()

uint32_t wpi::djbHash ( std::string_view  Buffer,
uint32_t  H = 5381 
)
inline

The Bernstein hash function used by the DWARF accelerator tables.

◆ DoubleToBits()

uint64_t wpi::DoubleToBits ( double  Double)
inline

This function takes a double and returns the bit equivalent 64-bit integer.

Note that copying doubles around changes the bits of NaNs on some hosts, notably x86, so this routine cannot be used if these bits are needed.

◆ drop_back() [1/2]

template<typename T >
constexpr std::span< T > wpi::drop_back ( std::span< T >  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 >
constexpr std::span< T > wpi::drop_front ( std::span< T >  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.

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

◆ findFirstSet()

template<typename T >
T wpi::findFirstSet ( Val,
ZeroBehavior  ZB = ZB_Max 
)

Get the index of the first set bit starting from the least significant bit.

Only unsigned integral types are allowed.

Parameters
ZBthe behavior on an input of 0. Only ZB_Max and ZB_Undefined are valid arguments.

◆ findLastSet()

template<typename T >
T wpi::findLastSet ( Val,
ZeroBehavior  ZB = ZB_Max 
)

Get the index of the last set bit starting from the least significant bit.

Only unsigned integral types are allowed.

Parameters
ZBthe behavior on an input of 0. Only ZB_Max and ZB_Undefined are valid arguments.

◆ FindMultipartBoundary()

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

◆ FloatToBits()

uint32_t wpi::FloatToBits ( float  Float)
inline

This function takes a float and returns the bit equivalent 32-bit integer.

Note that copying floats around changes the bits of NaNs on some hosts, notably x86, so this routine cannot be used if these bits are needed.

◆ 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

◆ greatestCommonDivisor()

template<typename T >
T wpi::greatestCommonDivisor ( A,
B 
)
inline

Return the greatest common divisor of the values using Euclid's algorithm.

◆ GreatestCommonDivisor64()

uint64_t wpi::GreatestCommonDivisor64 ( uint64_t  A,
uint64_t  B 
)
inline

◆ 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/5]

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/5]

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() [3/5]

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

Compute a hash_code for a tuple.

◆ hash_value() [4/5]

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() [5/5]

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

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

◆ isInt< 16 >()

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

◆ isInt< 32 >()

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

◆ isInt< 8 >()

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

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

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

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

◆ 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() [1/2]

template<unsigned N>
constexpr std::enable_if_t<(N< 64), bool > wpi::isUInt ( uint64_t  X)
inlineconstexpr

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

This is written as two functions rather than as simply

return N >= 64 || X < (UINT64_C(1) << N);

to keep MSVC from (incorrectly) warning on isUInt<64> that we're shifting left too many places.

◆ isUInt() [2/2]

constexpr bool wpi::isUInt ( uint64_t  )

◆ isUInt< 16 >()

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

◆ isUInt< 32 >()

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

◆ isUInt< 8 >()

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

◆ isUIntN()

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

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

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

double wpi::Log2 ( double  Value)
inline

Return the log base 2 of the specified 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.

◆ 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< T >::value, 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()

uint64_t wpi::NextPowerOf2 ( uint64_t  A)
inline

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

Returns zero on overflow.

◆ nulls()

raw_ostream & wpi::nulls ( )

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

◆ 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<() [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< OStream >::value && std::is_base_of< raw_ostream, OStream >::value, OStream && > wpi::operator<< ( OStream &&  OS,
const T &  Value 
)

Call the appropriate insertion operator, given an rvalue reference to a raw_ostream object and return a stream of the same type as the argument.

◆ 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";

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

◆ PowerOf2Floor()

uint64_t wpi::PowerOf2Floor ( uint64_t  A)
inline

Returns the power of two which is less than or equal to the given value.

Essentially, it is a floor operation across the domain of powers of two.

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

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

◆ 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 
)

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

template<typename T >
std::enable_if_t< std::is_unsigned< T >::value, 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.

◆ SaturatingMultiply()

template<typename T >
std::enable_if_t< std::is_unsigned< T >::value, 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< T >::value, 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.

◆ SetGetStackTraceImpl()

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

Set the implementation used by GetStackTrace().

Parameters
funcFunction called by GetStackTrace().

◆ 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< T >::value, 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()

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

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 >, CalculateSmallVectorDefaultInlinedElements< ValueTypeFromRangeType< R > >::value > wpi::to_vector ( 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.

◆ 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 
)

◆ utohexstr()

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

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

Variable Documentation

◆ BitReverseTable256

const unsigned char wpi::BitReverseTable256[256]
static
Initial value:
= {
#define R2(n)
#define R4(n)
#define R6(n)
R6(0), R6(2), R6(1), R6(3)
}
#define R6(n)

Macro compressed bit reversal table for 256 bits.

http://graphics.stanford.edu/~seander/bithacks.html#BitReverseTable

◆ empty_array

constexpr empty_array_t wpi::empty_array
constexpr

◆ huge_valf

const float wpi::huge_valf
extern

Use this rather than HUGE_VALF; the latter causes warnings on MSVC.

◆ in_place

constexpr in_place_t wpi::in_place
constexpr
Warning
This must not be odr-used, as it cannot be made inline in C++14.

◆ SmallVector

template<typename T , unsigned N>
class LLVM_GSL_OWNER wpi::SmallVector

Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference sizeof(SmallVector<T, 0>).