summaryrefslogtreecommitdiffstats
path: root/include/clang/Driver/Tool.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Driver/Tool.h')
-rw-r--r--include/clang/Driver/Tool.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/include/clang/Driver/Tool.h b/include/clang/Driver/Tool.h
new file mode 100644
index 0000000..d8b37e9
--- /dev/null
+++ b/include/clang/Driver/Tool.h
@@ -0,0 +1,69 @@
+//===--- Tool.h - Compilation Tools -----------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_DRIVER_TOOL_H_
+#define CLANG_DRIVER_TOOL_H_
+
+namespace llvm {
+ template<typename T, unsigned N> class SmallVector;
+}
+
+namespace clang {
+namespace driver {
+ class ArgList;
+ class Compilation;
+ class InputInfo;
+ class Job;
+ class JobAction;
+ class ToolChain;
+
+ typedef llvm::SmallVector<InputInfo, 4> InputInfoList;
+
+/// Tool - Information on a specific compilation tool.
+class Tool {
+ /// The tool name (for debugging).
+ const char *Name;
+
+ /// The tool chain this tool is a part of.
+ const ToolChain &TheToolChain;
+
+public:
+ Tool(const char *Name, const ToolChain &TC);
+
+public:
+ virtual ~Tool();
+
+ const char *getName() const { return Name; }
+
+ const ToolChain &getToolChain() const { return TheToolChain; }
+
+ virtual bool acceptsPipedInput() const = 0;
+ virtual bool canPipeOutput() const = 0;
+ virtual bool hasIntegratedCPP() const = 0;
+
+ /// ConstructJob - Construct jobs to perform the action \arg JA,
+ /// writing to \arg Output and with \arg Inputs.
+ ///
+ /// \param Dest - Where to put the resulting commands.
+ /// \param TCArgs - The argument list for this toolchain, with any
+ /// tool chain specific translations applied.
+ /// \param LinkingOutput - If this output will eventually feed the
+ /// linker, then this is the final output name of the linked image.
+ virtual void ConstructJob(Compilation &C, const JobAction &JA,
+ Job &Dest,
+ const InputInfo &Output,
+ const InputInfoList &Inputs,
+ const ArgList &TCArgs,
+ const char *LinkingOutput) const = 0;
+};
+
+} // end namespace driver
+} // end namespace clang
+
+#endif
OpenPOWER on IntegriCloud