-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
|
|
||
| #include "swift/Basic/LLVM.h" | ||
| #include <memory> | ||
| #include <string> | ||
|
|
||
| namespace swift { | ||
| class Decl; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -485,14 +485,23 @@ class CastOptimizer { | |
|
|
||
| public: | ||
| CastOptimizer(std::function<void (SILInstruction *I, ValueBase *V)> ReplaceInstUsesAction, | ||
|
||
| std::function<void (SILInstruction *)> EraseAction = [](SILInstruction*){}, | ||
| std::function<void ()> WillSucceedAction = [](){}, | ||
| std::function<void (SILInstruction *)> EraseAction, | ||
| std::function<void ()> WillSucceedAction, | ||
| std::function<void ()> WillFailAction = [](){}) | ||
| : ReplaceInstUsesAction(ReplaceInstUsesAction), | ||
| EraseInstAction(EraseAction), | ||
| WillSucceedAction(WillSucceedAction), | ||
| WillFailAction(WillFailAction) {} | ||
|
|
||
| // This constructor is used in | ||
| // 'SILOptimizer/Mandatory/ConstantPropagation.cpp'. MSVC2015 compiler | ||
| // couldn't use the single constructor version which has three default | ||
| // arguments. It seems the number of the default argument with lambda is | ||
| // limited. | ||
| CastOptimizer(std::function<void (SILInstruction *I, ValueBase *V)> ReplaceInstUsesAction, | ||
| std::function<void (SILInstruction *)> EraseAction = [](SILInstruction*){}) | ||
| : CastOptimizer(ReplaceInstUsesAction, EraseAction, [](){}, [](){}) {} | ||
|
|
||
| /// Simplify checked_cast_br. It may change the control flow. | ||
| SILInstruction * | ||
| simplifyCheckedCastBranchInst(CheckedCastBranchInst *Inst); | ||
|
|
||
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.
It might be better to change
ProcessIdto use astdinttypedef.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.
ProcessId in swift defined as
typedef llvm::sys::ProcessInfo::ProcessId ProcessId;.LLVM ProcessInfo coded.
Changing ProcessId in swift means changing or ignoring LLVM definition.
I think reusing the LLVM definition is better.
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.
Yeah, you're right. Understandable that LLVM wouldn't want to include all of windows.h just for
DWORD.