Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVF::SVFBugEvent Class Reference

#include <SVFBugReport.h>

Public Types

enum  EventType {
  Branch = 0x1 , Caller = 0x2 , CallSite = 0x3 , Loop = 0x4 ,
  SourceInst = 0x5
}

Public Member Functions

 SVFBugEvent (u32_t typeAndInfoFlag, const ICFGNode *eventInst)
virtual ~SVFBugEvent ()=default
u32_t getEventType () const
virtual const std::string getEventDescription () const
virtual const std::string getFuncName () const
virtual const std::string getEventLoc () const

Protected Attributes

u32_t typeAndInfoFlag
const ICFGNode * eventInst

Detailed Description

Bug Detector Recoder

Definition at line 50 of file SVFBugReport.h.

Member Enumeration Documentation

◆ EventType

Enumerator
Branch 
Caller 
CallSite 
Loop 
SourceInst 

Definition at line 53 of file SVFBugReport.h.

54 {
55 Branch = 0x1,
56 Caller = 0x2,
57 CallSite = 0x3,
58 Loop = 0x4,
59 SourceInst = 0x5
60 };

Constructor & Destructor Documentation

◆ SVFBugEvent()

SVF::SVFBugEvent::SVFBugEvent ( u32_t typeAndInfoFlag,
const ICFGNode * eventInst )
inline

Definition at line 67 of file SVFBugReport.h.

◆ ~SVFBugEvent()

virtual SVF::SVFBugEvent::~SVFBugEvent ( )
virtualdefault

Member Function Documentation

◆ getEventDescription()

const std::string SVFBugEvent::getEventDescription ( ) const
virtual

Definition at line 302 of file SVFBugReport.cpp.

303{
304 switch(getEventType())
305 {
307 {
309 {
310 return "True";
311 }
312 else
313 {
314 return "False";
315 }
316 break;
317 }
319 {
320 std::string description("calls ");
321 assert(SVFUtil::isa<CallICFGNode>(eventInst) && "not a call ICFGNode?");
322 const FunObjVar *callee = SVFUtil::cast<CallICFGNode>(eventInst)->getCalledFunction();
323 if(callee == nullptr)
324 {
325 description += "<unknown>";
326 }
327 else
328 {
329 description += callee->getName();
330 }
331 return description;
332 break;
333 }
335 {
336 return "None";
337 }
338 default:
339 {
340 assert(false && "No such type of event!");
341 abort();
342 }
343 }
344}
#define BRANCHFLAGMASK
u32_t getEventType() const
virtual const std::string & getName() const
Definition SVFValue.h:184
std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > cast(const Y &Val)
Definition Casting.h:360
LLVM_NODISCARD bool isa(const Y &Val)
Definition Casting.h:241

◆ getEventLoc()

const std::string SVFBugEvent::getEventLoc ( ) const
virtual

Definition at line 297 of file SVFBugReport.cpp.

298{
299 return eventInst->getSourceLoc();
300}

◆ getEventType()

u32_t SVF::SVFBugEvent::getEventType ( ) const
inline

Definition at line 70 of file SVFBugReport.h.

71 {
73 }
#define EVENTTYPEMASK

◆ getFuncName()

const std::string SVFBugEvent::getFuncName ( ) const
virtual

Definition at line 292 of file SVFBugReport.cpp.

293{
294 return eventInst->getFun()->getName();
295}

Member Data Documentation

◆ eventInst

const ICFGNode* SVF::SVFBugEvent::eventInst
protected

Definition at line 64 of file SVFBugReport.h.

◆ typeAndInfoFlag

u32_t SVF::SVFBugEvent::typeAndInfoFlag
protected

Definition at line 63 of file SVFBugReport.h.


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