-
Notifications
You must be signed in to change notification settings - Fork 15k
Fix __apple_XXX iterator that iterates over all entries. #157538
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
Open
clayborg
wants to merge
7
commits into
llvm:main
Choose a base branch
from
clayborg:apple-names-iterator
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6e775b1
Fix __apple_XXX iterator that iterates over all entries.
clayborg 4d40921
Fix a test suite error.
clayborg 4d3decc
Update comment.
clayborg 96d0fe9
Remove clang format changes for lines that weren't edited.
clayborg 251207e
Undo more clang format changes.
clayborg 6cc1f10
Remove use of temporary "Offset" variables that aren't needed.
clayborg bdd7015
Update comment to explain more of what prepareNextStringOrEnd() does.
clayborg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -153,7 +153,11 @@ class LLVM_ABI AppleAcceleratorTable : public DWARFAcceleratorTable { | |||||||||||||||
| uint64_t getHashBase() const { return getBucketBase() + getNumBuckets() * 4; } | ||||||||||||||||
|
|
||||||||||||||||
| /// Return the offset into the section where the I-th hash is. | ||||||||||||||||
| uint64_t getIthHashBase(uint32_t I) const { return getHashBase() + I * 4; } | ||||||||||||||||
| std::optional<uint64_t> getIthHashBase(uint32_t I) const { | ||||||||||||||||
| if (I < Hdr.HashCount) | ||||||||||||||||
| return getHashBase() + I * 4; | ||||||||||||||||
| return std::nullopt; | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| /// Return the offset into the section where the offset list begins. | ||||||||||||||||
| uint64_t getOffsetBase() const { return getHashBase() + getNumHashes() * 4; } | ||||||||||||||||
|
|
@@ -164,8 +168,10 @@ class LLVM_ABI AppleAcceleratorTable : public DWARFAcceleratorTable { | |||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| /// Return the offset into the section where the I-th offset is. | ||||||||||||||||
| uint64_t getIthOffsetBase(uint32_t I) const { | ||||||||||||||||
| return getOffsetBase() + I * 4; | ||||||||||||||||
| std::optional<uint64_t> getIthOffsetBase(uint32_t I) const { | ||||||||||||||||
| if (I < Hdr.HashCount) | ||||||||||||||||
| return getOffsetBase() + I * 4; | ||||||||||||||||
| return std::nullopt; | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| /// Returns the index of the bucket where a hypothetical Hash would be. | ||||||||||||||||
|
|
@@ -188,14 +194,22 @@ class LLVM_ABI AppleAcceleratorTable : public DWARFAcceleratorTable { | |||||||||||||||
|
|
||||||||||||||||
| /// Reads the I-th hash in the hash list. | ||||||||||||||||
| std::optional<uint32_t> readIthHash(uint32_t I) const { | ||||||||||||||||
| uint64_t Offset = getIthHashBase(I); | ||||||||||||||||
| return readU32FromAccel(Offset); | ||||||||||||||||
| std::optional<uint64_t> OptOffset = getIthHashBase(I); | ||||||||||||||||
| if (OptOffset) { | ||||||||||||||||
| uint64_t Offset = *OptOffset; | ||||||||||||||||
| return readU32FromAccel(Offset); | ||||||||||||||||
| } | ||||||||||||||||
| return std::nullopt; | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| /// Reads the I-th offset in the offset list. | ||||||||||||||||
| std::optional<uint32_t> readIthOffset(uint32_t I) const { | ||||||||||||||||
| uint64_t Offset = getIthOffsetBase(I); | ||||||||||||||||
| return readU32FromAccel(Offset); | ||||||||||||||||
| std::optional<uint64_t> OptOffset = getIthOffsetBase(I); | ||||||||||||||||
| if (OptOffset) { | ||||||||||||||||
| uint64_t Offset = *OptOffset; | ||||||||||||||||
| return readU32FromAccel(Offset); | ||||||||||||||||
| } | ||||||||||||||||
|
||||||||||||||||
| if (OptOffset) { | |
| uint64_t Offset = *OptOffset; | |
| return readU32FromAccel(Offset); | |
| } | |
| if (OptOffset) | |
| return readU32FromAccel(*OptOffset); | |
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
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.
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.