9#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_MSVC_H
10#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_MSVC_H
18#include "llvm/Frontend/Debug/Options.h"
19#include "llvm/WindowsDriver/MSVCPaths.h"
26namespace visualstudio {
27class LLVM_LIBRARY_VISIBILITY
Linker final :
public Tool {
36 const llvm::opt::ArgList &TCArgs,
37 const char *LinkingOutput)
const override;
48 const llvm::opt::ArgList &Args);
50 llvm::opt::DerivedArgList *
51 TranslateArgs(
const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
55 getDefaultUnwindTableLevel(
const llvm::opt::ArgList &Args)
const override;
56 bool isPICDefault()
const override;
57 bool isPIEDefault(
const llvm::opt::ArgList &Args)
const override;
58 bool isPICDefaultForced()
const override;
64 return getTriple().isOSBinFormatCOFF() ? llvm::codegenoptions::DIF_CodeView
65 : llvm::codegenoptions::DIF_DWARF;
71 return llvm::DebuggerKind::Default;
78 std::string getSubDirectoryPath(llvm::SubDirectoryType
Type,
79 llvm::StringRef SubdirParent =
"")
const;
80 std::string getSubDirectoryPath(llvm::SubDirectoryType
Type,
81 llvm::Triple::ArchType TargetArch)
const;
84 return VSLayout == llvm::ToolsetLayout::VS2017OrNewer;
88 AddClangSystemIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
89 llvm::opt::ArgStringList &CC1Args)
const override;
90 void AddClangCXXStdlibIncludeArgs(
91 const llvm::opt::ArgList &DriverArgs,
92 llvm::opt::ArgStringList &CC1Args)
const override;
94 void AddCudaIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
95 llvm::opt::ArgStringList &CC1Args)
const override;
97 void AddHIPIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
98 llvm::opt::ArgStringList &CC1Args)
const override;
100 void AddHIPRuntimeLibArgs(
const llvm::opt::ArgList &Args,
101 llvm::opt::ArgStringList &CmdArgs)
const override;
103 bool getWindowsSDKLibraryPath(
104 const llvm::opt::ArgList &Args, std::string &path)
const;
105 bool getUniversalCRTLibraryPath(
const llvm::opt::ArgList &Args,
106 std::string &path)
const;
107 bool useUniversalCRT()
const;
109 computeMSVCVersion(
const Driver *
D,
110 const llvm::opt::ArgList &Args)
const override;
112 std::string ComputeEffectiveClangTriple(
const llvm::opt::ArgList &Args,
116 void printVerboseInfo(raw_ostream &OS)
const override;
121 addClangTargetOptions(
const llvm::opt::ArgList &DriverArgs,
122 llvm::opt::ArgStringList &CC1Args,
126 void AddSystemIncludeWithSubfolder(
const llvm::opt::ArgList &DriverArgs,
127 llvm::opt::ArgStringList &CC1Args,
128 const std::string &folder,
129 const Twine &subfolder1,
130 const Twine &subfolder2 =
"",
131 const Twine &subfolder3 =
"")
const;
133 Tool *buildLinker()
const override;
134 Tool *buildAssembler()
const override;
136 std::optional<llvm::StringRef> WinSdkDir, WinSdkVersion, WinSysRoot;
137 std::string VCToolChainPath;
138 llvm::ToolsetLayout VSLayout = llvm::ToolsetLayout::OlderVS;
Simple wrapper for toolchain detector with costly initialization.
The base class of the type hierarchy.
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.