-
Notifications
You must be signed in to change notification settings - Fork 1
Swift: move patches from extractor code #3
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
diff --git a/include/swift/AST/Stmt.h b/include/swift/AST/Stmt.h | ||
index 532e038c386..f013eee2f98 100644 | ||
--- a/include/swift/AST/Stmt.h | ||
+++ b/include/swift/AST/Stmt.h | ||
@@ -920,7 +920,6 @@ public: | ||
/// Get the CaseStmt block to which the fallthrough transfers control. | ||
/// Set during Sema. | ||
CaseStmt *getFallthroughDest() const { | ||
- assert(FallthroughDest && "fallthrough dest is not set until Sema"); | ||
return FallthroughDest; | ||
} | ||
void setFallthroughDest(CaseStmt *C) { | ||
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp | ||
index 75b99a22e73..09115678a82 100644 | ||
--- a/lib/AST/Decl.cpp | ||
+++ b/lib/AST/Decl.cpp | ||
@@ -1725,7 +1725,10 @@ StringRef PatternBindingEntry::getInitStringRepresentation( | ||
|
||
SourceRange PatternBindingDecl::getSourceRange() const { | ||
SourceLoc startLoc = getStartLoc(); | ||
- SourceLoc endLoc = getPatternList().back().getSourceRange().End; | ||
+ SourceLoc endLoc = startLoc; | ||
+ if (!getPatternList().empty()) { | ||
+ endLoc = getPatternList().back().getSourceRange().End; | ||
+ } | ||
if (startLoc.isValid() != endLoc.isValid()) return SourceRange(); | ||
return { startLoc, endLoc }; | ||
} |
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 actually be good to split this diff in multiple patch files with a header in each explaining why the change was needed, also to aid resolving possible future conflicts. The assertion removal btw is because that assertion might get hit on compilation errors
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.
Good idea, let's split these next time we have to touch the patches.
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 we have a draft of this change without rebuilding everything, just for the record for the next time?
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.
Drafting the change would require a build, otherwise we can just break something? 🤔
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.
Let's revise it when we work on the bootstrapping, it would likely require some more changes/patches so it's a perfect time to improve this.
No description provided.