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

Move ExtAPI annotations to the application #1543

Closed
wants to merge 0 commits into from

Conversation

shuangxiangkan
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 96.58120% with 4 lines in your changes missing coverage. Please review.

Project coverage is 62.62%. Comparing base (164087f) to head (d269ed2).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
svf-llvm/lib/LLVMModule.cpp 96.90% 3 Missing ⚠️
svf/lib/Util/ExtAPI.cpp 94.11% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1543      +/-   ##
==========================================
- Coverage   62.64%   62.62%   -0.02%     
==========================================
  Files         243      244       +1     
  Lines       25706    25744      +38     
  Branches     4525     4526       +1     
==========================================
+ Hits        16103    16123      +20     
- Misses       9603     9621      +18     
Files with missing lines Coverage Δ
svf-llvm/include/SVF-LLVM/LLVMModule.h 86.73% <ø> (-3.56%) ⬇️
svf-llvm/include/SVF-LLVM/LLVMUtil.h 81.25% <ø> (ø)
svf-llvm/lib/LLVMUtil.cpp 71.48% <ø> (-5.64%) ⬇️
svf-llvm/lib/SymbolTableBuilder.cpp 89.12% <100.00%> (ø)
svf/include/SVFIR/SVFValue.h 90.67% <ø> (-0.08%) ⬇️
svf/include/Util/ExtAPI.h 100.00% <ø> (ø)
svf/lib/AE/Svfexe/AEDetector.cpp 87.14% <100.00%> (+5.71%) ⬆️
svf/lib/AE/Svfexe/AbstractInterpretation.cpp 86.06% <100.00%> (-1.19%) ⬇️
svf/lib/SVFIR/SVFFileSystem.cpp 37.64% <ø> (-0.02%) ⬇️
svf/lib/Util/ExtAPI.cpp 70.23% <94.11%> (+3.57%) ⬆️
... and 1 more

... and 8 files with indirect coverage changes

OrderedSet<string> declNames, defNames, intersectNames;
typedef Map<string, const Function*> NameToFunDefMapTy;
typedef Map<string, Set<const Function*>> NameToFunDeclsMapTy;
FunDeclToDefMapTy extFuncs2ClonedFuncs;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rename FunDeclToDefMapTy

@@ -1038,6 +977,39 @@ void LLVMModuleSet::buildFunToFunMap()
}
}

auto cloneAndReplaceFunction = [&](const Function* functionToClone, Function* srcFunction, Module* parentModule, bool cloneBody) -> Function*
Copy link
Collaborator

@yuleisui yuleisui Sep 6, 2024

Choose a reason for hiding this comment

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

srcFunction => appFunToReplace
functionToClone => extFunToClone

// Without annotations, this function is normal function with useful function body
if (it == ExtFun2Annotations.end())
{
Function* clonedFunction = cloneAndReplaceFunction(const_cast<Function*>(extfun), const_cast<Function*>(fdecl), nullptr, true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

extfun => extFun
fdecl => appFun

Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove ExtFuncsVec

}
return clonedFunction;
};

/// App Func decl -> SVF extern Func def
for (const Function* fdecl : funDecls)
Copy link
Collaborator

Choose a reason for hiding this comment

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

funDeclsInApp

{
Function* clonedFunction = cloneAndReplaceFunction(const_cast<Function*>(owfunc), const_cast<Function*>(appfunc), nullptr, true);
extFuncs2ClonedFuncs[owfunc] = clonedFunction;
ExtFuncsVec.push_back(owfunc);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove ExtFuncsVec.

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.

2 participants