Skip to content

fix caching of llvm::ModuleSlotTracker instances #424

Merged
pdschubert merged 2 commits intodevelopmentfrom
f-FixModuleSlotTrackerCaching
Oct 1, 2021
Merged

fix caching of llvm::ModuleSlotTracker instances #424
pdschubert merged 2 commits intodevelopmentfrom
f-FixModuleSlotTrackerCaching

Conversation

@MMory
Copy link
Copy Markdown
Member

@MMory MMory commented Sep 27, 2021

... for printing llvm::Value - make sure that destruction of an llvm::Module leads to destruction of its llvm::ModuleSlotTracker in cache
please merge #423 first.

…alue - make sure that destruction of an llvm::Module leads to destruction of its llvm::ModuleSlotTracker in cache
Copy link
Copy Markdown
Member

@fabianbs96 fabianbs96 left a comment

Choose a reason for hiding this comment

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

Looks good to me; only a few minor things thay you might change

llvm::ModuleSlotTracker &
ModulesToSlotTracker::getSlotTrackerForModule(const llvm::Module *M) {
auto &ret = MToST[M];
if (M == nullptr && ret == nullptr) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Consider adding an assertion to prevent returning nullptr if M != nullptr && ret == nullptr

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah that might ease debugging in case it happens. However, if we return nullptr we will get a crash anyway.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done, see below

Comment thread lib/Utils/LLVMShorthands.cpp Outdated
Comment thread include/phasar/Utils/LLVMShorthands.h
Copy link
Copy Markdown
Collaborator

@vulder vulder left a comment

Choose a reason for hiding this comment

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

except for the open conversations, this LGTM

@pdschubert pdschubert merged commit 70de37c into development Oct 1, 2021
@pdschubert pdschubert deleted the f-FixModuleSlotTrackerCaching branch October 1, 2021 08:53
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.

4 participants