Static Value-Flow Analysis
Namespaces | Macros | Functions | Variables
SVFFileSystem.cpp File Reference
#include "SVFIR/SVFFileSystem.h"
#include "Graphs/CHG.h"
#include "SVFIR/SVFIR.h"
#include "Util/CommandLine.h"
#include <sys/fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

Go to the source code of this file.

Namespaces

 SVF
 for isBitcode
 

Macros

#define CASE(Kind)
 
#define CASE(ValueKind, type)
 
#define CASE(VarKind, VarType)
 
#define CASE(EdgeKind, EdgeType)
 
#define CASE(NodeKind, NodeType)
 
#define F(f)   JSON_WRITE_FIELD(root, value, f);
 
#define F(field)   JSON_WRITE_FIELD(root, loop, field)
 
#define F(field)   JSON_WRITE_FIELD(root, svfIR, field)
 
#define F(field)   JSON_WRITE_FIELD(root, graph, field)
 
#define F(field)   JSON_WRITE_FIELD(root, icfg, field)
 
#define F(field)   JSON_WRITE_FIELD(root, graph, field)
 
#define F(field)   JSON_WRITE_FIELD(root, stInfo, field)
 
#define F(field)   JSON_WRITE_FIELD(root, symTable, field)
 
#define F(field)   JSON_WRITE_FIELD(root, module, field)
 
#define F(field)   JSON_READ_FIELD_FWD(svfirField, svfIR, field)
 
#define READ_CREATE_NODE_FWD(GType)
 
#define READ_CREATE_EDGE_FWD(GType)
 
#define CASE(kind, constructor)
 
#define CASE(kind, constructor)
 
#define CASE(kind, constructor)
 
#define F(field)   JSON_READ_FIELD_FWD(obj, symTabInfo, field)
 
#define F(field)   JSON_READ_FIELD_FWD(obj, graph, field)
 
#define F(field)   JSON_READ_FIELD_FWD(obj, icfg, field)
 
#define F(field)   JSON_READ_FIELD_FWD(obj, graph, field)
 
#define F(field)   JSON_READ_FIELD_FWD(obj, module, field)
 
#define CASE(VarKind, VarType)
 
#define CASE(EdgeKind, EdgeType)
 
#define F(field)   JSON_READ_FIELD_FWD(fieldJson, stInfo, field)
 
#define CASE(NodeKind, NodeType)
 
#define F(field)   JSON_READ_FIELD_FWD(fieldJson, loop, field)
 
#define CASE(ValueKind, Type)
 
#define F(f)   JSON_READ_FIELD_FWD(fieldJson, value, f)
 
#define CASE(Kind)
 

Functions

SVFType * SVF::createSVFType (SVFType::GNodeK kind, bool isSingleValTy)
 
static SVFValue * SVF::createSVFValue (SVFValue::GNodeK kind, const SVFType *type, std::string &&name)
 
template<typename SmallNumberType >
static void SVF::readSmallNumber (const cJSON *obj, SmallNumberType &val)
 
template<typename BigNumberType , typename CStrToVal >
static void SVF::readBigNumber (const cJSON *obj, BigNumberType &val, CStrToVal conv)
 
bool SVF::jsonAddNumberToObject (cJSON *obj, const char *name, double number)
 Helper function to write a number to a JSON object. More...
 
bool SVF::jsonAddStringToObject (cJSON *obj, const char *name, const char *str)
 
bool SVF::jsonAddStringToObject (cJSON *obj, const char *name, const std::string &s)
 
bool SVF::jsonIsBool (const cJSON *item)
 
bool SVF::jsonIsBool (const cJSON *item, bool &flag)
 
bool SVF::jsonIsNumber (const cJSON *item)
 
bool SVF::jsonIsString (const cJSON *item)
 
bool SVF::jsonIsNullId (const cJSON *item)
 
bool SVF::jsonIsArray (const cJSON *item)
 
bool SVF::jsonIsMap (const cJSON *item)
 
bool SVF::jsonIsObject (const cJSON *item)
 
bool SVF::jsonKeyEquals (const cJSON *item, const char *key)
 
std::pair< const cJSON *, const cJSON * > SVF::jsonUnpackPair (const cJSON *item)
 
double SVF::jsonGetNumber (const cJSON *item)
 
cJSONSVF::jsonCreateNullId ()
 
cJSONSVF::jsonCreateObject ()
 
cJSONSVF::jsonCreateArray ()
 
cJSONSVF::jsonCreateMap ()
 
cJSONSVF::jsonCreateString (const char *str)
 
cJSONSVF::jsonCreateIndex (size_t index)
 
cJSONSVF::jsonCreateBool (bool flag)
 
cJSONSVF::jsonCreateNumber (double num)
 
bool SVF::jsonAddPairToMap (cJSON *obj, cJSON *key, cJSON *value)
 
bool SVF::jsonAddItemToObject (cJSON *obj, const char *name, cJSON *item)
 
bool SVF::jsonAddItemToArray (cJSON *array, cJSON *item)
 

Variables

static const Option< bool > humanReadableOption ("human-readable", "Whether to output human-readable JSON", true)
 

Macro Definition Documentation

◆ CASE [1/13]

#define CASE (   EdgeKind,
  EdgeType 
)
Value:
case SVFStmt::EdgeKind: \
return contentToJson(static_cast<const EdgeType*>(stmt))

◆ CASE [2/13]

#define CASE (   EdgeKind,
  EdgeType 
)
Value:
case SVFStmt::EdgeKind: \
return fill(fieldJson, static_cast<EdgeType*>(stmt))

◆ CASE [3/13]

#define CASE (   Kind)
Value:
case SVFType::Kind: \
return contentToJson(static_cast<const Kind##pe*>(type))
newitem type
Definition: cJSON.cpp:2739

◆ CASE [4/13]

#define CASE (   Kind)
Value:
case SVFType::Kind: \
return fill(fieldJson, SVFUtil::dyn_cast<Kind##pe>(type))

◆ CASE [5/13]

#define CASE (   kind,
  constructor 
)
Value:
case ICFGNode::kind: \
return new constructor(id);

◆ CASE [6/13]

#define CASE (   kind,
  constructor 
)
Value:
case SVFVar::kind: \
return new constructor(id);

◆ CASE [7/13]

#define CASE (   kind,
  constructor 
)
Value:
case SVFStmt::kind: \
return new constructor;

◆ CASE [8/13]

#define CASE (   NodeKind,
  NodeType 
)
Value:
case ICFGNode::NodeKind: \
return contentToJson(static_cast<const NodeType*>(node))

◆ CASE [9/13]

#define CASE (   NodeKind,
  NodeType 
)
Value:
case ICFGNode::NodeKind: \
return fill(fieldJson, static_cast<NodeType*>(node))

◆ CASE [10/13]

#define CASE (   ValueKind,
  type 
)
Value:
case SVFValue::ValueKind: \
return contentToJson(static_cast<const type*>(value))

◆ CASE [11/13]

#define CASE (   ValueKind,
  Type 
)
Value:
case SVFValue::ValueKind: \
return fill(fieldJson, static_cast<Type*>(value))
llvm::Type Type
Definition: BasicTypes.h:83

◆ CASE [12/13]

#define CASE (   VarKind,
  VarType 
)
Value:
case SVFVar::VarKind: \
return contentToJson(static_cast<const VarType*>(var))

◆ CASE [13/13]

#define CASE (   VarKind,
  VarType 
)
Value:
case SVFVar::VarKind: \
return fill(fieldJson, static_cast<VarType*>(var))

◆ F [1/18]

#define F (   f)    JSON_WRITE_FIELD(root, value, f);

◆ F [2/18]

#define F (   f)    JSON_READ_FIELD_FWD(fieldJson, value, f)

◆ F [3/18]

#define F (   field)    JSON_WRITE_FIELD(root, loop, field)

◆ F [4/18]

#define F (   field)    JSON_WRITE_FIELD(root, svfIR, field)

◆ F [5/18]

#define F (   field)    JSON_WRITE_FIELD(root, graph, field)

◆ F [6/18]

#define F (   field)    JSON_WRITE_FIELD(root, icfg, field)

◆ F [7/18]

#define F (   field)    JSON_WRITE_FIELD(root, graph, field)

◆ F [8/18]

#define F (   field)    JSON_WRITE_FIELD(root, stInfo, field)

◆ F [9/18]

#define F (   field)    JSON_WRITE_FIELD(root, symTable, field)

◆ F [10/18]

#define F (   field)    JSON_WRITE_FIELD(root, module, field)

◆ F [11/18]

#define F (   field)    JSON_READ_FIELD_FWD(svfirField, svfIR, field)

◆ F [12/18]

#define F (   field)    JSON_READ_FIELD_FWD(obj, symTabInfo, field)

◆ F [13/18]

#define F (   field)    JSON_READ_FIELD_FWD(obj, graph, field)

◆ F [14/18]

#define F (   field)    JSON_READ_FIELD_FWD(obj, icfg, field)

◆ F [15/18]

#define F (   field)    JSON_READ_FIELD_FWD(obj, graph, field)

◆ F [16/18]

#define F (   field)    JSON_READ_FIELD_FWD(obj, module, field)

◆ F [17/18]

#define F (   field)    JSON_READ_FIELD_FWD(fieldJson, stInfo, field)

◆ F [18/18]

#define F (   field)    JSON_READ_FIELD_FWD(fieldJson, loop, field)

◆ READ_CREATE_EDGE_FWD

#define READ_CREATE_EDGE_FWD (   GType)
Value:
[](const cJSON*& edgeJson) { \
JSON_DEF_READ_FWD(edgeJson, GEdgeFlag, edgeFlag); \
auto kind = applyEdgeMask(edgeFlag); \
auto edge = create##GType##Edge(kind); \
setEdgeFlag(edge, edgeFlag); \
return edge; \
}
Definition: cJSON.h:104

◆ READ_CREATE_NODE_FWD

#define READ_CREATE_NODE_FWD (   GType)
Value:
[](const cJSON*& nodeJson) { \
JSON_DEF_READ_FWD(nodeJson, NodeID, id); \
JSON_DEF_READ_FWD(nodeJson, GNodeK, nodeKind); \
return std::make_pair(id, create##GType##Node(id, nodeKind)); \
}
u32_t NodeID
Definition: GeneralType.h:55

Variable Documentation

◆ humanReadableOption

const Option<bool> humanReadableOption("human-readable", "Whether to output human-readable JSON", true) ( "human-readable"  ,
"Whether to output human-readable JSON"  ,
true   
)
static