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

Fix the extapi.bc path not found issue #1212

Merged
merged 2 commits into from
Oct 5, 2023

Conversation

shuangxiangkan
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

Merging #1212 (976d2e9) into master (41a3a06) will decrease coverage by 0.02%.
Report is 2 commits behind head on master.
The diff coverage is 36.36%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1212      +/-   ##
==========================================
- Coverage   64.50%   64.49%   -0.02%     
==========================================
  Files         223      223              
  Lines       23663    23670       +7     
==========================================
+ Hits        15263    15265       +2     
- Misses       8400     8405       +5     
Files Coverage Δ
svf/lib/Util/ExtAPI.cpp 61.33% <36.36%> (-3.38%) ⬇️

@yuleisui yuleisui merged commit f523735 into SVF-tools:master Oct 5, 2023
5 checks passed
@@ -38,7 +38,7 @@

/// For a more detailed explanation of how External APIs are handled in SVF, please refer to the SVF Wiki: https://github.com/SVF-tools/SVF/wiki/Handling-External-APIs-with-extapi.c

#define EXTAPI_BC_PATH "Release-build/svf-llvm/extapi.bc"
#define DEFUALT_EXTAPI_BC_PATH "/svf-llvm/extapi.bc" // Default path to extapi.bc through the SVF build method(e.g. source ./build.sh)
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: "DEFUALT"

// 1. Set extapi.bc path through setExtBcPath() method
if (!extBcPath.empty() && !stat(extBcPath.c_str(), &statbuf))
return extBcPath;

Copy link
Contributor

@251 251 Oct 5, 2023

Choose a reason for hiding this comment

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

You could simplify that function and make it much faster:

  1. add a short circuit in the beginning:
if (!extBcPath.empty())
    return extBcPath;
  1. just assemble the paths via getenv, getFilePath, ... as below but than forward them to setExtBcPath and do the stat call there once (and not for every call to that function)

This should also remove the code duplication.

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