Ghidra 11.3.2
Ghidra internal decompiler documentation.
Loading...
Searching...
No Matches
ghidra::PcodeOpSet Class Referenceabstract

A set of PcodeOps that can be tested for Cover intersections. More...

#include <cover.hh>

Inheritance diagram for ghidra::PcodeOpSet:
[legend]
Collaboration diagram for ghidra::PcodeOpSet:
[legend]

Public Member Functions

bool isPopulated (void) const
 Return true if this set is populated.
 
virtual void populate (void)=0
 Populate the PcodeOp object in this set.
 
virtual bool affectsTest (PcodeOp *op, Varnode *vn) const =0
 (Secondary) test that the given PcodeOp affects the Varnode
 
void clear (void)
 Clear all PcodeOps in this.
 

Static Public Member Functions

static bool compareByBlock (const PcodeOp *a, const PcodeOp *b)
 Compare PcodeOps for this set.
 

Protected Member Functions

void addOp (PcodeOp *op)
 Add a PcodeOp into the set.
 
void finalize (void)
 Sort ops in the set into blocks.
 

Private Attributes

vector< PcodeOp * > opList
 Ops in this set, sorted on block index, then SeqNum::order.
 
vector< int4 > blockStart
 Index of first op in each non-empty block.
 
bool is_pop
 Has the populate() method been called.
 

Friends

class Cover
 

Detailed Description

A set of PcodeOps that can be tested for Cover intersections.

This is a set of PcodeOp objects, designed for quick intersection tests with a Cover. The set is lazily constructed via its populate() method at the time the first intersection test is needed. Once an intersection has been established between a PcodeOp in this set and a Varnode Cover, affectsTest() can do secondary testing to determine if the intersection should prevent merging.

Member Function Documentation

◆ affectsTest()

virtual bool ghidra::PcodeOpSet::affectsTest ( PcodeOp op,
Varnode vn 
) const
pure virtual

(Secondary) test that the given PcodeOp affects the Varnode

This method is called after an intersection of a PcodeOp in this set with a Varnode Cover has been determined. This allows the owner to make a final determination if merging should be prevented.

Parameters
opis the PcodeOp that intersects with the Varnode Cover
vnis the Varnode whose Cover is intersected
Returns
true if merging should be prevented

Implemented in ghidra::StackAffectingOps.

Referenced by ghidra::Cover::intersect().

◆ compareByBlock()

bool ghidra::PcodeOpSet::compareByBlock ( const PcodeOp a,
const PcodeOp b 
)
static

Compare PcodeOps for this set.

Compare first by index of the containing basic blocks, then by SeqNum ordering (within the block)

Parameters
ais the first PcodeOp to compare
bis the second PcodeOp to compare
Returns
true if the first PcodeOp should be ordered before the second

References ghidra::FlowBlock::getIndex(), ghidra::SeqNum::getOrder(), ghidra::PcodeOp::getParent(), and ghidra::PcodeOp::getSeqNum().

Referenced by finalize().

◆ populate()

virtual void ghidra::PcodeOpSet::populate ( void  )
pure virtual

Populate the PcodeOp object in this set.

Call-back to the owner to lazily add PcodeOps to this set. The override method calls addOp() for each PcodeOp it wants to add, then calls finalize() to make this set ready for intersection tests.

Implemented in ghidra::StackAffectingOps.


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