MLIR  19.0.0git
Public Member Functions | List of all members
mlir::pdll::ast::DeclScope Class Reference

This class represents a scope for named AST decls. More...

#include "mlir/Tools/PDLL/AST/Nodes.h"

Public Member Functions

 DeclScope (DeclScope *parent=nullptr)
 Create a new scope with an optional parent scope. More...
 
DeclScopegetParentScope ()
 Return the parent scope of this scope, or nullptr if there is no parent. More...
 
const DeclScopegetParentScope () const
 
auto getDecls () const
 Return all of the decls within this scope. More...
 
void add (Decl *decl)
 Add a new decl to the scope. More...
 
Decllookup (StringRef name)
 Lookup a decl with the given name starting from this scope. More...
 
template<typename T >
T * lookup (StringRef name)
 
const Decllookup (StringRef name) const
 
template<typename T >
const T * lookup (StringRef name) const
 

Detailed Description

This class represents a scope for named AST decls.

A scope determines the visibility and lifetime of a named declaration.

Definition at line 64 of file Nodes.h.

Constructor & Destructor Documentation

◆ DeclScope()

mlir::pdll::ast::DeclScope::DeclScope ( DeclScope parent = nullptr)
inline

Create a new scope with an optional parent scope.

Definition at line 67 of file Nodes.h.

Member Function Documentation

◆ add()

void DeclScope::add ( Decl decl)

Add a new decl to the scope.

Definition at line 175 of file Nodes.cpp.

References mlir::pdll::ast::Name::getName(), and mlir::pdll::ast::Decl::getName().

◆ getDecls()

auto mlir::pdll::ast::DeclScope::getDecls ( ) const
inline

Return all of the decls within this scope.

Definition at line 74 of file Nodes.h.

◆ getParentScope() [1/2]

DeclScope* mlir::pdll::ast::DeclScope::getParentScope ( )
inline

Return the parent scope of this scope, or nullptr if there is no parent.

Definition at line 70 of file Nodes.h.

◆ getParentScope() [2/2]

const DeclScope* mlir::pdll::ast::DeclScope::getParentScope ( ) const
inline

Definition at line 71 of file Nodes.h.

◆ lookup() [1/4]

Decl * DeclScope::lookup ( StringRef  name)

Lookup a decl with the given name starting from this scope.

Returns nullptr if no decl could be found.

Definition at line 182 of file Nodes.cpp.

References lookup().

Referenced by lookup().

◆ lookup() [2/4]

template<typename T >
T* mlir::pdll::ast::DeclScope::lookup ( StringRef  name)
inline

Definition at line 83 of file Nodes.h.

References lookup().

◆ lookup() [3/4]

const Decl* mlir::pdll::ast::DeclScope::lookup ( StringRef  name) const
inline

Definition at line 86 of file Nodes.h.

References lookup().

◆ lookup() [4/4]

template<typename T >
const T* mlir::pdll::ast::DeclScope::lookup ( StringRef  name) const
inline

Definition at line 90 of file Nodes.h.

References lookup().


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