LLVM: llvm::NumericVariable Class Reference (original) (raw)
Class representing a numeric variable and its associated current value. More...
#include "[FileCheck/FileCheckImpl.h](FileCheckImpl%5F8h%5Fsource.html)"
Public Member Functions | |
---|---|
NumericVariable (StringRef Name, ExpressionFormat ImplicitFormat, std::optional< size_t > DefLineNumber=std::nullopt) | |
Constructor for a variable Name with implicit format ImplicitFormat defined at line DefLineNumber or defined before input is parsed if DefLineNumber is std::nullopt. | |
StringRef | getName () const |
ExpressionFormat | getImplicitFormat () const |
std::optional< APInt > | getValue () const |
std::optional< StringRef > | getStringValue () const |
void | setValue (APInt NewValue, std::optional< StringRef > NewStrValue=std::nullopt) |
Sets value of this numeric variable to NewValue, and sets the input buffer string from which it was parsed to NewStrValue. | |
void | clearValue () |
Clears value of this numeric variable, regardless of whether it is currently defined or not. | |
std::optional< size_t > | getDefLineNumber () const |
Class representing a numeric variable and its associated current value.
Definition at line 211 of file FileCheckImpl.h.
llvm::NumericVariable::NumericVariable ( StringRef Name, ExpressionFormat ImplicitFormat, std::optional< size_t > DefLineNumber = std::nullopt ) | inlineexplicit |
---|
Constructor for a variable Name
with implicit format ImplicitFormat
defined at line DefLineNumber
or defined before input is parsed if DefLineNumber
is std::nullopt.
Definition at line 236 of file FileCheckImpl.h.
◆ clearValue()
void llvm::NumericVariable::clearValue ( ) | inline |
---|
Clears value of this numeric variable, regardless of whether it is currently defined or not.
Definition at line 268 of file FileCheckImpl.h.
◆ getDefLineNumber()
std::optional< size_t > llvm::NumericVariable::getDefLineNumber ( ) const | inline |
---|
Returns
the line number where this variable is defined, if any, or std::nullopt if defined before input is parsed.
Definition at line 275 of file FileCheckImpl.h.
◆ getImplicitFormat()
◆ getName()
StringRef llvm::NumericVariable::getName ( ) const | inline |
---|
◆ getStringValue()
std::optional< StringRef > llvm::NumericVariable::getStringValue ( ) const | inline |
---|
Returns
the input buffer's string from which this variable's value was parsed, or std::nullopt if the value is not yet defined or was not parsed from the input buffer. For example, the value of @LINE is not parsed from the input buffer, and some numeric variables are parsed from the command line instead.
Definition at line 255 of file FileCheckImpl.h.
◆ getValue()
std::optional< APInt > llvm::NumericVariable::getValue ( ) const | inline |
---|
◆ setValue()
void llvm::NumericVariable::setValue ( APInt NewValue, std::optional< StringRef > NewStrValue = std::nullopt ) | inline |
---|
Sets value of this numeric variable to NewValue
, and sets the input buffer string from which it was parsed to NewStrValue
.
See comments on getStringValue for a discussion of when the latter can be std::nullopt.
Definition at line 260 of file FileCheckImpl.h.
Referenced by llvm::Pattern::match().
The documentation for this class was generated from the following file:
- lib/FileCheck/FileCheckImpl.h