diff options
author | thegeorg <thegeorg@yandex-team.com> | 2024-03-13 13:58:24 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.com> | 2024-03-13 14:11:53 +0300 |
commit | 11a895b7e15d1c5a1f52706396b82e3f9db953cb (patch) | |
tree | fabc6d883b0f946151f61ae7865cee9f529a1fdd /contrib/libs/clang16/include/clang/Driver/Tool.h | |
parent | 9685917341315774aad5733b1793b1e533a88bbb (diff) | |
download | ydb-11a895b7e15d1c5a1f52706396b82e3f9db953cb.tar.gz |
Export clang-format16 via ydblib project
6e6be3a95868fde888d801b7590af4044049563f
Diffstat (limited to 'contrib/libs/clang16/include/clang/Driver/Tool.h')
-rw-r--r-- | contrib/libs/clang16/include/clang/Driver/Tool.h | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/contrib/libs/clang16/include/clang/Driver/Tool.h b/contrib/libs/clang16/include/clang/Driver/Tool.h new file mode 100644 index 0000000000..df83eea2c2 --- /dev/null +++ b/contrib/libs/clang16/include/clang/Driver/Tool.h @@ -0,0 +1,108 @@ +#pragma once + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + +//===--- Tool.h - Compilation Tools -----------------------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_DRIVER_TOOL_H +#define LLVM_CLANG_DRIVER_TOOL_H + +#include "clang/Basic/LLVM.h" + +namespace llvm { +namespace opt { + class ArgList; +} +} + +namespace clang { +namespace driver { + + class Compilation; + class InputInfo; + class Job; + class JobAction; + class ToolChain; + + typedef SmallVector<InputInfo, 4> InputInfoList; + +/// Tool - Information on a specific compilation tool. +class Tool { + /// The tool name (for debugging). + const char *Name; + + /// The human readable name for the tool, for use in diagnostics. + const char *ShortName; + + /// The tool chain this tool is a part of. + const ToolChain &TheToolChain; + +public: + Tool(const char *Name, const char *ShortName, const ToolChain &TC); + +public: + virtual ~Tool(); + + const char *getName() const { return Name; } + + const char *getShortName() const { return ShortName; } + + const ToolChain &getToolChain() const { return TheToolChain; } + + virtual bool hasIntegratedAssembler() const { return false; } + virtual bool hasIntegratedBackend() const { return true; } + virtual bool canEmitIR() const { return false; } + virtual bool hasIntegratedCPP() const = 0; + virtual bool isLinkJob() const { return false; } + virtual bool isDsymutilJob() const { return false; } + + /// Does this tool have "good" standardized diagnostics, or should the + /// driver add an additional "command failed" diagnostic on failures. + virtual bool hasGoodDiagnostics() const { return false; } + + /// ConstructJob - Construct jobs to perform the action \p JA, + /// writing to \p Output and with \p Inputs, and add the jobs to + /// \p C. + /// + /// \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, + const InputInfo &Output, + const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const = 0; + /// Construct jobs to perform the action \p JA, writing to the \p Outputs and + /// with \p Inputs, and add the jobs to \p C. The default implementation + /// assumes a single output and is expected to be overloaded for the tools + /// that support multiple inputs. + /// + /// \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 ConstructJobMultipleOutputs(Compilation &C, const JobAction &JA, + const InputInfoList &Outputs, + const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const; +}; + +} // end namespace driver +} // end namespace clang + +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif |