SVF
Functions
FlowSensitiveTBHC.cpp File Reference
#include "Util/Options.h"
#include "SVF-FE/DCHG.h"
#include "SVF-FE/CPPUtil.h"
#include "WPA/FlowSensitiveTBHC.h"
#include "WPA/WPAStat.h"
#include "WPA/Andersen.h"

Go to the source code of this file.

Functions

static const DITypegetVTInitType (const CopySVFGNode *copy, DCHGraph *dchg)
 

Function Documentation

◆ getVTInitType()

static const DIType* getVTInitType ( const CopySVFGNode copy,
DCHGraph dchg 
)
static

Returns whether this instruction initialisates an object's vtable (metadata: ctir.vt.init). Returns the object's type, otherwise, nullptr.

Definition at line 505 of file FlowSensitiveTBHC.cpp.

506 {
507  if (copy->getInst() == nullptr) return nullptr;
508  const Instruction *inst = copy->getInst();
509 
510  const MDNode *mdNode = inst->getMetadata(cppUtil::ctir::vtInitMDName);
511  if (mdNode == nullptr) return nullptr;
512 
513  const DIType *type = SVFUtil::dyn_cast<DIType>(mdNode);
514  assert(type != nullptr && "TBHC: bad ctir.vt.init metadata");
515  return dchg->getCanonicalType(type);
516 }
const std::string vtInitMDName
Definition: CPPUtil.h:119
const Instruction * getInst() const
Definition: VFGNode.h:178
#define assert(ex)
Definition: util.h:141
llvm::Instruction Instruction
Definition: BasicTypes.h:79
const DIType * getCanonicalType(const DIType *t)
Definition: DCHG.cpp:713
llvm::MDNode MDNode
Definition: BasicTypes.h:138
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
Definition: Casting.h:343
llvm::DIType DIType
Definition: BasicTypes.h:217