-
Notifications
You must be signed in to change notification settings - Fork 437
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
Use extapi.bc to replace ExtAPI.json #1150
Conversation
CMakeLists.txt
Outdated
# Compile extapi.c to extapi.bc | ||
add_custom_command( | ||
OUTPUT ${PROJECT_BINARY_DIR}/include/Util/extapi.bc | ||
COMMAND ${PROJECT_SOURCE_DIR}/llvm-14.0.0.obj/bin/clang -S -c -Xclang -disable-O0-optnone -fno-discard-value-names -emit-llvm ${PROJECT_SOURCE_DIR}/svf/lib/Util/extapi.c -o ${PROJECT_BINARY_DIR}/include/Util/extapi.bc |
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.
Can not use llvm-14.0.0 here. Need to use the version in build.sh
@@ -115,7 +115,7 @@ function build_llvm_from_source { | |||
mkdir llvm-build | |||
cd llvm-build | |||
# /*/ is a dirty hack to get llvm-project-llvmorg-version... | |||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$SVFHOME/$LLVMHome" ../llvm-source/*/llvm | |||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$SVFHOME/$LLVMHome" -DLLVM_ENABLE_PROJECTS=clang ../llvm-source/*/llvm |
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.
Why change it here?
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.
Because the previous cmake command doesn't generate clang, it prevents the use of clang to compile extapi.bc later on.
/* | ||
The functions in extapi.bc are named using two patterns: | ||
1: "svf_methodName"; | ||
2: "svf_methodName_methodProperties"; |
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.
Make sure use the below format methodname_propety_orginalname
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.
Some function names are substrings of other function names, such as "malloc" and "safe_malloc," there is an issue when matching app function names with extapi function names. This problem results in one app function name matching multiple extapi function names. To avoid this problem, placing the prefix "svf_" in front of the function names, such as "svf_malloc" and "svf_safe_malloc," can prevent this issue.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1150 +/- ##
==========================================
- Coverage 64.68% 63.03% -1.65%
==========================================
Files 223 221 -2
Lines 23821 23328 -493
==========================================
- Hits 15408 14705 -703
- Misses 8413 8623 +210
|
SVF with ExtAPI.json:
|
SVF with extapi.bc: Andersen Pointer Analysis Stats******
|
No description provided.