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 getgepoffset and accumulateconstantOffset #1184

Merged
merged 3 commits into from
Sep 6, 2023

Conversation

bjjwwang
Copy link
Contributor

@bjjwwang bjjwwang commented Sep 5, 2023

support byte size

  • add SVFType2ByteSize in LLVMUtil
  • add u32 elem_bytesize and bool getByteOffset to support byte size

@@ -201,74 +201,110 @@ std::pair<s32_t, s32_t> SVFIR2ItvExeState::getGepOffset(const GepStmt *gep)
else
{
u32_t idx = _svfir->getValueNode(value);
if (!inVarToIValTable(idx)) return std::make_pair(-1, -1);
//if (!inVarToIValTable(idx)) return std::make_pair(-1, -1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove this commented line.

@@ -110,7 +110,7 @@ class AccessPath
//@}

/// Return accumulated constant offset given OffsetVarVec
APOffset computeConstantOffset() const;
APOffset computeConstantOffset(u32_t elem_bytesize, bool getByteOffset) const;
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we make it default parameters

@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Merging #1184 (67293ae) into master (9f67fe4) will decrease coverage by 0.11%.
Report is 15 commits behind head on master.
The diff coverage is 0.00%.

❗ Current head 67293ae differs from pull request most recent head 12a3207. Consider uploading reports for the commit 12a3207 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1184      +/-   ##
==========================================
- Coverage   64.74%   64.64%   -0.11%     
==========================================
  Files         222      222              
  Lines       23483    23525      +42     
==========================================
+ Hits        15204    15207       +3     
- Misses       8279     8318      +39     
Files Changed Coverage Δ
svf-llvm/include/SVF-LLVM/LLVMUtil.h 76.25% <ø> (ø)
svf/include/MemoryModel/AccessPath.h 83.33% <ø> (ø)
svf/include/SVFIR/SVFStatements.h 85.56% <ø> (ø)
svf/lib/MemoryModel/AccessPath.cpp 3.65% <0.00%> (-0.89%) ⬇️

... and 2 files with indirect coverage changes

jiawei.wang added 2 commits September 6, 2023 07:52
1. add getBytefromGepTypePair in SvfIR2ItvExeState
2. add getIndexfromGepTypePair in SvfIR2ItvExeState
3. add accumulateConstantByteOffset in AccessPath
@yuleisui yuleisui merged commit 324794b into SVF-tools:master Sep 6, 2023
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