Skip to content

Commit

Permalink
fix valueonlystring
Browse files Browse the repository at this point in the history
  • Loading branch information
jumormt committed Jan 21, 2025
1 parent 4ee012f commit 14d9f64
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
23 changes: 19 additions & 4 deletions svf-llvm/lib/LLVMUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,11 +753,26 @@ const std::string SVFBaseNode::valueOnlyToString() const
}
else
{
auto llvmVal = LLVMModuleSet::getLLVMModuleSet()->getLLVMValue(this);
if (llvmVal)
rawstr << " " << *llvmVal << " ";
else
const SVFBaseNode* baseNode = this;
if (const GepValVar* valVar = SVFUtil::dyn_cast<GepValVar>(this))
{
baseNode = valVar->getBaseNode();

Check warning on line 759 in svf-llvm/lib/LLVMUtil.cpp

View check run for this annotation

Codecov / codecov/patch

svf-llvm/lib/LLVMUtil.cpp#L759

Added line #L759 was not covered by tests
}
else if (const GepObjVar* objVar = SVFUtil::dyn_cast<GepObjVar>(this))
{
baseNode = objVar->getBaseObj();
}
if (SVFUtil::isa<DummyObjVar, DummyValVar, BlackHoleVar>(baseNode))
rawstr << "";
else
{
auto llvmVal =
LLVMModuleSet::getLLVMModuleSet()->getLLVMValue(baseNode);
if (llvmVal)
rawstr << " " << *llvmVal << " ";
else
rawstr << "";

Check warning on line 774 in svf-llvm/lib/LLVMUtil.cpp

View check run for this annotation

Codecov / codecov/patch

svf-llvm/lib/LLVMUtil.cpp#L774

Added line #L774 was not covered by tests
}
}
rawstr << getSourceLoc();
return rawstr.str();
Expand Down
4 changes: 4 additions & 0 deletions svf/include/SVFIR/SVFVariables.h
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,10 @@ class GepValVar: public ValVar
{
return node->getNodeKind() == SVFVar::GepValNode;
}
static inline bool classof(const SVFBaseNode* node)
{
return node->getNodeKind() == SVFVar::GepValNode;
}
//@}

/// Constructor
Expand Down

0 comments on commit 14d9f64

Please sign in to comment.