-
Notifications
You must be signed in to change notification settings - Fork 436
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
Conversation
svf-llvm/lib/LLVMModule.cpp
Outdated
@@ -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]); |
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.
Could you use get method otherwise the map will be touched by every function?
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1355 +/- ##
=======================================
Coverage 66.27% 66.28%
=======================================
Files 227 227
Lines 24641 24656 +15
=======================================
+ Hits 16331 16343 +12
- Misses 8310 8313 +3
|
@@ -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; |
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.
ExtFun2Annotations
@@ -323,6 +326,15 @@ class LLVMModuleSet | |||
return it->second; | |||
} | |||
|
|||
std::vector<std::string> getFunctionAnnotations(const Function* fun) |
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.
getFunAnnotations
svf-llvm/lib/LLVMModule.cpp
Outdated
@@ -790,6 +786,57 @@ void LLVMModuleSet::addSVFMain() | |||
} | |||
} | |||
|
|||
void LLVMModuleSet::getExtAPIAnnotations(const Module* mod) |
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.
collectExtFunAnnotations
@@ -323,6 +326,15 @@ class LLVMModuleSet | |||
return it->second; | |||
} | |||
|
|||
std::vector<std::string> getFunctionAnnotations(const Function* fun) |
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.
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...
No description provided.