Static Value-Flow Analysis
Public Member Functions | Private Attributes | Friends | List of all members
SVF::SVFModuleWriter Class Reference

#include <SVFFileSystem.h>

Public Member Functions

 SVFModuleWriter (const SVFModule *svfModule)
 
size_t getSVFValueID (const SVFValue *value)
 
const SVFValuegetSVFValuePtr (size_t id) const
 
size_t getSVFTypeID (const SVFType *type)
 
size_t getStInfoID (const StInfo *stInfo)
 
size_t sizeSVFValuePool () const
 

Private Attributes

WriterPtrPool< SVFTypesvfTypePool
 
WriterPtrPool< StInfostInfoPool
 
WriterPtrPool< SVFValuesvfValuePool
 

Friends

class SVFIRWriter
 

Detailed Description

Definition at line 345 of file SVFFileSystem.h.

Constructor & Destructor Documentation

◆ SVFModuleWriter()

SVF::SVFModuleWriter::SVFModuleWriter ( const SVFModule svfModule)

Definition at line 960 of file SVFFileSystem.cpp.

961 {
962  // TODO: SVFType & StInfo are managed by SymbolTableInfo. Refactor it?
963  auto symTab = SymbolTableInfo::SymbolInfo();
964 
965  const auto& svfTypes = symTab->getSVFTypes();
966  svfTypePool.reserve(svfTypes.size());
967  for (const SVFType* type : svfTypes)
968  {
969  svfTypePool.saveID(type);
970  }
971 
972  const auto& stInfos = symTab->getStInfos();
973  stInfoPool.reserve(stInfos.size());
974  for (const StInfo* stInfo : stInfos)
975  {
976  stInfoPool.saveID(stInfo);
977  }
978 
979  svfValuePool.reserve(svfModule->getFunctionSet().size() +
980  svfModule->getConstantSet().size() +
981  svfModule->getOtherValueSet().size());
982 }
newitem type
Definition: cJSON.cpp:2739
WriterPtrPool< SVFValue > svfValuePool
WriterPtrPool< StInfo > stInfoPool
WriterPtrPool< SVFType > svfTypePool
static SymbolTableInfo * SymbolInfo()
Singleton design here to make sure we only have one instance during any analysis.

Member Function Documentation

◆ getStInfoID()

size_t SVF::SVFModuleWriter::getStInfoID ( const StInfo stInfo)
inline

Definition at line 369 of file SVFFileSystem.h.

370  {
371  return stInfoPool.getID(stInfo);
372  }

◆ getSVFTypeID()

size_t SVF::SVFModuleWriter::getSVFTypeID ( const SVFType type)
inline

Definition at line 365 of file SVFFileSystem.h.

366  {
367  return svfTypePool.getID(type);
368  }

◆ getSVFValueID()

size_t SVF::SVFModuleWriter::getSVFValueID ( const SVFValue value)
inline

Definition at line 357 of file SVFFileSystem.h.

358  {
359  return svfValuePool.getID(value);
360  }

◆ getSVFValuePtr()

const SVFValue* SVF::SVFModuleWriter::getSVFValuePtr ( size_t  id) const
inline

Definition at line 361 of file SVFFileSystem.h.

362  {
363  return svfValuePool.getPtr(id);
364  }

◆ sizeSVFValuePool()

size_t SVF::SVFModuleWriter::sizeSVFValuePool ( ) const
inline

Definition at line 373 of file SVFFileSystem.h.

374  {
375  return svfValuePool.size();
376  }

Friends And Related Function Documentation

◆ SVFIRWriter

friend class SVFIRWriter
friend

Definition at line 347 of file SVFFileSystem.h.

Member Data Documentation

◆ stInfoPool

WriterPtrPool<StInfo> SVF::SVFModuleWriter::stInfoPool
private

Definition at line 351 of file SVFFileSystem.h.

◆ svfTypePool

WriterPtrPool<SVFType> SVF::SVFModuleWriter::svfTypePool
private

Definition at line 350 of file SVFFileSystem.h.

◆ svfValuePool

WriterPtrPool<SVFValue> SVF::SVFModuleWriter::svfValuePool
private

Definition at line 352 of file SVFFileSystem.h.


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