diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvmc2/CompilationGraph.cpp | 23 | ||||
-rw-r--r-- | tools/llvmc2/Tool.h | 8 |
2 files changed, 16 insertions, 15 deletions
diff --git a/tools/llvmc2/CompilationGraph.cpp b/tools/llvmc2/CompilationGraph.cpp index cf174dd..df1f239 100644 --- a/tools/llvmc2/CompilationGraph.cpp +++ b/tools/llvmc2/CompilationGraph.cpp @@ -123,10 +123,9 @@ void CompilationGraph::insertNode(Tool* V) { void CompilationGraph::insertEdge(const std::string& A, Edge* Edg) { Node& B = getNode(Edg->ToolName()); if (A == "root") { - const StrVector& InputLanguages = B.ToolPtr->InputLanguages(); - for (StrVector::const_iterator B = InputLanguages.begin(), - E = InputLanguages.end(); B != E; ++B) - ToolsMap[*B].push_back(IntrusiveRefCntPtr<Edge>(Edg)); + const char** InLangs = B.ToolPtr->InputLanguages(); + for (;*InLangs; ++InLangs) + ToolsMap[*InLangs].push_back(IntrusiveRefCntPtr<Edge>(Edg)); NodesMap["root"].AddEdge(Edg); } else { @@ -392,15 +391,17 @@ namespace llvm { return N->ToolPtr->OutputLanguage(); } else { - const StrVector& InputLanguages = I->ToolPtr->InputLanguages(); + const char** InLangs = I->ToolPtr->InputLanguages(); std::string ret; - for (StrVector::const_iterator B = InputLanguages.begin(), - E = InputLanguages.end(); B != E; ++B) { - if (llvm::next(B) != E) - ret += *B + ", "; - else - ret += *B; + for (; *InLangs; ++InLangs) { + if (*(InLangs + 1)) { + ret += *InLangs; + ret += ", "; + } + else { + ret += *InLangs; + } } return ret; diff --git a/tools/llvmc2/Tool.h b/tools/llvmc2/Tool.h index 4762b1e..93fa5df 100644 --- a/tools/llvmc2/Tool.h +++ b/tools/llvmc2/Tool.h @@ -42,10 +42,10 @@ namespace llvmc { const llvm::sys::Path& outFile, const InputLanguagesSet& InLangs) const = 0; - virtual const char* Name() const = 0; - virtual StrVector InputLanguages() const = 0; - virtual const char* OutputLanguage() const = 0; - virtual const char* OutputSuffix() const = 0; + virtual const char* Name() const = 0; + virtual const char** InputLanguages() const = 0; + virtual const char* OutputLanguage() const = 0; + virtual const char* OutputSuffix() const = 0; virtual bool IsLast() const = 0; virtual bool IsJoin() const = 0; |