LLVM  9.0.0svn
Public Member Functions | List of all members
llvm::FileCheckNumericVariable Class Reference

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

#include "llvm/Support/FileCheck.h"

Public Member Functions

 FileCheckNumericVariable (StringRef Name, Optional< size_t > DefLineNumber=None)
 Constructor for a variable Name defined at line DefLineNumber or defined before input is parsed if DefLineNumber is None. More...
 
StringRef getName () const
 
Optional< uint64_t > getValue () const
 
void setValue (uint64_t Value)
 Sets value of this numeric variable, if undefined. More...
 
void clearValue ()
 Clears value of this numeric variable, regardless of whether it is currently defined or not. More...
 
Optional< size_tgetDefLineNumber ()
 

Detailed Description

Class representing a numeric variable and its associated current value.

Definition at line 92 of file FileCheck.h.

Constructor & Destructor Documentation

◆ FileCheckNumericVariable()

llvm::FileCheckNumericVariable::FileCheckNumericVariable ( StringRef  Name,
Optional< size_t DefLineNumber = None 
)
inline

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

Definition at line 108 of file FileCheck.h.

Member Function Documentation

◆ clearValue()

void FileCheckNumericVariable::clearValue ( )

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

Definition at line 32 of file FileCheck.cpp.

References llvm::None.

◆ getDefLineNumber()

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

Definition at line 128 of file FileCheck.h.

◆ getName()

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

Definition at line 113 of file FileCheck.h.

References Name.

Referenced by llvm::FileCheckPatternContext::defineCmdlineVariables().

◆ getValue()

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

Definition at line 116 of file FileCheck.h.

◆ setValue()

void FileCheckNumericVariable::setValue ( uint64_t  Value)

Sets value of this numeric variable, if undefined.

Triggers an assertion failure if the variable is actually defined.

Definition at line 27 of file FileCheck.cpp.

References assert().

Referenced by llvm::FileCheckPatternContext::defineCmdlineVariables().


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