1 //===--- Tool.h - Compilation Tools -----------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef CLANG_DRIVER_TOOL_H_
11 #define CLANG_DRIVER_TOOL_H_
13 #include "clang/Basic/LLVM.h"
30 typedef SmallVector<InputInfo, 4> InputInfoList;
32 /// Tool - Information on a specific compilation tool.
34 /// The tool name (for debugging).
37 /// The human readable name for the tool, for use in diagnostics.
38 const char *ShortName;
40 /// The tool chain this tool is a part of.
41 const ToolChain &TheToolChain;
44 Tool(const char *Name, const char *ShortName,
50 const char *getName() const { return Name; }
52 const char *getShortName() const { return ShortName; }
54 const ToolChain &getToolChain() const { return TheToolChain; }
56 virtual bool hasIntegratedAssembler() const { return false; }
57 virtual bool hasIntegratedCPP() const = 0;
58 virtual bool isLinkJob() const { return false; }
59 virtual bool isDsymutilJob() const { return false; }
61 /// \brief Does this tool have "good" standardized diagnostics, or should the
62 /// driver add an additional "command failed" diagnostic on failures.
63 virtual bool hasGoodDiagnostics() const { return false; }
65 /// ConstructJob - Construct jobs to perform the action \p JA,
66 /// writing to \p Output and with \p Inputs, and add the jobs to
69 /// \param TCArgs - The argument list for this toolchain, with any
70 /// tool chain specific translations applied.
71 /// \param LinkingOutput - If this output will eventually feed the
72 /// linker, then this is the final output name of the linked image.
73 virtual void ConstructJob(Compilation &C, const JobAction &JA,
74 const InputInfo &Output,
75 const InputInfoList &Inputs,
76 const llvm::opt::ArgList &TCArgs,
77 const char *LinkingOutput) const = 0;
80 } // end namespace driver
81 } // end namespace clang