Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first commit of ConstantVal/Obj #1602

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor GlobalClass, and remove unused codes
  • Loading branch information
bjjwwang committed Dec 13, 2024
commit c4a2cc02e986d47c07346512bf810b013aca9d73
10 changes: 7 additions & 3 deletions svf/include/SVFIR/SVFIR.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@
assert(icfg->totalICFGNode>0 && "empty ICFG! Build SVF IR first!");
return icfg;
}

inline bool isGlobalVar(const SVFVar* var) const {
return SVFUtil::isa<GlobalValVar>(var) || SVFUtil::isa<GlobalObjVar>(var);
}

/// Set/Get CHG
inline void setCHG(CommonCHGraph* c)
{
Expand Down Expand Up @@ -601,7 +606,7 @@

inline NodeID addGlobalValueValNode(const SVFValue* curInst, const NodeID i, const ICFGNode* icfgNode)
{
SVFVar* node = new GlobalValueValVar(curInst, i, icfgNode);
SVFVar* node = new GlobalValVar(curInst, i, icfgNode);
return addNode(node, i);
}

Expand All @@ -627,16 +632,16 @@
}


inline NodeID addConstantNullPtrObjNode(const SVFValue* curInst, const NodeID i) {
const MemObj* mem = getMemObj(curInst);
ConstantNullPtrObjVar* node = new ConstantNullPtrObjVar(curInst, mem->getId(), mem);
return addObjNode(mem->getValue(), node, mem->getId());

Check warning on line 638 in svf/include/SVFIR/SVFIR.h

View check run for this annotation

Codecov / codecov/patch

svf/include/SVFIR/SVFIR.h#L635-L638

Added lines #L635 - L638 were not covered by tests
}

inline NodeID addGlobalValueObjNode(const SVFValue* curInst, const NodeID i)
{
const MemObj* mem = getMemObj(curInst);
GlobalValueObjVar* node = new GlobalValueObjVar(curInst, mem->getId(), mem);
GlobalObjVar* node = new GlobalObjVar(curInst, mem->getId(), mem);
return addObjNode(mem->getValue(), node, mem->getId());
}

Expand All @@ -648,7 +653,6 @@
}



/// Add a temp field value node, this method can only invoked by getGepValVar
NodeID addGepValNode(const SVFValue* curInst,const SVFValue* val, const AccessPath& ap, NodeID i, const SVFType* type);
/// Add a field obj node, this method can only invoked by getGepObjVar
Expand Down
12 changes: 6 additions & 6 deletions svf/include/SVFIR/SVFVariables.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
const SVFType* gepValType;

/// Constructor to create empty GeValVar (for SVFIRReader/deserialization)
GepValVar(NodeID i) : ValVar(i, GepValNode), gepValType{} {}

Check warning on line 327 in svf/include/SVFIR/SVFVariables.h

View check run for this annotation

Codecov / codecov/patch

svf/include/SVFIR/SVFVariables.h#L327

Added line #L327 was not covered by tests

public:
/// Methods for support type inquiry through isa, cast, and dyn_cast:
Expand Down Expand Up @@ -367,17 +367,17 @@
}

/// Return name of a LLVM value
inline const std::string getValueName() const

Check warning on line 370 in svf/include/SVFIR/SVFVariables.h

View check run for this annotation

Codecov / codecov/patch

svf/include/SVFIR/SVFVariables.h#L370

Added line #L370 was not covered by tests
{
if (value)
return value->getName() + "_" +
std::to_string(getConstantFieldIdx());
return "offset_" + std::to_string(getConstantFieldIdx());

Check warning on line 375 in svf/include/SVFIR/SVFVariables.h

View check run for this annotation

Codecov / codecov/patch

svf/include/SVFIR/SVFVariables.h#L373-L375

Added lines #L373 - L375 were not covered by tests
}

inline const SVFType* getType() const

Check warning on line 378 in svf/include/SVFIR/SVFVariables.h

View check run for this annotation

Codecov / codecov/patch

svf/include/SVFIR/SVFVariables.h#L378

Added line #L378 was not covered by tests
{
return gepValType;

Check warning on line 380 in svf/include/SVFIR/SVFVariables.h

View check run for this annotation

Codecov / codecov/patch

svf/include/SVFIR/SVFVariables.h#L380

Added line #L380 was not covered by tests
}

virtual const std::string toString() const;
Expand All @@ -388,7 +388,7 @@
/*
* Memory Object variable
*/
class ObjVar: public SVFVar

Check warning on line 391 in svf/include/SVFIR/SVFVariables.h

View check run for this annotation

Codecov / codecov/patch

svf/include/SVFIR/SVFVariables.h#L391

Added line #L391 was not covered by tests
{
friend class SVFIRWriter;
friend class SVFIRReader;
Expand All @@ -396,7 +396,7 @@
protected:
const MemObj* mem; ///< memory object
/// Constructor to create an empty ObjVar (for SVFIRReader/deserialization)
ObjVar(NodeID i, PNODEK ty = ObjNode) : SVFVar(i, ty), mem{} {}

Check warning on line 399 in svf/include/SVFIR/SVFVariables.h

View check run for this annotation

Codecov / codecov/patch

svf/include/SVFIR/SVFVariables.h#L399

Added line #L399 was not covered by tests
/// Constructor
ObjVar(const SVFValue* val, NodeID i, const MemObj* m, PNODEK ty = ObjNode) :
SVFVar(val, i, ty), mem(m)
Expand Down Expand Up @@ -430,11 +430,11 @@
}

/// Return name of a LLVM value
virtual const std::string getValueName() const

Check warning on line 433 in svf/include/SVFIR/SVFVariables.h

View check run for this annotation

Codecov / codecov/patch

svf/include/SVFIR/SVFVariables.h#L433

Added line #L433 was not covered by tests
{
if (value)
return value->getName();
return "";

Check warning on line 437 in svf/include/SVFIR/SVFVariables.h

View check run for this annotation

Codecov / codecov/patch

svf/include/SVFIR/SVFVariables.h#L437

Added line #L437 was not covered by tests
}
/// Return type of the value
inline virtual const SVFType* getType() const
Expand Down Expand Up @@ -731,7 +731,7 @@
virtual const std::string toString() const;
};

class GlobalValueValVar : public ValVar
class GlobalValVar : public ValVar
{
friend class SVFIRWriter;
friend class SVFIRReader;
Expand Down Expand Up @@ -762,7 +762,7 @@
//@}

/// Constructor
GlobalValueValVar(const SVFValue* val, NodeID i, const ICFGNode* icn,
GlobalValVar(const SVFValue* val, NodeID i, const ICFGNode* icn,
PNODEK ty = GlobalValueValNode)
: ValVar(val, i, ty, icn)
{
Expand Down Expand Up @@ -809,8 +809,8 @@

}

virtual const std::string toString() const {
return "BlackHoleVar";

Check warning on line 813 in svf/include/SVFIR/SVFVariables.h

View check run for this annotation

Codecov / codecov/patch

svf/include/SVFIR/SVFVariables.h#L812-L813

Added lines #L812 - L813 were not covered by tests
}
};

Expand Down Expand Up @@ -957,18 +957,18 @@
virtual const std::string toString() const;
};

class GlobalValueObjVar: public FIObjVar {
class GlobalObjVar : public FIObjVar {
friend class SVFIRWriter;
friend class SVFIRReader;

private:
/// Constructor to create empty ObjVar (for SVFIRReader/deserialization)
GlobalValueObjVar(NodeID i, PNODEK ty = GlobalValueObjNode) : FIObjVar(i, ty) {}
GlobalObjVar(NodeID i, PNODEK ty = GlobalValueObjNode) : FIObjVar(i, ty) {}

public:
/// Methods for support type inquiry through isa, cast, and dyn_cast:
//@{
static inline bool classof(const GlobalValueObjVar*)
static inline bool classof(const GlobalObjVar*)
{
return true;
}
Expand All @@ -995,7 +995,7 @@
//@}

/// Constructor
GlobalValueObjVar(const SVFValue* val, NodeID i, const MemObj* mem,
GlobalObjVar(const SVFValue* val, NodeID i, const MemObj* mem,
PNODEK ty = GlobalValueObjNode): FIObjVar(val, i,mem,ty){

}
Expand Down Expand Up @@ -1198,7 +1198,7 @@

/// Constructor
ConstantNullPtrObjVar(const SVFValue* val, NodeID i, const MemObj* m, PNODEK ty = ConstantNullptrObjNode)
: ConstantDataObjVar(val, i, m, ty)

Check warning on line 1201 in svf/include/SVFIR/SVFVariables.h

View check run for this annotation

Codecov / codecov/patch

svf/include/SVFIR/SVFVariables.h#L1201

Added line #L1201 was not covered by tests
{
}

Expand Down
2 changes: 1 addition & 1 deletion svf/lib/AE/Core/AbstractState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,15 @@
}
else if (SVFUtil::isa<ConstantNullPtrObjVar>(objVar))
{
(*this)[varId] = IntervalValue(0, 0);

Check warning on line 201 in svf/lib/AE/Core/AbstractState.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/AE/Core/AbstractState.cpp#L201

Added line #L201 was not covered by tests
}
else if (SVFUtil::isa<GlobalValueObjVar>(objVar))
else if (SVFUtil::isa<GlobalObjVar>(objVar))
{
(*this)[varId] = AddressValue(AbstractState::getVirtualMemAddress(varId));
}
else if (obj->isConstantArray() || obj->isConstantStruct())
{
(*this)[varId] = IntervalValue::top();

Check warning on line 209 in svf/lib/AE/Core/AbstractState.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/AE/Core/AbstractState.cpp#L209

Added line #L209 was not covered by tests
}
else
{
Expand Down Expand Up @@ -388,7 +388,7 @@
std::vector<std::pair<u32_t, AbstractValue>> varToAbsValVec(_varToAbsVal.begin(), _varToAbsVal.end());
std::sort(varToAbsValVec.begin(), varToAbsValVec.end(), [](const auto &a, const auto &b)
{
return a.first < b.first;

Check warning on line 391 in svf/lib/AE/Core/AbstractState.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/AE/Core/AbstractState.cpp#L391

Added line #L391 was not covered by tests
});
for (const auto &item: varToAbsValVec)
{
Expand Down Expand Up @@ -424,7 +424,7 @@
std::vector<std::pair<u32_t, AbstractValue>> addrToAbsValVec(_addrToAbsVal.begin(), _addrToAbsVal.end());
std::sort(addrToAbsValVec.begin(), addrToAbsValVec.end(), [](const auto &a, const auto &b)
{
return a.first < b.first;

Check warning on line 427 in svf/lib/AE/Core/AbstractState.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/AE/Core/AbstractState.cpp#L427

Added line #L427 was not covered by tests
});

for (const auto& item: addrToAbsValVec)
Expand Down
4 changes: 2 additions & 2 deletions svf/lib/MemoryModel/PointerAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,12 @@ void PointerAnalysis::getVFnsFromPts(const CallICFGNode* cs, const PointsTo &tar
if (ptdnode->hasValue())
{
// ptd is global obj var or ptd's base is global val/obj var
if (SVFUtil::isa<GlobalValueValVar, GlobalValueObjVar>(ptdnode)) {
if (pag->isGlobalVar(ptdnode)) {
const SVFGlobalValue* globalValue = SVFUtil::dyn_cast<SVFGlobalValue>(ptdnode->getValue());
if (chaVtbls.find(globalValue) != chaVtbls.end())
vtbls.insert(globalValue);
} else if (const GepObjVar *gep_vtbl = SVFUtil::dyn_cast<GepObjVar>(ptdnode)) {
if (SVFUtil::isa<GlobalValueValVar, GlobalValueObjVar>(pag->getGNode(gep_vtbl->getBaseNode()))) {
if (SVFUtil::isa<GlobalValVar, GlobalObjVar>(pag->getGNode(gep_vtbl->getBaseNode()))) {
const SVFGlobalValue* globalValue = SVFUtil::dyn_cast<SVFGlobalValue>(gep_vtbl->getValue());
if (chaVtbls.find(globalValue) != chaVtbls.end())
vtbls.insert(globalValue);
Expand Down
8 changes: 0 additions & 8 deletions svf/lib/SABER/SaberCondAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,14 +401,6 @@

const SVFVar* op0 = cmp->getOpVar(0);
const SVFVar* op1 = cmp->getOpVar(1);
bool a = SVFUtil::dyn_cast<ConstantNullPtrValVar>(op0) ||
SVFUtil::dyn_cast<ConstantNullPtrObjVar>(op0);
bool b = SVFUtil::dyn_cast<ConstantNullPtrValVar>(op1) ||
SVFUtil::dyn_cast<ConstantNullPtrObjVar>(op1);
bool c = SVFUtil::dyn_cast<SVFConstantNullPtr>(op0->getValue());
bool d = SVFUtil::dyn_cast<SVFConstantNullPtr>(op1->getValue());
assert(a == c);
assert(b == d);
if (SVFUtil::isa<ConstantNullPtrValVar, ConstantNullPtrObjVar>(op1))
{
Set<const SVFValue* > inDirVal;
Expand All @@ -427,7 +419,7 @@
{
inDirVal.insert(it->getDstNode()->getValue());
}
return inDirVal.find(op1->getValue()) != inDirVal.end();

Check warning on line 422 in svf/lib/SABER/SaberCondAllocator.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SABER/SaberCondAllocator.cpp#L422

Added line #L422 was not covered by tests
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion svf/lib/SABER/SaberSVFGBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void SaberSVFGBuilder::collectGlobals(BVDataPTAImpl* pta)
if(SVFUtil::isa<DummyObjVar>(pag->getGNode(gepobj->getBaseNode())))
continue;
}
if(pagNode->hasValue() && SVFUtil::isa<GlobalValueValVar, GlobalValueObjVar>(pagNode))
if(pagNode->hasValue() && pag->isGlobalVar(pagNode))
worklist.push_back(it->first);
}

Expand Down
4 changes: 2 additions & 2 deletions svf/lib/SVFIR/SVFFileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@
CASE(FunObjNode, FunObjVar);
CASE(FunValNode, FunValVar);
CASE(ConstantDataValNode, ConstantDataValVar);
CASE(GlobalValueValNode, GlobalValueValVar);
CASE(GlobalValueValNode, GlobalValVar);
CASE(BlackHoleNode, BlackHoleVar);
CASE(ConstantFPValNode, ConstantFPValVar);

Check warning on line 232 in svf/lib/SVFIR/SVFFileSystem.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFFileSystem.cpp#L232

Added line #L232 was not covered by tests
CASE(ConstantIntValNode, ConstantIntValVar);
CASE(ConstantNullptrValNode, ConstantNullPtrValVar);
CASE(ConstantDataObjNode, ConstantDataObjVar);
CASE(GlobalValueObjNode, GlobalValueObjVar);
CASE(GlobalValueObjNode, GlobalObjVar);

Check warning on line 236 in svf/lib/SVFIR/SVFFileSystem.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFFileSystem.cpp#L234-L236

Added lines #L234 - L236 were not covered by tests
CASE(ConstantFPObjNode, ConstantFPObjVar);
CASE(ConstantIntObjNode, ConstantIntObjVar);
CASE(ConstantNullptrObjNode, ConstantNullPtrObjVar);
Expand Down
7 changes: 3 additions & 4 deletions svf/lib/SVFIR/SVFVariables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,19 +209,19 @@
return rawstr.str();
}

const std::string ConstantDataValVar::toString() const {

Check warning on line 212 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L212

Added line #L212 was not covered by tests
std::string str;
std::stringstream rawstr(str);

Check warning on line 214 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L214

Added line #L214 was not covered by tests
rawstr << "ConstantDataValNode ID: " << getId();
if (Options::ShowSVFIRValue())
{
rawstr << "\n";
rawstr << valueOnlyToString();

Check warning on line 219 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L218-L219

Added lines #L218 - L219 were not covered by tests
}
return rawstr.str();
}

Check warning on line 222 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L221-L222

Added lines #L221 - L222 were not covered by tests

const std::string GlobalValueValVar::toString() const {
const std::string GlobalValVar::toString() const {
std::string str;
std::stringstream rawstr(str);
rawstr << "GlobalValueValVar ID: " << getId();
Expand All @@ -233,34 +233,34 @@
return rawstr.str();
}

const std::string ConstantFPValVar::toString() const {

Check warning on line 236 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L236

Added line #L236 was not covered by tests
std::string str;
std::stringstream rawstr(str);

Check warning on line 238 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L238

Added line #L238 was not covered by tests
rawstr << "ConstantFPValNode ID: " << getId();
if (Options::ShowSVFIRValue())
{
rawstr << "\n";
rawstr << valueOnlyToString();

Check warning on line 243 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L242-L243

Added lines #L242 - L243 were not covered by tests
}
return rawstr.str();
}

Check warning on line 246 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L245-L246

Added lines #L245 - L246 were not covered by tests

const std::string ConstantIntValVar::toString() const {

Check warning on line 248 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L248

Added line #L248 was not covered by tests
std::string str;
std::stringstream rawstr(str);

Check warning on line 250 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L250

Added line #L250 was not covered by tests
rawstr << "ConstantIntValNode ID: " << getId();
if (Options::ShowSVFIRValue())
{
rawstr << "\n";
rawstr << valueOnlyToString();

Check warning on line 255 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L254-L255

Added lines #L254 - L255 were not covered by tests
}
return rawstr.str();
}

Check warning on line 258 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L257-L258

Added lines #L257 - L258 were not covered by tests

const std::string ConstantNullPtrValVar::toString() const {
std::string str;
std::stringstream rawstr(str);
rawstr << "ConstantObjVar ID: " << getId();
rawstr << "ConstantNullPtrValVar ID: " << getId();
if (Options::ShowSVFIRValue())
{
rawstr << "\n";
Expand All @@ -269,66 +269,65 @@
return rawstr.str();
}


const std::string GlobalValueObjVar::toString() const {
const std::string GlobalObjVar::toString() const {

Check warning on line 272 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L272

Added line #L272 was not covered by tests
std::string str;
std::stringstream rawstr(str);

Check warning on line 274 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L274

Added line #L274 was not covered by tests
rawstr << "GlobalValueObjNode ID: " << getId();
if (Options::ShowSVFIRValue())
{
rawstr << "\n";
rawstr << valueOnlyToString();

Check warning on line 279 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L278-L279

Added lines #L278 - L279 were not covered by tests
}
return rawstr.str();
}

Check warning on line 282 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L281-L282

Added lines #L281 - L282 were not covered by tests

const std::string ConstantDataObjVar::toString() const {

Check warning on line 284 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L284

Added line #L284 was not covered by tests
std::string str;
std::stringstream rawstr(str);

Check warning on line 286 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L286

Added line #L286 was not covered by tests
rawstr << "ConstantDataObjVar ID: " << getId();
if (Options::ShowSVFIRValue())
{
rawstr << "\n";
rawstr << valueOnlyToString();

Check warning on line 291 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L290-L291

Added lines #L290 - L291 were not covered by tests
}
return rawstr.str();
}

Check warning on line 294 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L293-L294

Added lines #L293 - L294 were not covered by tests

const std::string ConstantFPObjVar::toString() const {

Check warning on line 296 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L296

Added line #L296 was not covered by tests
std::string str;
std::stringstream rawstr(str);

Check warning on line 298 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L298

Added line #L298 was not covered by tests
rawstr << "ConstantFPObjVar ID: " << getId();
if (Options::ShowSVFIRValue())
{
rawstr << "\n";
rawstr << valueOnlyToString();

Check warning on line 303 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L302-L303

Added lines #L302 - L303 were not covered by tests
}
return rawstr.str();
}

Check warning on line 306 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L305-L306

Added lines #L305 - L306 were not covered by tests

const std::string ConstantIntObjVar::toString() const {

Check warning on line 308 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L308

Added line #L308 was not covered by tests
std::string str;
std::stringstream rawstr(str);

Check warning on line 310 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L310

Added line #L310 was not covered by tests
rawstr << "ConstantIntObjVar ID: " << getId();
if (Options::ShowSVFIRValue())
{
rawstr << "\n";
rawstr << valueOnlyToString();

Check warning on line 315 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L314-L315

Added lines #L314 - L315 were not covered by tests
}
return rawstr.str();
}

Check warning on line 318 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L317-L318

Added lines #L317 - L318 were not covered by tests

const std::string ConstantNullPtrObjVar::toString() const {

Check warning on line 320 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L320

Added line #L320 was not covered by tests
std::string str;
std::stringstream rawstr(str);

Check warning on line 322 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L322

Added line #L322 was not covered by tests
rawstr << "ConstantNullPtrObjVar ID: " << getId();
if (Options::ShowSVFIRValue())
{
rawstr << "\n";
rawstr << valueOnlyToString();

Check warning on line 327 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L326-L327

Added lines #L326 - L327 were not covered by tests
}
return rawstr.str();
}

Check warning on line 330 in svf/lib/SVFIR/SVFVariables.cpp

View check run for this annotation

Codecov / codecov/patch

svf/lib/SVFIR/SVFVariables.cpp#L329-L330

Added lines #L329 - L330 were not covered by tests

FunObjVar::FunObjVar(const CallGraphNode* cgNode, NodeID i, const MemObj* mem,
PNODEK ty)
Expand Down
Loading