LLVM 20.0.0git
Static Public Member Functions | List of all members
llvm::format_provider< T, std::enable_if_t< support::detail::use_pointer_formatter< T >::value > > Struct Template Reference

Implementation of format_provider<T> for integral pointer types. More...

#include "llvm/Support/FormatProviders.h"

Inheritance diagram for llvm::format_provider< T, std::enable_if_t< support::detail::use_pointer_formatter< T >::value > >:
Inheritance graph
[legend]

Static Public Member Functions

static void format (const T &V, llvm::raw_ostream &Stream, StringRef Style)
 

Additional Inherited Members

- Static Protected Member Functions inherited from llvm::support::detail::HelperFunctions
static std::optional< size_t > parseNumericPrecision (StringRef Str)
 
static std::optional< HexPrintStyleconsumeHexStyle (StringRef &Str)
 
static size_t consumeNumHexDigits (StringRef &Str, HexPrintStyle Style, size_t Default)
 

Detailed Description

template<typename T>
struct llvm::format_provider< T, std::enable_if_t< support::detail::use_pointer_formatter< T >::value > >

Implementation of format_provider<T> for integral pointer types.

The options string of a pointer type has the grammar:

pointer_options :: [style][precision] style :: digits :: <non-negative integer> 0-sizeof(void*)


| S | Meaning | Example |

| | | Input | Output |

| x- | Hex no prefix, lower | 0xDEADBEEF | deadbeef | | X- | Hex no prefix, upper | 0xDEADBEEF | DEADBEEF | | x+ / x | Hex + prefix, lower | 0xDEADBEEF | 0xdeadbeef | | X+ / X | Hex + prefix, upper | 0xDEADBEEF | 0xDEADBEEF |

| (empty) | Same as X+ / X | | |

The default precision is the number of nibbles in a machine word, and in all cases indicates the minimum number of nibbles to print.

Definition at line 177 of file FormatProviders.h.

Member Function Documentation

◆ format()

template<typename T >
static void llvm::format_provider< T, std::enable_if_t< support::detail::use_pointer_formatter< T >::value > >::format ( const T V,
llvm::raw_ostream Stream,
StringRef  Style 
)
inlinestatic

Definition at line 182 of file FormatProviders.h.

References llvm::PrefixUpper, and llvm::write_hex().


The documentation for this struct was generated from the following file: