Skip to content

Commit

Permalink
remove redundant std move
Browse files Browse the repository at this point in the history
  • Loading branch information
jumormt committed Jan 21, 2025
1 parent 0d86e77 commit 0baf5ed
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 24 deletions.
11 changes: 2 additions & 9 deletions svf-llvm/lib/CHGBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,17 +377,10 @@ void CHGBuilder::analyzeVTables(const Module &M)
string vtblClassName = getClassNameFromVtblObj(globalvalue->getName().str());
CHNode *node = chg->getNode(vtblClassName);
assert(node && "node not found?");

SVFGlobalValue* pValue =
llvmModuleSet()->getSVFGlobalValue(
globalvalue);
SymID i = SymbolTableInfo::SymbolInfo()->getObjSym(pValue);
SymID i = SymbolTableInfo::SymbolInfo()->getObjSym(llvmModuleSet()->getSVFGlobalValue(globalvalue));
SVFVar* pVar = PAG::getPAG()->getGNode(i);
GlobalObjVar* globalObjVar = SVFUtil::cast<GlobalObjVar>(pVar);
string vtblValueName = vtblClassName;
string vtblName = vtblClassName;
pValue->setName(std::move(vtblValueName));
globalObjVar->setName(std::move(vtblName));
globalObjVar->setName(vtblClassName);
node->setVTable(globalObjVar);

for (unsigned int ei = 0; ei < vtblStruct->getNumOperands(); ++ei)
Expand Down
5 changes: 5 additions & 0 deletions svf/include/Graphs/GenericGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ class SVFBaseNode
return type;
}

inline virtual void setName(const std::string& nameInfo)
{
name = nameInfo;
}

inline virtual void setName(std::string&& nameInfo)
{
name = std::move(nameInfo);
Expand Down
15 changes: 0 additions & 15 deletions svf/include/SVFIR/SVFIR.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,21 +393,6 @@ class SVFIR : public IRGraph
/// return whole allocated memory object if this node is a gep obj node
/// return nullptr is this node is not a ObjVar type
//@{
inline const SVFVar* getBaseVar(NodeID id) const
{
const SVFVar* node = getGNode(id);
assert((SVFUtil::isa<ValVar>(node) || SVFUtil::isa<ObjVar>(node)) &&
"not a ValVar or ObjVar node?");
if (SVFUtil::isa<ValVar>(node))
{
return getBaseValVar(id);
}
else
{
return getBaseObject(id);
}
}

inline const BaseObjVar* getBaseObject(NodeID id) const
{
const SVFVar* node = getGNode(id);
Expand Down
2 changes: 2 additions & 0 deletions svf/include/SVFIR/SVFVariables.h
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,8 @@ class GepValVar: public ValVar
}

virtual const std::string toString() const;

virtual const std::string valueOnlyToString() const;
};

/*
Expand Down
7 changes: 7 additions & 0 deletions svf/lib/SVFIR/SVFVariables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ const std::string GepValVar::toString() const
return rawstr.str();
}

__attribute__((weak))
const std::string GepValVar::valueOnlyToString() const
{
assert("GepValVar::valueOnlyToString should be implemented or supported by fronted" && false);
abort();
}

RetPN::RetPN(NodeID i, const CallGraphNode* node) : ValVar(i, RetNode), callGraphNode(node)
{
isPtr = node->getFunction()->getReturnType()->isPointerTy();
Expand Down

0 comments on commit 0baf5ed

Please sign in to comment.