[llvm] 6ef6363 - [DirectedGraph]: Add setTargetNode member function

Tsang Whitney W.H via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 10 19:37:09 PST 2019


Author: Tsang Whitney W.H
Date: 2019-11-11T03:36:23Z
New Revision: 6ef63638cb8bac243e0e59cec66a19c57b79e351

URL: https://github.com/llvm/llvm-project/commit/6ef63638cb8bac243e0e59cec66a19c57b79e351
DIFF: https://github.com/llvm/llvm-project/commit/6ef63638cb8bac243e0e59cec66a19c57b79e351.diff

LOG: [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

Added: 
    

Modified: 
    llvm/include/llvm/ADT/DirectedGraph.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/DirectedGraph.h b/llvm/include/llvm/ADT/DirectedGraph.h
index f6a358d99cd2..cfe98e178a91 100644
--- a/llvm/include/llvm/ADT/DirectedGraph.h
+++ b/llvm/include/llvm/ADT/DirectedGraph.h
@@ -48,6 +48,9 @@ template <class NodeType, class EdgeType> class DGEdge {
         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; }


        


More information about the llvm-commits mailing list