#include "MSVC.h"
#include "CommonArgs.h"
#include "Darwin.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Basic/Version.h"
#include "clang/Config/config.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/Options.h"
#include "clang/Driver/SanitizerArgs.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/TargetParser/Host.h"
#include <cstdio>
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#define NOGDI
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#endif
usingnamespaceclang::driver;
usingnamespaceclang::driver::toolchains;
usingnamespaceclang::driver::tools;
usingnamespaceclang;
usingnamespacellvm::opt;
static bool canExecute(llvm::vfs::FileSystem &VFS, StringRef Path) { … }
static std::string FindVisualStudioExecutable(const ToolChain &TC,
const char *Exe) { … }
void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
const ArgList &Args,
const char *LinkingOutput) const { … }
MSVCToolChain::MSVCToolChain(const Driver &D, const llvm::Triple &Triple,
const ArgList &Args)
: … { … }
Tool *MSVCToolChain::buildLinker() const { … }
Tool *MSVCToolChain::buildAssembler() const { … }
ToolChain::UnwindTableLevel
MSVCToolChain::getDefaultUnwindTableLevel(const ArgList &Args) const { … }
bool MSVCToolChain::isPICDefault() const { … }
bool MSVCToolChain::isPIEDefault(const llvm::opt::ArgList &Args) const { … }
bool MSVCToolChain::isPICDefaultForced() const { … }
void MSVCToolChain::AddCudaIncludeArgs(const ArgList &DriverArgs,
ArgStringList &CC1Args) const { … }
void MSVCToolChain::AddHIPIncludeArgs(const ArgList &DriverArgs,
ArgStringList &CC1Args) const { … }
void MSVCToolChain::AddHIPRuntimeLibArgs(const ArgList &Args,
ArgStringList &CmdArgs) const { … }
void MSVCToolChain::printVerboseInfo(raw_ostream &OS) const { … }
std::string
MSVCToolChain::getSubDirectoryPath(llvm::SubDirectoryType Type,
llvm::StringRef SubdirParent) const { … }
std::string
MSVCToolChain::getSubDirectoryPath(llvm::SubDirectoryType Type,
llvm::Triple::ArchType TargetArch) const { … }
bool MSVCToolChain::getWindowsSDKLibraryPath(const ArgList &Args,
std::string &path) const { … }
bool MSVCToolChain::useUniversalCRT() const { … }
bool MSVCToolChain::getUniversalCRTLibraryPath(const ArgList &Args,
std::string &Path) const { … }
static VersionTuple getMSVCVersionFromExe(const std::string &BinDir) { … }
void MSVCToolChain::AddSystemIncludeWithSubfolder(
const ArgList &DriverArgs, ArgStringList &CC1Args,
const std::string &folder, const Twine &subfolder1, const Twine &subfolder2,
const Twine &subfolder3) const { … }
void MSVCToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
ArgStringList &CC1Args) const { … }
void MSVCToolChain::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
ArgStringList &CC1Args) const { … }
VersionTuple MSVCToolChain::computeMSVCVersion(const Driver *D,
const ArgList &Args) const { … }
std::string
MSVCToolChain::ComputeEffectiveClangTriple(const ArgList &Args,
types::ID InputType) const { … }
SanitizerMask MSVCToolChain::getSupportedSanitizers() const { … }
static void TranslateOptArg(Arg *A, llvm::opt::DerivedArgList &DAL,
bool SupportsForcingFramePointer,
const char *ExpandChar, const OptTable &Opts) { … }
static void TranslateDArg(Arg *A, llvm::opt::DerivedArgList &DAL,
const OptTable &Opts) { … }
static void TranslatePermissive(Arg *A, llvm::opt::DerivedArgList &DAL,
const OptTable &Opts) { … }
static void TranslatePermissiveMinus(Arg *A, llvm::opt::DerivedArgList &DAL,
const OptTable &Opts) { … }
llvm::opt::DerivedArgList *
MSVCToolChain::TranslateArgs(const llvm::opt::DerivedArgList &Args,
StringRef BoundArch,
Action::OffloadKind OFK) const { … }
void MSVCToolChain::addClangTargetOptions(
const ArgList &DriverArgs, ArgStringList &CC1Args,
Action::OffloadKind DeviceOffloadKind) const { … }