MLIR  19.0.0git
Public Types | Public Member Functions | List of all members
mlir::sparse_tensor::ir_detail::VarInfo Class Referencefinal

A record of metadata for/about a variable, used by VarEnv. More...

#include "Dialect/SparseTensor/IR/Detail/Var.h"

Public Types

enum class  ID : unsigned
 Newtype for unique identifiers of VarInfo records, to ensure they aren't confused with Var::Num. More...
 

Public Member Functions

constexpr VarInfo (ID id, StringRef name, llvm::SMLoc loc, VarKind vk, std::optional< Var::Num > n={})
 
constexpr StringRef getName () const
 
constexpr llvm::SMLoc getLoc () const
 
Location getLocation (AsmParser &parser) const
 
constexpr ID getID () const
 
constexpr VarKind getKind () const
 
constexpr std::optional< Var::NumgetNum () const
 
constexpr bool hasNum () const
 
void setNum (Var::Num n)
 
constexpr Var getVar () const
 

Detailed Description

A record of metadata for/about a variable, used by VarEnv.

The principal goal of this record is to enable VarEnv to be used for incremental parsing; in particular, VarInfo allows the Var::Num to remain unknown, since each record is instead identified by VarInfo::ID. Therefore the VarEnv can freely allocate VarInfo::ID in whatever order it likes, irrespective of the binding order (Var::Num) of the associated variable.

Definition at line 275 of file Var.h.

Member Enumeration Documentation

◆ ID

Newtype for unique identifiers of VarInfo records, to ensure they aren't confused with Var::Num.

Definition at line 279 of file Var.h.

Constructor & Destructor Documentation

◆ VarInfo()

constexpr mlir::sparse_tensor::ir_detail::VarInfo::VarInfo ( ID  id,
StringRef  name,
llvm::SMLoc  loc,
VarKind  vk,
std::optional< Var::Num n = {} 
)
inlineconstexpr

Definition at line 289 of file Var.h.

Member Function Documentation

◆ getID()

constexpr ID mlir::sparse_tensor::ir_detail::VarInfo::getID ( ) const
inlineconstexpr

Definition at line 303 of file Var.h.

◆ getKind()

constexpr VarKind mlir::sparse_tensor::ir_detail::VarInfo::getKind ( ) const
inlineconstexpr

Definition at line 304 of file Var.h.

Referenced by isUsageConsistent().

◆ getLoc()

constexpr llvm::SMLoc mlir::sparse_tensor::ir_detail::VarInfo::getLoc ( ) const
inlineconstexpr

Definition at line 299 of file Var.h.

◆ getLocation()

Location mlir::sparse_tensor::ir_detail::VarInfo::getLocation ( AsmParser parser) const
inline

Definition at line 300 of file Var.h.

References mlir::AsmParser::getEncodedSourceLoc().

◆ getName()

constexpr StringRef mlir::sparse_tensor::ir_detail::VarInfo::getName ( ) const
inlineconstexpr

Definition at line 298 of file Var.h.

◆ getNum()

constexpr std::optional<Var::Num> mlir::sparse_tensor::ir_detail::VarInfo::getNum ( ) const
inlineconstexpr

Definition at line 305 of file Var.h.

◆ getVar()

constexpr Var mlir::sparse_tensor::ir_detail::VarInfo::getVar ( ) const
inlineconstexpr

Definition at line 308 of file Var.h.

References hasNum().

Referenced by mlir::sparse_tensor::ir_detail::VarEnv::getVar().

◆ hasNum()

constexpr bool mlir::sparse_tensor::ir_detail::VarInfo::hasNum ( ) const
inlineconstexpr

Definition at line 306 of file Var.h.

Referenced by getVar(), and setNum().

◆ setNum()

void VarInfo::setNum ( Var::Num  n)

Definition at line 134 of file Var.cpp.

References hasNum(), and mlir::sparse_tensor::ir_detail::Var::isWF_Num().


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