int CompilationGraph::insertEdge(const std::string& A, Edge* Edg) {
Node* B = getNode(Edg->ToolName());
if (B == 0)
- return -1;
+ return 1;
if (A == "root") {
const char** InLangs = B->ToolPtr->InputLanguages();
else {
Node* N = getNode(A);
if (N == 0)
- return -1;
+ return 1;
N->AddEdge(Edg);
}
const Edge* Edg = ChooseEdge(CurNode->OutEdges, InLangs, CurNode->Name());
if (Edg == 0)
- return -1;
+ return 1;
CurNode = getNode(Edg->ToolName());
if (CurNode == 0)
- return -1;
+ return 1;
In = CurAction.OutFile();
}
// Find the toolchain corresponding to this file.
const Node* N = FindToolChain(In, xLanguage, InLangs, LangMap);
if (N == 0)
- return -1;
+ return 1;
// Pass file through the chain starting at head.
if (int ret = PassThroughGraph(In, N, InLangs, TempDir, LangMap))
return ret;
Node* Root = getNode("root");
if (Root == 0)
- return -1;
+ return 1;
Q.push(Root);
EB != EE; ++EB) {
Node* B = getNode((*EB)->ToolName());
if (B == 0)
- return -1;
+ return 1;
B->DecrInEdges();
if (B->HasNoInEdges())
const Edge* Edg = ChooseEdge(CurNode->OutEdges, InLangs, CurNode->Name());
if (Edg == 0)
- return -1;
+ return 1;
const Node* NextNode = getNode(Edg->ToolName());
if (NextNode == 0)
- return -1;
+ return 1;
if (int ret = PassThroughGraph(sys::Path(CurAction.OutFile()), NextNode,
InLangs, TempDir, LangMap)) {
EB != EE; ++EB) {
const Node* N2 = this->getNode((*EB)->ToolName());
if (N2 == 0)
- return -1;
+ return 1;
if (!N2->ToolPtr) {
++ret;
Node* Root = getNode("root");
if (Root == 0)
- return -1;
+ return 1;
Q.push(Root);
EB != EE; ++EB) {
Node* B = getNode((*EB)->ToolName());
if (B == 0)
- return -1;
+ return 1;
B->DecrInEdges();
if (B->HasNoInEdges())
// Check that output/input language names match.
ret = this->CheckLanguageNames();
if (ret < 0)
- return -1;
+ return 1;
errs += ret;
// Check for multiple default edges.
ret = this->CheckMultipleDefaultEdges();
if (ret < 0)
- return -1;
+ return 1;
errs += ret;
// Check for cycles.
ret = this->CheckCycles();
if (ret < 0)
- return -1;
+ return 1;
errs += ret;
return errs;
}
else {
PrintError("Error opening file '" + OutputFilename + "' for writing!");
- return -1;
+ return 1;
}
return 0;