From 2709e1a2c9f22762e966d1f51324281ff0122060 Mon Sep 17 00:00:00 2001 From: Mikhail Glushenkov Date: Tue, 6 May 2008 17:26:53 +0000 Subject: Add inward edge counters to Nodes; Associate JoinLists with JoinTools. llvm-svn: 50738 --- llvm/tools/llvmc2/Tool.h | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'llvm/tools/llvmc2/Tool.h') diff --git a/llvm/tools/llvmc2/Tool.h b/llvm/tools/llvmc2/Tool.h index 0d907dd83a8..5136468a43e 100644 --- a/llvm/tools/llvmc2/Tool.h +++ b/llvm/tools/llvmc2/Tool.h @@ -28,11 +28,14 @@ namespace llvmcc { class Tool : public llvm::RefCountedBaseVPTR { 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& 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; }; } -- cgit v1.2.3