Skip to content
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

Add opaque pointer in extapi #1355

Merged
merged 3 commits into from
Feb 1, 2024
Merged

Conversation

shuangxiangkan
Copy link
Contributor

No description provided.

@@ -240,7 +236,7 @@ void LLVMModuleSet::createSVFFunction(const Function* func)
SVFUtil::cast<SVFFunctionType>(
getSVFType(func->getFunctionType())),
func->isDeclaration(), LLVMUtil::isIntrinsicFun(func),
func->hasAddressTaken(), func->isVarArg(), new SVFLoopAndDomInfo, LLVMUtil::getFunAnnotations(func));
func->hasAddressTaken(), func->isVarArg(), new SVFLoopAndDomInfo, ExtFun2Anno[func]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you use get method otherwise the map will be touched by every function?

Copy link

codecov bot commented Feb 1, 2024

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (e59e0a3) 66.27% compared to head (f5437f1) 66.28%.
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1355   +/-   ##
=======================================
  Coverage   66.27%   66.28%           
=======================================
  Files         227      227           
  Lines       24641    24656   +15     
=======================================
+ Hits        16331    16343   +12     
- Misses       8310     8313    +3     
Files Coverage Δ
svf-llvm/include/SVF-LLVM/LLVMModule.h 97.87% <ø> (ø)
svf-llvm/include/SVF-LLVM/LLVMUtil.h 73.33% <ø> (ø)
svf-llvm/lib/CppUtil.cpp 86.71% <100.00%> (ø)
svf/include/SVFIR/SVFValue.h 88.51% <100.00%> (+0.15%) ⬆️
svf/lib/SVFIR/SVFFileSystem.cpp 85.58% <100.00%> (ø)
svf/lib/SVFIR/SVFValue.cpp 74.77% <100.00%> (ø)
svf-llvm/lib/LLVMUtil.cpp 80.55% <90.90%> (-0.49%) ⬇️
svf-llvm/lib/LLVMModule.cpp 83.41% <86.66%> (+0.05%) ⬆️

@@ -77,6 +78,8 @@ class LLVMModuleSet
FunDefToDeclsMapTy FunDefToDeclsMap;
/// Record some "sse_" function declarations used in other ext function definition, e.g., svf_ext_foo(), and svf_ext_foo() used in app functions
FunctionSetType ExtFuncsVec;
/// Record annotations of function in extapi.bc
Fun2AnnoMap ExtFun2Anno;
Copy link
Contributor

Choose a reason for hiding this comment

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

ExtFun2Annotations

@@ -323,6 +326,15 @@ class LLVMModuleSet
return it->second;
}

std::vector<std::string> getFunctionAnnotations(const Function* fun)
Copy link
Contributor

Choose a reason for hiding this comment

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

getFunAnnotations

@@ -790,6 +786,57 @@ void LLVMModuleSet::addSVFMain()
}
}

void LLVMModuleSet::getExtAPIAnnotations(const Module* mod)
Copy link
Contributor

Choose a reason for hiding this comment

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

collectExtFunAnnotations

@@ -323,6 +326,15 @@ class LLVMModuleSet
return it->second;
}

std::vector<std::string> getFunctionAnnotations(const Function* fun)
Copy link
Contributor

Choose a reason for hiding this comment

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

This function has a redundant vector copy. Consider return a reference to the vector, return an empty field emptyAnnotations if not found. Nevertheless, I think a better solution is to delete this function...

@yuleisui yuleisui merged commit 9e94966 into SVF-tools:master Feb 1, 2024
5 checks passed
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.

3 participants