-
Notifications
You must be signed in to change notification settings - Fork 344
[lldb] Make use of target triple in TypeSystemSwiftTypeRef #6692
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
[lldb] Make use of target triple in TypeSystemSwiftTypeRef #6692
Conversation
@swift-ci test |
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 have only one minor, but important comment about the unreachable.
return module->GetArchitecture().GetTriple(); | ||
else if (auto target_sp = GetTargetWP().lock()) | ||
return target_sp->GetArchitecture().GetTriple(); | ||
llvm_unreachable("Expected module or target"); |
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.
This should be reachable if you run type system queries without a target. There is nothing in the SBAPI that prevents someone from doing this, so we shouldn't crash. Maybe lldb_assert() or logging?
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.
thanks. It's now changed to a log.
else | ||
assert(false && "Expected module or target"); | ||
|
||
llvm::Triple triple = GetTriple(); |
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.
This lgtm.
@swift-ci test |
@swift-ci test windows |
1 similar comment
@swift-ci test windows |
@adrian-prantl after removing this assert, is this good? |
Update `TypeSystemSwiftTypeRef::GetTriple` to make use of an available target. With this change, `GetNameImporter` can work in more cases, since it only needs a triple. And since `GetNameImporter` can be expected to return a `ClangNameImporter` instance, the fallback to using Swift ASTContexts can be removed. This eliminates another case of unnecessarily loading Swift ASTContexts, which incurs a one time overhead that should only be paid when required. Partial follow up to #6654 (cherry-picked from commit f097595)
…6790) Update `TypeSystemSwiftTypeRef::GetTriple` to make use of an available target. With this change, `GetNameImporter` can work in more cases, since it only needs a triple. And since `GetNameImporter` can be expected to return a `ClangNameImporter` instance, the fallback to using Swift ASTContexts can be removed. This eliminates another case of unnecessarily loading Swift ASTContexts, which incurs a one time overhead that should only be paid when required. Partial follow up to #6654 (cherry-picked from commit f097595)
Update
TypeSystemSwiftTypeRef::GetTriple
to make use of an available target.With this change,
GetNameImporter
can work in more cases, since it only needs a triple. And sinceGetNameImporter
can be expected to return aClangNameImporter
instance, the fallback to using Swift ASTContexts can be removed.This eliminates another case of unnecessarily loading Swift ASTContexts, which incurs a one time overhead that should only be paid when required.
Partial follow up to #6654