-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Opt remarks: emit remarks when we fail to serialize a function in CMO. #73657
base: main
Are you sure you want to change the base?
Conversation
@@ -274,6 +274,9 @@ def Raccess_note : Separate<["-"], "Raccess-note">, | |||
def Raccess_note_EQ : Joined<["-"], "Raccess-note=">, | |||
Alias<Raccess_note>; | |||
|
|||
def Rserialization_failed : Flag<["-"], "serialization-failed">, |
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.
Missing an R
here, and the name could probably be improved anyway.
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.
Maybe:
cross-module-optimization-serialization-failed
Remark if we failed to serialize a function for the purpose of cross module optimization
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.
Sounds good to me.
Nitpick: 2-space indentation. |
return; | ||
|
||
auto &ctx = i->getModule().getASTContext(); | ||
auto joined = remark.str() + other.str(); |
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.
Could you use llvm::Twine
for string concatenation.
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.
I'm going to need to turn it into a string anyway to then turn it into a StringRef
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.
And then I think we need to globally allocate it in the AST context so that it's not deallocated by the time the diagnostic fires
return false; | ||
|
||
auto &ctx = f->getModule().getASTContext(); | ||
auto joined = remark.str() + other.str(); |
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.
Same here: could you use llvm::Twine
for string concatenation?
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.
Thank you for adding these! Some minor nitpicks.
Thanks for the review comments! |
@swift-ci please smoke test |
@swift-ci smoke test |
@swift-ci smoke test |
No description provided.