LLVM: llvm::ExpressionFormat Struct Reference (original) (raw)

Type representing the format an expression value should be textualized into for matching. More...

#include "[FileCheck/FileCheckImpl.h](FileCheckImpl%5F8h%5Fsource.html)"

Public Types
enum class Kind { NoFormat, Unsigned, Signed, HexUpper, HexLower }
Public Member Functions
operator bool () const
Evaluates a format to true if it can be used in a match.
bool operator== (const ExpressionFormat &Other) const
Define format equality: formats are equal if neither is NoFormat and their kinds and precision are the same.
bool operator!= (const ExpressionFormat &Other) const
bool operator== (Kind OtherValue) const
bool operator!= (Kind OtherValue) const
StringRef toString () const
ExpressionFormat ()=default
ExpressionFormat (Kind Value)
ExpressionFormat (Kind Value, unsigned Precision)
ExpressionFormat (Kind Value, unsigned Precision, bool AlternateForm)
LLVM_ABI_FOR_TEST Expected< std::string > getWildcardRegex () const
LLVM_ABI_FOR_TEST Expected< std::string > getMatchingString (APInt Value) const
LLVM_ABI_FOR_TEST APInt valueFromStringRepr (StringRef StrVal, const SourceMgr &SM) const

Type representing the format an expression value should be textualized into for matching.

Used to represent both explicit format specifiers as well as implicit format from using numeric variables.

Definition at line 39 of file FileCheckImpl.h.

Kind

Enumerator
NoFormat Denote absence of format. Used for implicit format of literals and empty expressions.
Unsigned Value is an unsigned integer and should be printed as a decimal number.
Signed Value is a signed integer and should be printed as a decimal number.
HexUpper Value should be printed as an uppercase hex number.
HexLower Value should be printed as a lowercase hex number.

Definition at line 40 of file FileCheckImpl.h.

llvm::ExpressionFormat::ExpressionFormat ( ) default

ExpressionFormat() [2/4]

llvm::ExpressionFormat::ExpressionFormat ( Kind Value) inlineexplicit

ExpressionFormat() [3/4]

llvm::ExpressionFormat::ExpressionFormat ( Kind Value, unsigned Precision ) inlineexplicit

ExpressionFormat() [4/4]

llvm::ExpressionFormat::ExpressionFormat ( Kind Value, unsigned Precision, bool AlternateForm ) inlineexplicit

getMatchingString()

Expected< std::string > ExpressionFormat::getMatchingString ( APInt Value ) const

Returns

the string representation of [Value](classllvm%5F1%5F1Value.html "LLVM Value Representation.") in the format represented by this instance, or an error if conversion to this format failed or the format is NoFormat.

Definition at line 80 of file FileCheck.cpp.

References llvm::APInt::abs(), llvm::createStringError(), HexLower, HexUpper, llvm::APInt::isNegative(), llvm::make_error(), Signed, llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::APInt::toString(), and Unsigned.

getWildcardRegex()

Expected< std::string > ExpressionFormat::getWildcardRegex ( ) const

operator bool()

llvm::ExpressionFormat::operator bool ( ) const inlineexplicit

operator!=() [1/2]

operator!=() [2/2]

bool llvm::ExpressionFormat::operator!= ( Kind OtherValue) const inline

operator==() [1/2]

Define format equality: formats are equal if neither is NoFormat and their kinds and precision are the same.

Definition at line 66 of file FileCheckImpl.h.

References ExpressionFormat(), NoFormat, and llvm::Other.

operator==() [2/2]

bool llvm::ExpressionFormat::operator== ( Kind OtherValue) const inline

toString()

StringRef ExpressionFormat::toString ( ) const

valueFromStringRepr()


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