summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit2709e1a2c9f22762e966d1f51324281ff0122060 (patch)
tree250e8e85b926334ca65357bfe3ee7c762a7a7165 /llvm/tools/llvmc2/Tool.h
parentee81aa3812b21b117c0604b8f19914874fe2b3f8 (diff)
downloadbcm5719-llvm-2709e1a2c9f22762e966d1f51324281ff0122060.tar.gz
bcm5719-llvm-2709e1a2c9f22762e966d1f51324281ff0122060.zip
Add inward edge counters to Nodes; Associate JoinLists with JoinTools.
llvm-svn: 50738
Diffstat (limited to 'llvm/tools/llvmc2/Tool.h')
-rw-r--r--llvm/tools/llvmc2/Tool.h27
1 files changed, 21 insertions, 6 deletions
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<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;
};
}
OpenPOWER on IntegriCloud