Skip to content

[rebranch] Fix various LLDB failures #3635

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

Merged
merged 2 commits into from
Dec 8, 2021

Conversation

bnbarham
Copy link

@bnbarham bnbarham commented Dec 7, 2021

Regenerate bindings static bindings since they need to be updated from the previous PR adding all the missing commits.

Also re-arrange some code to fix a failing test.

@bnbarham bnbarham requested a review from JDevlieghere December 7, 2021 04:49
@bnbarham
Copy link
Author

bnbarham commented Dec 7, 2021

@swift-ci please test

@bnbarham
Copy link
Author

bnbarham commented Dec 7, 2021

@JDevlieghere I'll need to cherry-pick bc53247 to next as well. Does that change seem reasonable to you? There were test failures because the upstream test doesn't expect the extra arg. To avoid conflicts in the future I re-arranged a bit and added a new method that contains the extra arg instead (which matches the extra CreateInstance that was already there).

@JDevlieghere
Copy link

Added Jim for a second opinion, but looks good to me.

@bnbarham
Copy link
Author

bnbarham commented Dec 7, 2021

@swift-ci please test


// BEGIN APPLE
llvm::Expected<TypeSystem &>
TypeSystemMap::GetTypeSystemForLanguage(lldb::LanguageType language,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the compiler options ever get used in the swift code anymore, so we don't really need this version either. It won't hurt anything to leave it in for now, but we should remove it at some point.

@@ -337,4 +346,4 @@ void TypeSystemMap::RemoveTypeSystemsForLanguage(lldb::LanguageType language) {
m_map.erase(pos);
}
}

// END APPLE

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have been using // BEGIN SWIFT & // END SWIFT, not APPLE. Was there a reason this was switched to APPLE, or just an oversight. It would be better to be consistent with these markers.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an oversight, not sure why I chose apple instead of swift 🤔. I can switch it back, though if you think it's not used anywhere I'm happy to just remove it entirely.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a use in lldb/source/Target/Target.cpp:GetScratchTypeSystemForLanguage which is used in lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp:CreateInstanceFromTarget. So maybe can't remove?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, you are right, we allow people to pass compiler options to the REPL compiler. For now we need this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, thanks for having a look :)! I'll merge this now then and cherry-pick that change to next as well.

Copy link

@jimingham jimingham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should consistently use SWIFT not APPLE for the swift specific code. After all, this is not specific to APPLE, but to SWIFT...

Other than that this looks fine. If you also fixed TypeSystem.h you could remote the last uses of compiler_options which so far as I can tell never gets used IRL. But the patch is also fine as it is.

There are some Apple-only changes that add an extra parameter to
`TypeSystemMap::GetTypeSystemForLanguage`. Add a separate method instead
(similar to `TypeSystem::CreateInstance`) and surround the code in
`BEGIN/END APPLE` blocks to make it clear they are Apple-only changes.

This also fixes compilation failures in
`lldb/unittests/Symbol/TestTypeSystem.cpp` since that can now use the
regular method instead.
@bnbarham bnbarham force-pushed the more-rebranch-failures branch from bc53247 to 2d3c7da Compare December 8, 2021 01:39
@bnbarham
Copy link
Author

bnbarham commented Dec 8, 2021

I've just updated to BEGIN/END SWIFT for now since there seems to be a few more uses.

@bnbarham bnbarham merged commit 6202aed into swiftlang:stable/20211026 Dec 8, 2021
@bnbarham bnbarham deleted the more-rebranch-failures branch December 8, 2021 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants