This is an archive of the discontinued LLVM Phabricator instance.

Support: Add utility functions to get MSVC/WinSDK installation paths.
Needs ReviewPublic

Authored by ruiu on Sep 3 2015, 12:50 PM.

Details

Reviewers
rnk
Summary

This is a patch to move code from tools/clang/lib/Driver/MSVCToolChain.cpp
to LLVM, so that we can use this functionality in LLD as well.

Diff Detail

Event Timeline

ruiu updated this revision to Diff 33964.Sep 3 2015, 12:50 PM
ruiu retitled this revision from to Support: Add utility functions to get MSVC/WinSDK installation paths..
ruiu updated this object.
ruiu added a reviewer: rnk.
ruiu set the repository for this revision to rL LLVM.
ruiu added a subscriber: llvm-commits.
majnemer added inline comments.
lib/Support/MSVC.cpp
29–31

Can this be fixed now that we are sinking the code into LLVM?

rnk edited edge metadata.Sep 3 2015, 1:02 PM

Can you move the win32 specific stuff into lib/Support/Windows/MSVC.inc? The Unix stub side can stay in MSVC.cpp, it's small enough it doesn't need to be pulled out.

See this comment in llvm/lib/Support/Windows/WindowsSupport.h:

// This file defines things specific to Windows implementations.  In addition to
// providing some helpers for working with win32 APIs, this header wraps
// <windows.h> with some portability macros.  Always include WindowsSupport.h
// instead of including <windows.h> directly.
lib/Support/MSVC.cpp
29–31

I'd fix it separately and keep this as a simple code motion. getSystemRegistryString needs to be rewritten anyway.

rnk added a comment.Sep 3 2015, 1:26 PM

You probably want to sink MSVCToolChain::getWindowsSDKLibraryPath() as well.

ruiu updated this revision to Diff 33972.Sep 3 2015, 2:11 PM
ruiu edited edge metadata.
ruiu removed rL LLVM as the repository for this revision.

Also list getWindowsSDKLibraryPath

rnk added inline comments.Sep 3 2015, 6:03 PM
lib/Support/MSVC.cpp
25

This is still an issue?

280

You need a stub for getWindowsSDKLibraryPath, right?

Please note, I've made additional changes to the original code to support Windows 10 SDK, see D12832.