This change implements getHostCPUFeatures function to enable this functionality on Windows on ARM64. Unittest isn't included for this patch, since I'm not able to see how to reasonably write one, and I couldn't find any existing testcases related to it.
Details
Diff Detail
Event Timeline
Hi Michael,
This is my first contribution into llvm, and I'm not sure if I should add someone else to reviewers.
Could you look at this? Or could you suggest anyone?
Many thanks,
Adam
For what it's worth I think that this looks right. I can't find a convenient link to the Microsoft documentation that defines the PF_ARM_* defines. However looking at https://groups.google.com/a/chromium.org/forum/#!topic/crashpad-dev/yZ2RV3mIkPY they look correct and complete. I think Martin Storsjo has done a lot of work on Windows support in LLVM, I'd defer to him for approval.
Another set of people that might be able to help are those that do the Win32 support in Clang for X86. Reid Kleckner comes to mind as one of the main contributors.
lib/Support/Host.cpp | ||
---|---|---|
1515 | This should be defined(_WIN32) && (defined(__aarch64__) || defined(_M_ARM64)), otherwise it won't be used by MSVC. Also, those PF_* constants are missing in mingw-w64; I'll have to add them there in order not to break builds with such headers. |
lib/Support/Host.cpp | ||
---|---|---|
1515 | As Win32 API is called here, a single check on _M_ARM64 would be enough for clang and MSVC, but I am not sure for mingw-w64. |
lib/Support/Host.cpp | ||
---|---|---|
1515 | In general terms, the _M_* defines aren't predefied by clang in MinGW mode, or GCC. The MinGW headers do define _M_* defines though (but exactly which header defines them differs between mingw.org and mingw-w64 headers). It's good practice to always check for both arch defines in sync (except for strictly msvc/clang-cl cases, i.e. ifdef _MSC_VER), for consistency. |
Martin, Tom thanks for your comment.
Martin, I've updated the diff based on your review.
This should be defined(_WIN32) && (defined(__aarch64__) || defined(_M_ARM64)), otherwise it won't be used by MSVC.
Also, those PF_* constants are missing in mingw-w64; I'll have to add them there in order not to break builds with such headers.