summaryrefslogtreecommitdiffstats
path: root/tools/llvmc2/Tool.h
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2008-05-06 17:26:53 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2008-05-06 17:26:53 +0000
commitc74bfc946d9d093e299b959be956bde7ceb74cb1 (patch)
tree250e3442503463eac2cdcb7970b4e1b104541259 /tools/llvmc2/Tool.h
parent97fda6d91593b28bcfd8682facfecdaf290f2cb0 (diff)
downloadexternal_llvm-c74bfc946d9d093e299b959be956bde7ceb74cb1.zip
external_llvm-c74bfc946d9d093e299b959be956bde7ceb74cb1.tar.gz
external_llvm-c74bfc946d9d093e299b959be956bde7ceb74cb1.tar.bz2
Add inward edge counters to Nodes; Associate JoinLists with JoinTools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50738 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc2/Tool.h')
-rw-r--r--tools/llvmc2/Tool.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/tools/llvmc2/Tool.h b/tools/llvmc2/Tool.h
index 0d907dd..5136468 100644
--- a/tools/llvmc2/Tool.h
+++ b/tools/llvmc2/Tool.h
@@ -28,11 +28,14 @@ namespace llvmcc {
class Tool : public llvm::RefCountedBaseVPTR<Tool> {
public:
- virtual Action GenerateAction (PathVector const& inFiles,
- llvm::sys::Path const& outFile) const = 0;
- virtual Action GenerateAction (llvm::sys::Path const& inFile,
- llvm::sys::Path const& outFile) const = 0;
+ virtual ~Tool() {}
+
+ virtual Action GenerateAction (const PathVector& inFiles,
+ const llvm::sys::Path& outFile) const = 0;
+
+ virtual Action GenerateAction (const llvm::sys::Path& inFile,
+ const llvm::sys::Path& outFile) const = 0;
virtual const char* Name() const = 0;
virtual const char* InputLanguage() const = 0;
@@ -47,9 +50,21 @@ namespace llvmcc {
// TOFIX: find a better name
static void UnpackValues (std::string const& from,
std::vector<std::string>& to);
+ };
+
+ // Join tools have an input file list associated with them.
+ class JoinTool : public Tool {
+ public:
+ void AddToJoinList(const llvm::sys::Path& P) { JoinList.push_back(P); }
+ void ClearJoinList() { JoinList.clear(); }
+
+ Action GenerateAction(const llvm::sys::Path& outFile) const
+ { return GenerateAction(JoinList, outFile); }
+ // We shouldn't shadow GenerateAction from the base class.
+ using Tool::GenerateAction;
- virtual ~Tool()
- {}
+ private:
+ PathVector JoinList;
};
}