-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[swiftc/msvc] Compiling with MSVC library #1516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
include/swift/Basic/Malloc.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can trim down this fixme a bit now.
Why is that interesting to support? If you can use clang, why not use clang in its native mode? |
|
For build and link with MS C runtime library, including their headers are necessary. Without ms-compatibility mode, they are cannot be compiled. |
|
Could we use native Clang mode for swiftc, but MS compatibility mode for the runtime? |
|
Or could we avoid needing to parse Visual C++'s libraries by using libc++? Do pure C |
|
I'm confused about options in comments. |
|
Sounds good. AIUI |
c4d8a86 to
49b47a9
Compare
|
After remove -fms-compatibility option, some files can be removed from PR. Also, I modified some comments and rebranched. |
lib/Immediate/Immediate.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a macro, can we use a wrapper function with a conditional implementation?
|
After removing But the patch which the Two or more default parameters of functional in constructor were not resolved. Removing ifdefs in |
|
For the patch of |
|
The error of By verifying Anyway, we will not use the compatibility option, no problem. |
|
For the patch of I have two clang version for Windows. MS clang and MS cl compiler recognize well two or more functional default parameter in constructor. I cannot use MS clang for |
|
@tinysun212 Can you smoosh together the patches? |
|
Do we really need to make any changes to the compiler? Why can't we use |
e260fb6 to
25e2b92
Compare
|
Ping? |
|
@jxyang has more changes than me in his repository. |
|
@gribozavr, The difference between To build the compiler Unfortunately, the option |
|
ping? |
|
@tinysun212 It looks like you have merge conflicts. Could you please rebase onto master. |
lib/Basic/TaskQueue.cpp
Outdated
|
|
||
| // Include the correct TaskQueue implementation. | ||
| #if LLVM_ON_UNIX && !defined(__CYGWIN__) | ||
| #if LLVM_ON_UNIX && !defined(__CYGWIN__) && !defined(_MSC_VER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is LLVM_ON_UNIX even set for MSVC?
25e2b92 to
3a3b1d8
Compare
|
@CodaFi, @jrose-apple, thanks for your reviews, it is rebased and changed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I ask why this change was necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the clang with the ms-extension option (not ms-compatibility option), the line of the constructor having two default value of dummy lambda expression is compiled, but three default value constructor is not compiled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's very strange. Mind leaving a comment before I merge?
|
Looks reasonable to me. Thanks, @tinysun212! @swift-ci Please test |
Some modifications for the ms-extension option of the clang.exe in the Visual Studio 2015 development environment This patch is only for swiftc.exe. I used the library set of Visual Studio 2015 Update 1 and recent version of swift-clang as the compiler. If you are using the real MSVC compiler, more patch might be required.
3a3b1d8 to
32ae84c
Compare
|
@jrose-apple, I applied your reviews. |
|
Thanks, merged! |
|
Thanks, this merging I have long awaited. ^^ |
What's in this pull request?
Some modifications for the ms-extension option of the clang.exe in the Visual Studio 2015 development environment
This patch is only for swiftc.exe. For the standard library or build script, other PR's will be used in later.
I used the library set of Visual Studio 2015 Update 1 and recent version of swift-clang as the compiler. If you are using the real MSVC compiler, more patch might be required.
Related bug number: (SR-34) Port Swift to Windows
Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
Validation Testing
Note: Only members of the Apple organization can trigger swift-ci.