From 905ac5ee67380e138314c645acb7b4330ffd6caf Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 26 Feb 2002 19:49:45 +0000 Subject: [PATCH] Pass stuff by reference instead of by copy. Copying entire graphs seems like a bad idea git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1810 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../Instrumentation/ProfilePaths/GraphAuxiliary.cpp | 8 ++++---- .../Instrumentation/ProfilePaths/GraphAuxillary.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxiliary.cpp b/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxiliary.cpp index 3786c6d950b..0dd4fcfb6c9 100644 --- a/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxiliary.cpp +++ b/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxiliary.cpp @@ -22,7 +22,7 @@ static bool edgesEqual(Edge ed1, Edge ed2){ } //Get the vector of edges that are to be instrumented in the graph -static void getChords(vector &chords, Graph g, Graph st){ +static void getChords(vector &chords, Graph &g, Graph st){ //make sure the spanning tree is directional //iterate over ALL the edges of the graph list allNodes=g.getAllNodes(); @@ -45,7 +45,7 @@ static void getChords(vector &chords, Graph g, Graph st){ //would have too. This function corrects some of the directions in //the tree so that now, all edge directions in the tree match //the edge directions of corresponding edges in the directed graph -static void removeTreeEdges(Graph g, Graph& t){ +static void removeTreeEdges(Graph &g, Graph& t){ list allNodes=t.getAllNodes(); for(list::iterator NI=allNodes.begin(), NE=allNodes.end(); NI!=NE; ++NI){ @@ -91,7 +91,7 @@ int valueAssignmentToEdges(Graph& g){ //refers to the path we travelled //inc_Dir tells whether 2 edges are in same, or in different directions //if same direction, return 1, else -1 -static int inc_Dir(Edge e,Edge f){ +static int inc_Dir(Edge e, Edge f){ if(e.isNull()) return 1; @@ -627,7 +627,7 @@ void processGraph(Graph &g, //print the graph (for debugging) -void printGraph(Graph g){ +void printGraph(Graph &g){ list lt=g.getAllNodes(); cerr<<"Graph---------------------\n"; for(list::iterator LI=lt.begin(); diff --git a/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp b/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp index 3786c6d950b..0dd4fcfb6c9 100644 --- a/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp +++ b/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp @@ -22,7 +22,7 @@ static bool edgesEqual(Edge ed1, Edge ed2){ } //Get the vector of edges that are to be instrumented in the graph -static void getChords(vector &chords, Graph g, Graph st){ +static void getChords(vector &chords, Graph &g, Graph st){ //make sure the spanning tree is directional //iterate over ALL the edges of the graph list allNodes=g.getAllNodes(); @@ -45,7 +45,7 @@ static void getChords(vector &chords, Graph g, Graph st){ //would have too. This function corrects some of the directions in //the tree so that now, all edge directions in the tree match //the edge directions of corresponding edges in the directed graph -static void removeTreeEdges(Graph g, Graph& t){ +static void removeTreeEdges(Graph &g, Graph& t){ list allNodes=t.getAllNodes(); for(list::iterator NI=allNodes.begin(), NE=allNodes.end(); NI!=NE; ++NI){ @@ -91,7 +91,7 @@ int valueAssignmentToEdges(Graph& g){ //refers to the path we travelled //inc_Dir tells whether 2 edges are in same, or in different directions //if same direction, return 1, else -1 -static int inc_Dir(Edge e,Edge f){ +static int inc_Dir(Edge e, Edge f){ if(e.isNull()) return 1; @@ -627,7 +627,7 @@ void processGraph(Graph &g, //print the graph (for debugging) -void printGraph(Graph g){ +void printGraph(Graph &g){ list lt=g.getAllNodes(); cerr<<"Graph---------------------\n"; for(list::iterator LI=lt.begin(); -- 2.34.1