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

Simple wrapper observer that takes several observers, and calls each one for each event. More...

#include "llvm/CodeGen/GlobalISel/GISelChangeObserver.h"

Inheritance diagram for llvm::GISelObserverWrapper:
Inheritance graph
[legend]
Collaboration diagram for llvm::GISelObserverWrapper:
Collaboration graph
[legend]

Public Member Functions

 GISelObserverWrapper ()=default
 
 GISelObserverWrapper (ArrayRef< GISelChangeObserver *> Obs)
 
void addObserver (GISelChangeObserver *O)
 
void removeObserver (GISelChangeObserver *O)
 
void erasingInstr (MachineInstr &MI) override
 An instruction is about to be erased. More...
 
void createdInstr (MachineInstr &MI) override
 An instruction has been created and inserted into the function. More...
 
void changingInstr (MachineInstr &MI) override
 This instruction is about to be mutated in some way. More...
 
void changedInstr (MachineInstr &MI) override
 This instruction was mutated in some way. More...
 
void MF_HandleInsertion (MachineInstr &MI) override
 Callback after an insertion. This should not modify the MI directly. More...
 
void MF_HandleRemoval (MachineInstr &MI) override
 Callback before a removal. This should not modify the MI directly. More...
 
- Public Member Functions inherited from llvm::MachineFunction::Delegate
virtual ~Delegate ()=default
 
- Public Member Functions inherited from llvm::GISelChangeObserver
virtual ~GISelChangeObserver ()
 
void changingAllUsesOfReg (const MachineRegisterInfo &MRI, unsigned Reg)
 All the instructions using the given register are being changed. More...
 
void finishedChangingAllUsesOfReg ()
 All instructions reported as changing by changingAllUsesOfReg() have finished being changed. More...
 

Detailed Description

Simple wrapper observer that takes several observers, and calls each one for each event.

If there are multiple observers (say CSE, Legalizer, Combiner), it's sufficient to register this to the machine function as the delegate.

Definition at line 65 of file GISelChangeObserver.h.

Constructor & Destructor Documentation

◆ GISelObserverWrapper() [1/2]

llvm::GISelObserverWrapper::GISelObserverWrapper ( )
default

◆ GISelObserverWrapper() [2/2]

llvm::GISelObserverWrapper::GISelObserverWrapper ( ArrayRef< GISelChangeObserver *>  Obs)
inline

Definition at line 71 of file GISelChangeObserver.h.

Member Function Documentation

◆ addObserver()

void llvm::GISelObserverWrapper::addObserver ( GISelChangeObserver O)
inline

◆ changedInstr()

void llvm::GISelObserverWrapper::changedInstr ( MachineInstr MI)
inlineoverridevirtual

This instruction was mutated in some way.

Implements llvm::GISelChangeObserver.

Definition at line 95 of file GISelChangeObserver.h.

References llvm::RISCVFenceField::O.

◆ changingInstr()

void llvm::GISelObserverWrapper::changingInstr ( MachineInstr MI)
inlineoverridevirtual

This instruction is about to be mutated in some way.

Implements llvm::GISelChangeObserver.

Definition at line 91 of file GISelChangeObserver.h.

References llvm::RISCVFenceField::O.

◆ createdInstr()

void llvm::GISelObserverWrapper::createdInstr ( MachineInstr MI)
inlineoverridevirtual

An instruction has been created and inserted into the function.

Note that the instruction might not be a fully fledged instruction at this point and won't be if the MachineFunction::Delegate is calling it. This is because the delegate only sees the construction of the MachineInstr before operands have been added.

Implements llvm::GISelChangeObserver.

Definition at line 87 of file GISelChangeObserver.h.

References llvm::RISCVFenceField::O.

◆ erasingInstr()

void llvm::GISelObserverWrapper::erasingInstr ( MachineInstr MI)
inlineoverridevirtual

An instruction is about to be erased.

Implements llvm::GISelChangeObserver.

Definition at line 83 of file GISelChangeObserver.h.

References llvm::RISCVFenceField::O.

Referenced by llvm::Legalizer::runOnMachineFunction(), and llvm::LegalizationArtifactCombiner::tryCombineInstruction().

◆ MF_HandleInsertion()

void llvm::GISelObserverWrapper::MF_HandleInsertion ( MachineInstr MI)
inlineoverridevirtual

Callback after an insertion. This should not modify the MI directly.

Implements llvm::MachineFunction::Delegate.

Definition at line 100 of file GISelChangeObserver.h.

References llvm::GISelChangeObserver::createdInstr().

◆ MF_HandleRemoval()

void llvm::GISelObserverWrapper::MF_HandleRemoval ( MachineInstr MI)
inlineoverridevirtual

Callback before a removal. This should not modify the MI directly.

Implements llvm::MachineFunction::Delegate.

Definition at line 101 of file GISelChangeObserver.h.

References llvm::GISelChangeObserver::erasingInstr().

◆ removeObserver()

void llvm::GISelObserverWrapper::removeObserver ( GISelChangeObserver O)
inline

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