LLVM  13.0.0git
Public Member Functions | List of all members
llvm::NumericVariable Class Reference

Class representing a numeric variable and its associated current value. More...

#include "FileCheck/FileCheckImpl.h"

Public Member Functions

 NumericVariable (StringRef Name, ExpressionFormat ImplicitFormat, Optional< size_t > DefLineNumber=None)
 Constructor for a variable Name with implicit format ImplicitFormat defined at line DefLineNumber or defined before input is parsed if DefLineNumber is None. More...
 
StringRef getName () const
 
ExpressionFormat getImplicitFormat () const
 
Optional< ExpressionValuegetValue () const
 
Optional< StringRefgetStringValue () const
 
void setValue (ExpressionValue NewValue, Optional< StringRef > NewStrValue=None)
 Sets value of this numeric variable to NewValue, and sets the input buffer string from which it was parsed to NewStrValue. More...
 
void clearValue ()
 Clears value of this numeric variable, regardless of whether it is currently defined or not. More...
 
Optional< size_tgetDefLineNumber () const
 

Detailed Description

Class representing a numeric variable and its associated current value.

Definition at line 259 of file FileCheckImpl.h.

Constructor & Destructor Documentation

◆ NumericVariable()

llvm::NumericVariable::NumericVariable ( StringRef  Name,
ExpressionFormat  ImplicitFormat,
Optional< size_t DefLineNumber = None 
)
inlineexplicit

Constructor for a variable Name with implicit format ImplicitFormat defined at line DefLineNumber or defined before input is parsed if DefLineNumber is None.

Definition at line 284 of file FileCheckImpl.h.

Member Function Documentation

◆ clearValue()

void llvm::NumericVariable::clearValue ( )
inline

Clears value of this numeric variable, regardless of whether it is currently defined or not.

Definition at line 316 of file FileCheckImpl.h.

References llvm::None.

◆ getDefLineNumber()

Optional<size_t> llvm::NumericVariable::getDefLineNumber ( ) const
inline
Returns
the line number where this variable is defined, if any, or None if defined before input is parsed.

Definition at line 323 of file FileCheckImpl.h.

◆ getImplicitFormat()

ExpressionFormat llvm::NumericVariable::getImplicitFormat ( ) const
inline
Returns
implicit format of this numeric variable.

Definition at line 293 of file FileCheckImpl.h.

Referenced by llvm::NumericVariableUse::getImplicitFormat().

◆ getName()

StringRef llvm::NumericVariable::getName ( ) const
inline
Returns
name of this numeric variable.

Definition at line 290 of file FileCheckImpl.h.

◆ getStringValue()

Optional<StringRef> llvm::NumericVariable::getStringValue ( ) const
inline
Returns
the input buffer's string from which this variable's value was parsed, or None 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 303 of file FileCheckImpl.h.

◆ getValue()

Optional<ExpressionValue> llvm::NumericVariable::getValue ( ) const
inline
Returns
this variable's value.

Definition at line 296 of file FileCheckImpl.h.

Referenced by llvm::NumericVariableUse::eval().

◆ setValue()

void llvm::NumericVariable::setValue ( ExpressionValue  NewValue,
Optional< StringRef NewStrValue = None 
)
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 None.

Definition at line 308 of file FileCheckImpl.h.


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