-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[ELFObject] Added conditions to print removed symbols and removed sections #124692
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
kshitijvp
wants to merge
5
commits into
llvm:main
Choose a base branch
from
kshitijvp:main
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 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
718edfe
[ELFObject] Added dbgs() statement in removeSections()
kshitijvp 02fb5c0
Made Changes
kshitijvp 76ccb57
Made Changes
kshitijvp 378fadb
Informal Change(Testing)
kshitijvp ac90408
Delete llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
kshitijvp 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
Made Changes
- Loading branch information
commit 02fb5c0b003a99cdbd36c47c2ffd1ca95ab5db85
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
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
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -768,7 +768,7 @@ Error SymbolTableSection::removeSymbols( | |||||||||
std::remove_if(std::begin(Symbols) + 1, std::end(Symbols), | ||||||||||
[ToRemove](const SymPtr &Sym) { | ||||||||||
if (ToRemove(*Sym)) { | ||||||||||
dbgs()<<"Symbols Removed:"<<Sym->Name<< "\n"; | ||||||||||
llvm::outs() << "Symbols Removed:" << Sym->Name<< "\n"; | ||||||||||
return true; | ||||||||||
} | ||||||||||
return false; | ||||||||||
|
@@ -2236,6 +2236,9 @@ Error Object::removeSections( | |||||||||
for (auto &RemoveSec : make_range(Iter, std::end(Sections))) { | ||||||||||
for (auto &Segment : Segments) | ||||||||||
Segment->removeSection(RemoveSec.get()); | ||||||||||
if (isVerboseEnabled) { | ||||||||||
llvm::outs() << "Removed Section: " << (RemoveSec.get()->Name); | ||||||||||
} | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LLVM style doesn't use braces around single-line ifs, typically.
Suggested change
Also, the GNU output uses lower case for its verbose output when printing which files are copied, so it makes sense to print it more like "removed section". |
||||||||||
RemoveSec->onRemove(); | ||||||||||
RemoveSections.insert(RemoveSec.get()); | ||||||||||
} | ||||||||||
|
@@ -2255,18 +2258,10 @@ Error Object::removeSections( | |||||||||
|
||||||||||
// Transfer removed sections into the Object RemovedSections container for use | ||||||||||
// later. | ||||||||||
for(auto &KeepSec : make_range(std::begin(Sections) , Iter)) | ||||||||||
{ | ||||||||||
|
||||||||||
if (Error E = KeepSec->removeSectionReferences( | ||||||||||
AllowBrokenLinks, [&RemoveSections](const SectionBase *Sec) { | ||||||||||
return RemoveSections.find(Sec) != RemoveSections.end(); | ||||||||||
})) | ||||||||||
std::move(Iter, Sections.end(), std::back_inserter(RemovedSections)); | ||||||||||
dbgs()<<"Sections Removed:"<<KeepSec->Name<<'\n'; | ||||||||||
Sections.erase(Iter, std::end(Sections)); | ||||||||||
return Error::success(); | ||||||||||
} | ||||||||||
std::move(Iter, Sections.end(), std::back_inserter(RemovedSections)); | ||||||||||
// Now finally get rid of them all together. | ||||||||||
Sections.erase(Iter, std::end(Sections)); | ||||||||||
return Error::success(); | ||||||||||
} | ||||||||||
|
||||||||||
Error Object::replaceSections( | ||||||||||
|
@@ -2296,8 +2291,12 @@ Error Object::replaceSections( | |||||||||
Error Object::removeSymbols(function_ref<bool(const Symbol &)> ToRemove) { | ||||||||||
if (SymbolTable) | ||||||||||
for (const SecPtr &Sec : Sections) | ||||||||||
if (Error E = Sec->removeSymbols(ToRemove)) | ||||||||||
if (Error E = Sec->removeSymbols(ToRemove)){ | ||||||||||
kshitijvp marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
if (isVerboseEnabled){ | ||||||||||
kshitijvp marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
llvm::outs() << "Removed Symbols:" << Sec->Name; | ||||||||||
} | ||||||||||
return E; | ||||||||||
} | ||||||||||
return Error::success(); | ||||||||||
} | ||||||||||
|
||||||||||
|
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
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
Oops, something went wrong.
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.
There's no need for the braces here (see other comment about coding standards).