class NumericVariable

Declaration

class NumericVariable { /* full declaration omitted */ };

Description

Class representing a numeric variable and its associated current value.

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:259

Member Variables

private llvm::StringRef Name
Name of the numeric variable.
private llvm::ExpressionFormat ImplicitFormat
Format to use for expressions using this variable without an explicit format.
private Optional<llvm::ExpressionValue> Value
Value of numeric variable, if defined, or None otherwise.
private Optional<llvm::StringRef> StrValue
The input buffer's string from which Value was parsed, or None. See comments on getStringValue for a discussion of the None case.
private Optional<size_t> DefLineNumber
Line number where this variable is defined, or None if defined before input is parsed. Used to determine whether a variable is defined on the same line as a given use.

Method Overview

  • public NumericVariable(llvm::StringRef Name, llvm::ExpressionFormat ImplicitFormat, Optional<size_t> DefLineNumber = None)
  • public void clearValue()
  • public Optional<size_t> getDefLineNumber() const
  • public llvm::ExpressionFormat getImplicitFormat() const
  • public llvm::StringRef getName() const
  • public Optional<llvm::StringRef> getStringValue() const
  • public Optional<llvm::ExpressionValue> getValue() const
  • public void setValue(llvm::ExpressionValue NewValue, Optional<llvm::StringRef> NewStrValue = None)

Methods

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

Description

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

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:284

Parameters

llvm::StringRef Name
llvm::ExpressionFormat ImplicitFormat
Optional<size_t> DefLineNumber = None

void clearValue()

Description

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

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:316

Optional<size_t> getDefLineNumber() const

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:323

Returns

the line number where this variable is defined, if any, or None if defined before input is parsed.

llvm::ExpressionFormat getImplicitFormat() const

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:293

Returns

implicit format of this numeric variable.

llvm::StringRef getName() const

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:290

Returns

name of this numeric variable.

Optional<llvm::StringRef> getStringValue() const

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:303

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 @LINEis not parsed from the input buffer, and some numeric variables are parsed from the command line instead.

Optional<llvm::ExpressionValue> getValue() const

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:296

Returns

this variable's value.

void setValue(
    llvm::ExpressionValue NewValue,
    Optional<llvm::StringRef> NewStrValue = None)

Description

Sets value of this numeric variable to \p NewValue, and sets the input buffer string from which it was parsed to \p NewStrValue. See comments on getStringValue for a discussion of when the latter can be None.

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:308

Parameters

llvm::ExpressionValue NewValue
Optional<llvm::StringRef> NewStrValue = None