Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Friends | List of all members
SVF::SVFBasicBlock Class Reference

#include <SVFValue.h>

Inheritance diagram for SVF::SVFBasicBlock:
SVF::SVFValue

Public Types

typedef std::vector< constICFGNode * >::const_iterator const_iterator
 
- Public Types inherited from SVF::SVFValue
enum  SVFValKind {
  SVFVal , SVFFunc , SVFBB , SVFInst ,
  SVFCall , SVFVCall , SVFGlob , SVFArg ,
  SVFConst , SVFConstData , SVFConstInt , SVFConstFP ,
  SVFNullPtr , SVFBlackHole , SVFMetaAsValue , SVFOther
}
 
typedef s64_t GNodeK
 

Public Member Functions

 SVFBasicBlock (const SVFType *ty, const SVFFunction *f)
 Constructor without name.
 
 SVFBasicBlock ()=delete
 
 ~SVFBasicBlock () override
 
const std::vector< const ICFGNode * > & getICFGNodeList () const
 
const_iterator begin () const
 
const_iterator end () const
 
const SVFFunctiongetParent () const
 
const SVFFunctiongetFunction () const
 
const ICFGNodefront () const
 
const ICFGNodeback () const
 
const std::vector< const SVFBasicBlock * > & getSuccessors () const
 
const std::vector< const SVFBasicBlock * > & getPredecessors () const
 
u32_t getNumSuccessors () const
 
u32_t getBBSuccessorPos (const SVFBasicBlock *succbb)
 
u32_t getBBSuccessorPos (const SVFBasicBlock *succbb) const
 
u32_t getBBPredecessorPos (const SVFBasicBlock *succbb)
 
u32_t getBBPredecessorPos (const SVFBasicBlock *succbb) const
 
- Public Member Functions inherited from SVF::SVFValue
 SVFValue ()=delete
 
virtual ~SVFValue ()=default
 
GNodeK getKind () const
 Get the type of this SVFValue.
 
const std::string & getName () const
 
void setName (const std::string &n)
 
void setName (std::string &&n)
 
virtual const SVFTypegetType () const
 
bool isConstDataOrAggData () const
 
bool ptrInUncalledFunction () const
 
bool isblackHole () const
 
bool isNullPtr () const
 
virtual void setSourceLoc (const std::string &sourceCodeInfo)
 
virtual const std::string getSourceLoc () const
 
std::string toString () const
 Needs to be implemented by a SVF front end.
 

Static Public Member Functions

static bool classof (const SVFValue *node)
 

Protected Member Functions

void addICFGNode (const ICFGNode *icfgNode)
 Function where this BasicBlock is.
 
void addSuccBasicBlock (const SVFBasicBlock *succ)
 
void addPredBasicBlock (const SVFBasicBlock *pred)
 
- Protected Member Functions inherited from SVF::SVFValue
 SVFValue (const SVFType *ty, SVFValKind k)
 Constructor without name.
 
void setConstDataOrAggData ()
 
void setPtrInUncalledFunction ()
 

Private Attributes

std::vector< const ICFGNode * > allICFGNodes
 all ICFGNodes in this BasicBlock
 
std::vector< const SVFBasicBlock * > succBBs
 all successor BasicBlocks of this BasicBlock
 
std::vector< const SVFBasicBlock * > predBBs
 all predecessor BasicBlocks of this BasicBlock
 
const SVFFunctionfun
 

Friends

class LLVMModuleSet
 
class SVFIRWriter
 
class SVFIRReader
 
class SVFIRBuilder
 
class SVFFunction
 
class ICFGBuilder
 
class ICFG
 

Additional Inherited Members

- Protected Attributes inherited from SVF::SVFValue
const SVFTypetype
 Type of this SVFValue.
 
std::string name
 Short name of value for printing & debugging.
 
std::string sourceLoc
 

Detailed Description

Definition at line 529 of file SVFValue.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 540 of file SVFValue.h.

Constructor & Destructor Documentation

◆ SVFBasicBlock() [1/2]

SVFBasicBlock::SVFBasicBlock ( const SVFType ty,
const SVFFunction f 
)

Constructor without name.

Definition at line 199 of file SVFValue.cpp.

201{
202}
const SVFFunction * fun
Definition SVFValue.h:546
SVFValue()=delete
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ SVFBasicBlock() [2/2]

SVF::SVFBasicBlock::SVFBasicBlock ( )
delete

◆ ~SVFBasicBlock()

SVFBasicBlock::~SVFBasicBlock ( )
override

Definition at line 204 of file SVFValue.cpp.

205{
206
207}

Member Function Documentation

◆ addICFGNode()

void SVF::SVFBasicBlock::addICFGNode ( const ICFGNode icfgNode)
inlineprotected

Function where this BasicBlock is.

attributes to be set only through Module builders e.g., LLVMModule

Definition at line 551 of file SVFValue.h.

552 {
554 icfgNode) == getICFGNodeList().end() && "duplicated icfgnode");
555 allICFGNodes.push_back(icfgNode);
556 }
const std::vector< const ICFGNode * > & getICFGNodeList() const
Definition SVFValue.h:580
std::vector< const ICFGNode * > allICFGNodes
all ICFGNodes in this BasicBlock
Definition SVFValue.h:543
const_iterator end() const
Definition SVFValue.h:590
const_iterator begin() const
Definition SVFValue.h:585

◆ addPredBasicBlock()

void SVF::SVFBasicBlock::addPredBasicBlock ( const SVFBasicBlock pred)
inlineprotected

Definition at line 563 of file SVFValue.h.

564 {
565 predBBs.push_back(pred);
566 }
std::vector< const SVFBasicBlock * > predBBs
all predecessor BasicBlocks of this BasicBlock
Definition SVFValue.h:545

◆ addSuccBasicBlock()

void SVF::SVFBasicBlock::addSuccBasicBlock ( const SVFBasicBlock succ)
inlineprotected

Definition at line 558 of file SVFValue.h.

559 {
560 succBBs.push_back(succ);
561 }
std::vector< const SVFBasicBlock * > succBBs
all successor BasicBlocks of this BasicBlock
Definition SVFValue.h:544

◆ back()

const ICFGNode * SVF::SVFBasicBlock::back ( ) const
inline

Definition at line 611 of file SVFValue.h.

612 {
613 assert(!allICFGNodes.empty() && "bb empty?");
614 return allICFGNodes.back();
615 }

◆ begin()

const_iterator SVF::SVFBasicBlock::begin ( ) const
inline

Definition at line 585 of file SVFValue.h.

586 {
587 return allICFGNodes.begin();
588 }

◆ classof()

static bool SVF::SVFBasicBlock::classof ( const SVFValue node)
inlinestatic

Definition at line 575 of file SVFValue.h.

576 {
577 return node->getKind() == SVFBB;
578 }

◆ end()

const_iterator SVF::SVFBasicBlock::end ( ) const
inline

Definition at line 590 of file SVFValue.h.

591 {
592 return allICFGNodes.end();
593 }

◆ front()

const ICFGNode * SVF::SVFBasicBlock::front ( ) const
inline

Definition at line 605 of file SVFValue.h.

606 {
607 assert(!allICFGNodes.empty() && "bb empty?");
608 return allICFGNodes.front();
609 }

◆ getBBPredecessorPos() [1/2]

u32_t SVFBasicBlock::getBBPredecessorPos ( const SVFBasicBlock succbb)

Return a position index from current bb to it successor bb

Definition at line 241 of file SVFValue.cpp.

242{
243 u32_t pos = 0;
245 {
246 if(PredBB == this)
247 return pos;
248 ++pos;
249 }
250 assert(false && "Didn't find predecessor edge?");
251 return pos;
252}
unsigned u32_t
Definition CommandLine.h:18
const std::vector< const SVFBasicBlock * > & getPredecessors() const
Definition SVFValue.h:622

◆ getBBPredecessorPos() [2/2]

u32_t SVFBasicBlock::getBBPredecessorPos ( const SVFBasicBlock succbb) const

Definition at line 253 of file SVFValue.cpp.

254{
255 u32_t pos = 0;
257 {
258 if(PredBB == this)
259 return pos;
260 ++pos;
261 }
262 assert(false && "Didn't find predecessor edge?");
263 return pos;
264}

◆ getBBSuccessorPos() [1/2]

u32_t SVFBasicBlock::getBBSuccessorPos ( const SVFBasicBlock Succ)

Get position of a successor basic block

Definition at line 212 of file SVFValue.cpp.

213{
214 u32_t i = 0;
215 for (const SVFBasicBlock* SuccBB: succBBs)
216 {
217 if (SuccBB == Succ)
218 return i;
219 i++;
220 }
221 assert(false && "Didn't find successor edge?");
222 return 0;
223}

◆ getBBSuccessorPos() [2/2]

u32_t SVFBasicBlock::getBBSuccessorPos ( const SVFBasicBlock succbb) const

Definition at line 225 of file SVFValue.cpp.

226{
227 u32_t i = 0;
228 for (const SVFBasicBlock* SuccBB: succBBs)
229 {
230 if (SuccBB == Succ)
231 return i;
232 i++;
233 }
234 assert(false && "Didn't find successor edge?");
235 return 0;
236}

◆ getFunction()

const SVFFunction * SVF::SVFBasicBlock::getFunction ( ) const
inline

Definition at line 600 of file SVFValue.h.

601 {
602 return fun;
603 }

◆ getICFGNodeList()

const std::vector< const ICFGNode * > & SVF::SVFBasicBlock::getICFGNodeList ( ) const
inline

Definition at line 580 of file SVFValue.h.

581 {
582 return allICFGNodes;
583 }

◆ getNumSuccessors()

u32_t SVF::SVFBasicBlock::getNumSuccessors ( ) const
inline

Definition at line 626 of file SVFValue.h.

627 {
628 return succBBs.size();
629 }

◆ getParent()

const SVFFunction * SVF::SVFBasicBlock::getParent ( ) const
inline

Definition at line 595 of file SVFValue.h.

596 {
597 return fun;
598 }

◆ getPredecessors()

const std::vector< const SVFBasicBlock * > & SVF::SVFBasicBlock::getPredecessors ( ) const
inline

Definition at line 622 of file SVFValue.h.

623 {
624 return predBBs;
625 }

◆ getSuccessors()

const std::vector< const SVFBasicBlock * > & SVF::SVFBasicBlock::getSuccessors ( ) const
inline

Definition at line 617 of file SVFValue.h.

618 {
619 return succBBs;
620 }

Friends And Related Symbol Documentation

◆ ICFG

friend class ICFG
friend

Definition at line 537 of file SVFValue.h.

◆ ICFGBuilder

Definition at line 536 of file SVFValue.h.

◆ LLVMModuleSet

Definition at line 531 of file SVFValue.h.

◆ SVFFunction

Definition at line 535 of file SVFValue.h.

◆ SVFIRBuilder

Definition at line 534 of file SVFValue.h.

◆ SVFIRReader

Definition at line 533 of file SVFValue.h.

◆ SVFIRWriter

Definition at line 532 of file SVFValue.h.

Member Data Documentation

◆ allICFGNodes

std::vector<const ICFGNode*> SVF::SVFBasicBlock::allICFGNodes
private

all ICFGNodes in this BasicBlock

Definition at line 543 of file SVFValue.h.

◆ fun

const SVFFunction* SVF::SVFBasicBlock::fun
private

Definition at line 546 of file SVFValue.h.

◆ predBBs

std::vector<const SVFBasicBlock*> SVF::SVFBasicBlock::predBBs
private

all predecessor BasicBlocks of this BasicBlock

Definition at line 545 of file SVFValue.h.

◆ succBBs

std::vector<const SVFBasicBlock*> SVF::SVFBasicBlock::succBBs
private

all successor BasicBlocks of this BasicBlock

Definition at line 544 of file SVFValue.h.


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