aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvmc/driver
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2009-01-30 02:12:57 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2009-01-30 02:12:57 +0000
commit1aa4bda81e439e66631698d1b283c74db39a677b (patch)
tree7c8c95392c13dc6db8503c484507c30781dfbad1 /tools/llvmc/driver
parentf09ea39c67f4fda79116650438e3fbfbd7429216 (diff)
downloadexternal_llvm-1aa4bda81e439e66631698d1b283c74db39a677b.zip
external_llvm-1aa4bda81e439e66631698d1b283c74db39a677b.tar.gz
external_llvm-1aa4bda81e439e66631698d1b283c74db39a677b.tar.bz2
Add some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc/driver')
-rw-r--r--tools/llvmc/driver/CompilationGraph.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/llvmc/driver/CompilationGraph.cpp b/tools/llvmc/driver/CompilationGraph.cpp
index 2c59ee6..238ef6f 100644
--- a/tools/llvmc/driver/CompilationGraph.cpp
+++ b/tools/llvmc/driver/CompilationGraph.cpp
@@ -390,6 +390,8 @@ int CompilationGraph::CheckMultipleDefaultEdges() const {
int ret = 0;
InputLanguagesSet Dummy;
+ // For all nodes, just iterate over the outgoing edges and check if there is
+ // more than one edge with maximum weight.
for (const_nodes_iterator B = this->NodesMap.begin(),
E = this->NodesMap.end(); B != E; ++B) {
const Node& N = B->second;
@@ -423,6 +425,9 @@ int CompilationGraph::CheckCycles() {
std::queue<Node*> Q;
Q.push(&getNode("root"));
+ // Try to delete all nodes that have no ingoing edges, starting from the
+ // root. If there are any nodes left after this operation, then we have a
+ // cycle. This relies on '--check-graph' not performing the topological sort.
while (!Q.empty()) {
Node* A = Q.front();
Q.pop();
@@ -447,7 +452,6 @@ int CompilationGraph::CheckCycles() {
return 0;
}
-
int CompilationGraph::Check () {
// We try to catch as many errors as we can in one go.
int ret = 0;