summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains/MSVC.h
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-03-15 16:07:35 +0000
committerZachary Turner <zturner@google.com>2017-03-15 16:07:35 +0000
commitf6302523490cbd154aa98ce31b25ba5e77da9371 (patch)
treeb360f3113ea87e73aa868a50b8ea5a5127b20549 /clang/lib/Driver/ToolChains/MSVC.h
parent20055d4cd2396c0bcd51063b224e12adf7a21f07 (diff)
downloadbcm5719-llvm-f6302523490cbd154aa98ce31b25ba5e77da9371.tar.gz
bcm5719-llvm-f6302523490cbd154aa98ce31b25ba5e77da9371.zip
Update clang-cl driver for MSVC 2017.
2017 changes the way you find an installed copy of Visual Studio as well as its internal directory layout. As a result, clang-cl was unable to find VS2017 even when you had run vcvarsall to set up a toolchain environment. This patch updates everything for 2017 and cleans up the way we handle a tiered search a la environment -> installation -> PATH for which copy of Visual Studio to bind to. Patch originally by Hamza Sood, with some fixups for landing. Differential Revision: https://reviews.llvm.org/D30758 llvm-svn: 297851
Diffstat (limited to 'clang/lib/Driver/ToolChains/MSVC.h')
-rw-r--r--clang/lib/Driver/ToolChains/MSVC.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/clang/lib/Driver/ToolChains/MSVC.h b/clang/lib/Driver/ToolChains/MSVC.h
index 2b2f3e2d204..f11256d8f9c 100644
--- a/clang/lib/Driver/ToolChains/MSVC.h
+++ b/clang/lib/Driver/ToolChains/MSVC.h
@@ -78,6 +78,22 @@ public:
bool isPIEDefault() const override;
bool isPICDefaultForced() const override;
+ enum class SubDirectoryType {
+ Bin,
+ Include,
+ Lib,
+ };
+ std::string getSubDirectoryPath(SubDirectoryType Type,
+ llvm::Triple::ArchType TargetArch) const;
+
+ // Convenience overload.
+ // Uses the current target arch.
+ std::string getSubDirectoryPath(SubDirectoryType Type) const {
+ return getSubDirectoryPath(Type, getArch());
+ }
+
+ bool getIsVS2017OrNewer() const { return IsVS2017OrNewer; }
+
void
AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
@@ -88,17 +104,10 @@ public:
void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
- bool getWindowsSDKDir(std::string &path, int &major,
- std::string &windowsSDKIncludeVersion,
- std::string &windowsSDKLibVersion) const;
bool getWindowsSDKLibraryPath(std::string &path) const;
/// \brief Check if Universal CRT should be used if available
- bool useUniversalCRT(std::string &visualStudioDir) const;
- bool getUniversalCRTSdkDir(std::string &path, std::string &ucrtVersion) const;
bool getUniversalCRTLibraryPath(std::string &path) const;
- bool getVisualStudioInstallDir(std::string &path) const;
- bool getVisualStudioBinariesFolder(const char *clangProgramPath,
- std::string &path) const;
+ bool useUniversalCRT() const;
VersionTuple
computeMSVCVersion(const Driver *D,
const llvm::opt::ArgList &Args) const override;
@@ -120,9 +129,8 @@ protected:
Tool *buildLinker() const override;
Tool *buildAssembler() const override;
private:
- VersionTuple getMSVCVersionFromTriple() const;
- VersionTuple getMSVCVersionFromExe() const;
-
+ std::string VCToolChainPath;
+ bool IsVS2017OrNewer;
CudaInstallationDetector CudaInstallation;
};
OpenPOWER on IntegriCloud