[DirectedGraph]: Add setTargetNode member function

Summary:Add the setTargetNode member function to class DGEdge.
Authored By:etiotto
Reviewer:bmahjour, Whitney, jdoerfert, Meinersbur, fhahn, kbarton,
dmgreen
Reviewed By:Meinersbur
Subscribers:dexonsmith, kristina, llvm-commits
Tag:LLVM
Differential Revision:https://reviews.llvm.org/D68474
This commit is contained in:
Tsang Whitney W.H 2019-11-10 20:00:30 +00:00
parent 3d3445e3e6
commit 6ef63638cb
1 changed files with 3 additions and 0 deletions

View File

@ -48,6 +48,9 @@ public:
static_cast<const DGEdge<NodeType, EdgeType> &>(*this).getTargetNode());
}
/// Set the target node this edge connects to.
void setTargetNode(const NodeType &N) { TargetNode = N; }
protected:
// As the default implementation use address comparison for equality.
bool isEqualTo(const EdgeType &E) const { return this == &E; }