-
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
Replace ExAPI.json with extapi.c (extapi.c explaination wiki: https://github.com/SVF-tools/SVF/wiki/Handling-External-APIs-with-extapi.c) #1165
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1165 +/- ##
==========================================
+ Coverage 64.64% 64.74% +0.10%
==========================================
Files 223 222 -1
Lines 23865 23475 -390
==========================================
- Hits 15427 15200 -227
+ Misses 8438 8275 -163
|
svf-llvm/lib/LLVMModule.cpp
Outdated
/// if this function is declaration | ||
candidateDecls.insert(&func); | ||
removedFuncList.push_back(&func); | ||
continue; |
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.
remove
@@ -827,6 +830,64 @@ void LLVMModuleSet::buildFunToFunMap() | |||
decls.push_back(decl); | |||
} | |||
} | |||
|
|||
/// App Func decl -> SVF extern Func def |
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.
rewrite the comments to state the three cases.
svf-llvm/lib/LLVMModule.cpp
Outdated
for (const Function* extfun : extFuncs) | ||
{ | ||
std::string declName = fdecl->getName().str(); | ||
// Change function like llvm.memcpy.p0i8.p0i8.i64 to llvm_memcpy_p0i8_p0i8_i64 |
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.
explain reason
} | ||
|
||
/// Overwrite | ||
/// App Func def -> SVF extern Func def |
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.
put the table as comments here.
extapi.c/ExtAPI.json: SVF with extapi.c:
|
svf-llvm/lib/LLVMModule.cpp
Outdated
if (func.isDeclaration()) | ||
/// Remove unused function in extapi.bc module | ||
/// if this function func defined in extapi.bc but never used in application code (without any corresponding declared functions). | ||
if (mod.getName().str() == Options::ExtAPIInput() && func.getName().str() != "svf__main" && FunDefToDeclsMap.find(&func) == FunDefToDeclsMap.end() |
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.
put this condition in a new method.
svf-llvm/lib/LLVMModule.cpp
Outdated
@@ -827,6 +830,94 @@ void LLVMModuleSet::buildFunToFunMap() | |||
decls.push_back(decl); | |||
} | |||
} | |||
|
|||
/* |
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.
put these comments before the function.
Fix AppDef -> ExtDef/ExtDef -> AppDef (overwrite).
Give each case an example.
No description provided.