CIRCT  19.0.0git
Public Member Functions | Private Attributes | List of all members
circt::pretty::TokenStringSaver Class Reference

PrettyPrinter::Listener that saves strings while live. More...

#include <PrettyPrinterHelpers.h>

Inheritance diagram for circt::pretty::TokenStringSaver:
Inheritance graph
Collaboration diagram for circt::pretty::TokenStringSaver:
Collaboration graph

Public Member Functions

 TokenStringSaver ()
StringRef save (StringRef str)
 Add string, save in storage. More...
void clear () override
 PrettyPrinter::Listener::clear – indicates no external refs. More...
- Public Member Functions inherited from circt::pretty::PrettyPrinter::Listener
virtual ~Listener ()
 Destructor, anchor. More...
virtual void print ()
 Listener for print event. More...

Private Attributes

llvm::BumpPtrAllocator alloc
llvm::StringSaver strings

Detailed Description

PrettyPrinter::Listener that saves strings while live.

Once they're no longer referenced, memory is reset. Allows differentiating between strings to save and external strings.

Definition at line 156 of file PrettyPrinterHelpers.h.

Constructor & Destructor Documentation

◆ TokenStringSaver()

circt::pretty::TokenStringSaver::TokenStringSaver ( )

Definition at line 161 of file PrettyPrinterHelpers.h.

Member Function Documentation

◆ clear()

void circt::pretty::TokenStringSaver::clear ( )

PrettyPrinter::Listener::clear – indicates no external refs.

Reimplemented from circt::pretty::PrettyPrinter::Listener.

Definition at line 26 of file PrettyPrinterHelpers.cpp.

References alloc.

◆ save()

StringRef circt::pretty::TokenStringSaver::save ( StringRef  str)

Add string, save in storage.

Definition at line 164 of file PrettyPrinterHelpers.h.

References strings.

Referenced by circt::pretty::TokenStream< PPTy >::operator<<().

Member Data Documentation

◆ alloc

llvm::BumpPtrAllocator circt::pretty::TokenStringSaver::alloc

Definition at line 157 of file PrettyPrinterHelpers.h.

Referenced by clear().

◆ strings

llvm::StringSaver circt::pretty::TokenStringSaver::strings

Definition at line 158 of file PrettyPrinterHelpers.h.

Referenced by save().

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