forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 341
[lldb] Assortment of cherry-picks from upstream LLVM #10866
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
adrian-prantl
merged 5 commits into
swift/release/6.2
from
lldb/ir-checker-changes-to-6.2
Jun 20, 2025
Merged
[lldb] Assortment of cherry-picks from upstream LLVM #10866
adrian-prantl
merged 5 commits into
swift/release/6.2
from
lldb/ir-checker-changes-to-6.2
Jun 20, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Michael137
commented
Jun 18, 2025
- IR checker changes
- Fix for upcoming [libc++] Avoid type-punning between __hash_value_type and pair llvm/llvm-project#143501
- Fix for [lldb] wrong std::deque size llvm/llvm-project#144555
Currently when jitting expressions, LLDB scans the IR instructions of the `$__lldb_expr` and will insert a call to a utility function for each load/store instruction. The purpose of the utility funciton is to dereference the load/store operand. If that operand was an invalid pointer the utility function would trap and LLDB asks the IR checker whether it was responsible for the trap, in which case it prints out an error message saying the expression dereferenced an invalid pointer. This is a lot of setup for not much gain. In fact, creating/running this utility expression shows up as ~2% of the expression evaluation time (though we cache them for subsequent expressions). And the error message we get out of it is arguably less useful than if we hadn't instrumented the IR. It was also untested. Before: ``` (lldb) expr int a = *returns_invalid_ptr() error: Execution was interrupted, reason: Attempted to dereference an invalid pointer.. The process has been returned to the state before expression evaluation. ``` After: ``` (lldb) expr int a = *returns_invalid_ptr() error: Expression execution was interrupted: EXC_BAD_ACCESS (code=1, address=0x5). The process has been returned to the state before expression evaluation. ``` This patch removes this IR checker. (cherry picked from commit 0a7b0c8)
…argets/frames (llvm#144503) There's no need to create this utility function (and run it) for targets/frames that aren't Objective-C/Objective-C++. (cherry picked from commit 4ced29b)
…le::value_type (llvm#144517) llvm#143501 changes usage of `__hash_value_type` in libcxx to an empty tag type. This type will no longer have a definition in DWARF. Currently the LLDB unordered_map formatter deduces the map's `element_type` by looking at the `__cc_` member of `__hash_value_type`. But that will no longer work because we only have its forward declaration. Since what we're really after is the type that `__hash_value_type` is wrapping, we can just look at the `__hash_table::value_type` typedef. With llvm#143501 that will now point to the `std::pair` element type (which used to be what we got from `__cc_`). TBD: need to double-check this works for older layouts. Quick glance at the code makes me suspicious of cases like `unordered_map<std::pair<int, int>, int>` (cherry picked from commit 382e3fd)
…ng changes Cherry-picked the LLDB parts from: ``` commit c7df106 Author: Peng Liu <[email protected]> Date: Wed Nov 13 05:08:08 2024 -0500 Unify naming of internal pointer members in std::vector and std::__split_buffer (llvm#115517) ``` Addresses llvm#144555
@swift-ci test |
adrian-prantl
approved these changes
Jun 18, 2025
Not entirely sure if that test failure is related. |
@swift-ci test macOS |
failing test was in https://ci.swift.org/job/apple-llvm-project-pr-macos/7613/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.