aboutsummaryrefslogtreecommitdiff
path: root/tools/llvmc2/CompilationGraph.h
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2008-05-06 18:15:12 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2008-05-06 18:15:12 +0000
commit76b1b24dc805c7a3adb4517443241ed3ecd0ba74 (patch)
treebfd96d543fa856e4b4bf11a8d92a91a32a4e8556 /tools/llvmc2/CompilationGraph.h
parentbb8b58dcf3e1994beb458e777b306fa3805ee50f (diff)
Use edge weights to choose the right linker based on input language names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50759 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc2/CompilationGraph.h')
-rw-r--r--tools/llvmc2/CompilationGraph.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/llvmc2/CompilationGraph.h b/tools/llvmc2/CompilationGraph.h
index 3dc8bc0623..1158d8df1d 100644
--- a/tools/llvmc2/CompilationGraph.h
+++ b/tools/llvmc2/CompilationGraph.h
@@ -20,14 +20,18 @@
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/iterator"
+//#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/System/Path.h"
+#include <set>
#include <string>
namespace llvmc {
+ typedef std::set<std::string> InputLanguagesSet;
+
// An edge of the compilation graph.
class Edge : public llvm::RefCountedBaseVPTR<Edge> {
public:
@@ -35,7 +39,7 @@ namespace llvmc {
virtual ~Edge() {};
const std::string& ToolName() const { return ToolName_; }
- virtual unsigned Weight() const = 0;
+ virtual unsigned Weight(const InputLanguagesSet& InLangs) const = 0;
private:
std::string ToolName_;
};
@@ -44,7 +48,7 @@ namespace llvmc {
class SimpleEdge : public Edge {
public:
SimpleEdge(const std::string& T) : Edge(T) {}
- unsigned Weight() const { return 1; }
+ unsigned Weight(const InputLanguagesSet&) const { return 1; }
};
// A node of the compilation graph.
@@ -160,11 +164,13 @@ namespace llvmc {
// Pass the input file through the toolchain.
void PassThroughGraph (const llvm::sys::Path& In, const Node* StartNode,
+ const InputLanguagesSet& InLangs,
const llvm::sys::Path& TempDir) const;
// Find head of the toolchain corresponding to the given file.
const Node* FindToolChain(const llvm::sys::Path& In,
- const std::string* forceLanguage) const;
+ const std::string* forceLanguage,
+ InputLanguagesSet& InLangs) const;
// Sort the nodes in topological order.
void TopologicalSort(std::vector<const Node*>& Out);