Skip to content

Commit

Permalink
fix SVFBasicBlock::toString
Browse files Browse the repository at this point in the history
  • Loading branch information
bjjwwang committed Feb 17, 2025
1 parent 97aeba0 commit c361c25
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 1 addition & 3 deletions svf/include/Graphs/BasicBlockG.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,7 @@ class SVFBasicBlock : public GenericBasicBlockNodeTy
return pos;
}

const std::string toString() const {
return getName();
}
const std::string toString() const;

};

Expand Down
14 changes: 14 additions & 0 deletions svf/lib/Graphs/BasicBlockG.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "Graphs/BasicBlockG.h"
#include "Graphs/ICFGNode.h"

using namespace SVF;
const std::string BasicBlockEdge::toString() const
Expand All @@ -8,3 +9,16 @@ const std::string BasicBlockEdge::toString() const
rawstr << "BasicBlockEdge: " << getSrcNode()->toString() << " -> " << getDstNode()->getName();
return rawstr.str();
}

const std::string SVFBasicBlock::toString() const
{
std::string str;
std::stringstream rawstr(str);
rawstr << "----------"<< "SVFBasicBlock: " << getName() <<"----------\n";
for (const ICFGNode* icfgNode : allICFGNodes)
{
rawstr << icfgNode->toString();
}
rawstr << "\n----------------------------------------\n";
return rawstr.str();
}

0 comments on commit c361c25

Please sign in to comment.