9#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CLANG_H
10#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_CLANG_H
16#include "llvm/Frontend/Debug/Options.h"
17#include "llvm/Option/Option.h"
18#include "llvm/Support/raw_ostream.h"
19#include "llvm/TargetParser/Triple.h"
34 static const char *getBaseInputName(
const llvm::opt::ArgList &Args,
36 static const char *getBaseInputStem(
const llvm::opt::ArgList &Args,
38 static const char *getDependencyFileName(
const llvm::opt::ArgList &Args,
43 const Driver &
D,
const llvm::opt::ArgList &Args,
44 llvm::opt::ArgStringList &CmdArgs,
48 void RenderTargetOptions(
const llvm::Triple &EffectiveTriple,
49 const llvm::opt::ArgList &Args,
bool KernelOrKext,
50 llvm::opt::ArgStringList &CmdArgs)
const;
52 void AddAArch64TargetArgs(
const llvm::opt::ArgList &Args,
53 llvm::opt::ArgStringList &CmdArgs)
const;
54 void AddARMTargetArgs(
const llvm::Triple &Triple,
55 const llvm::opt::ArgList &Args,
56 llvm::opt::ArgStringList &CmdArgs,
57 bool KernelOrKext)
const;
58 void AddARM64TargetArgs(
const llvm::opt::ArgList &Args,
59 llvm::opt::ArgStringList &CmdArgs)
const;
60 void AddLoongArchTargetArgs(
const llvm::opt::ArgList &Args,
61 llvm::opt::ArgStringList &CmdArgs)
const;
62 void AddMIPSTargetArgs(
const llvm::opt::ArgList &Args,
63 llvm::opt::ArgStringList &CmdArgs)
const;
64 void AddPPCTargetArgs(
const llvm::opt::ArgList &Args,
65 llvm::opt::ArgStringList &CmdArgs)
const;
66 void AddR600TargetArgs(
const llvm::opt::ArgList &Args,
67 llvm::opt::ArgStringList &CmdArgs)
const;
68 void AddRISCVTargetArgs(
const llvm::opt::ArgList &Args,
69 llvm::opt::ArgStringList &CmdArgs)
const;
70 void AddSparcTargetArgs(
const llvm::opt::ArgList &Args,
71 llvm::opt::ArgStringList &CmdArgs)
const;
72 void AddSystemZTargetArgs(
const llvm::opt::ArgList &Args,
73 llvm::opt::ArgStringList &CmdArgs)
const;
74 void AddX86TargetArgs(
const llvm::opt::ArgList &Args,
75 llvm::opt::ArgStringList &CmdArgs)
const;
76 void AddHexagonTargetArgs(
const llvm::opt::ArgList &Args,
77 llvm::opt::ArgStringList &CmdArgs)
const;
78 void AddLanaiTargetArgs(
const llvm::opt::ArgList &Args,
79 llvm::opt::ArgStringList &CmdArgs)
const;
80 void AddWebAssemblyTargetArgs(
const llvm::opt::ArgList &Args,
81 llvm::opt::ArgStringList &CmdArgs)
const;
82 void AddVETargetArgs(
const llvm::opt::ArgList &Args,
83 llvm::opt::ArgStringList &CmdArgs)
const;
85 enum RewriteKind { RK_None, RK_Fragile, RK_NonFragile };
87 ObjCRuntime AddObjCRuntimeArgs(
const llvm::opt::ArgList &args,
89 llvm::opt::ArgStringList &cmdArgs,
90 RewriteKind rewrite)
const;
92 void AddClangCLArgs(
const llvm::opt::ArgList &Args,
types::ID InputType,
93 llvm::opt::ArgStringList &CmdArgs)
const;
95 mutable std::unique_ptr<llvm::raw_fd_ostream> CompilationDatabase =
nullptr;
99 const llvm::opt::ArgList &Args)
const;
101 void DumpCompilationDatabaseFragmentToDir(
103 const InputInfo &Input,
const llvm::opt::ArgList &Args)
const;
117 const llvm::opt::ArgList &TCArgs,
118 const char *LinkingOutput)
const override;
125 :
Tool(
"clang::as",
"clang integrated assembler", TC) {}
126 void AddLoongArchTargetArgs(
const llvm::opt::ArgList &Args,
127 llvm::opt::ArgStringList &CmdArgs)
const;
128 void AddMIPSTargetArgs(
const llvm::opt::ArgList &Args,
129 llvm::opt::ArgStringList &CmdArgs)
const;
130 void AddX86TargetArgs(
const llvm::opt::ArgList &Args,
131 llvm::opt::ArgStringList &CmdArgs)
const;
132 void AddRISCVTargetArgs(
const llvm::opt::ArgList &Args,
133 llvm::opt::ArgStringList &CmdArgs)
const;
140 const llvm::opt::ArgList &TCArgs,
141 const char *LinkingOutput)
const override;
148 :
Tool(
"offload bundler",
"clang-offload-bundler", TC) {}
153 const llvm::opt::ArgList &TCArgs,
154 const char *LinkingOutput)
const override;
158 const llvm::opt::ArgList &TCArgs,
159 const char *LinkingOutput)
const override;
166 :
Tool(
"Offload::Packager",
"clang-offload-packager", TC) {}
171 const llvm::opt::ArgList &TCArgs,
172 const char *LinkingOutput)
const override;
181 :
Tool(
"Offload::Linker",
"linker", TC), Linker(Linker) {}
186 const llvm::opt::ArgList &TCArgs,
187 const char *LinkingOutput)
const override;
193 const llvm::opt::ArgList &Args,
194 llvm::opt::Arg *&Arg);
209 const char *BaseInput);
llvm::MachO::Target Target
The basic abstraction for the target Objective-C runtime.
Compilation - A set of tasks to perform for a single driver invocation.
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
The JSON file list parser is used to communicate input to InstallAPI.