-
Notifications
You must be signed in to change notification settings - Fork 439
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
2nd PR. Add SVF's byte size and fix some api use #1260
Conversation
2. add MaxByteLimit Option
2) add isStaticDeterminedByteSize and getByteSizeOfObj in ObjTypeInfo (with getter/setter) and MemObj(only getter) 3) fulfill SymbolTableBuilder::initTypeInfo() to init the ByteSize related field
2) fix a bug in IntervalValue compare Op 3) remove ConstantOffset bool flag. Instead, if byteSize != 0, it is signal of constant offset. If byteSize = 0, it can be zero byte size or non-const offset. 4) add analyzeHeapAllocByteSize(const Value*), which accepts a CallInst like (malloc/calloc/..) and analyze the allocation byte Size of heap function 5) remove the hard code (99999) of maxByteLimit in SVFIR2ItvExeState::getBytefromGepTypePair, and replace it with Options::MaxFieldLimit()
2) add getByteSize and SetByteSize in SVFType
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1260 +/- ##
==========================================
- Coverage 64.50% 64.49% -0.02%
==========================================
Files 223 223
Lines 23767 23766 -1
==========================================
- Hits 15331 15327 -4
- Misses 8436 8439 +3
|
@@ -74,7 +74,7 @@ class SVFIR2ItvExeState | |||
VAddrs getGepObjAddress(u32_t pointer, APOffset offset); | |||
|
|||
/// Return the byte offset from one gep param offset | |||
std::pair<APOffset, APOffset> getBytefromGepTypePair(const AccessPath::VarAndGepTypePair& gep_pair, const GepStmt *gep); | |||
IntervalValue getBytefromGepTypePair(const AccessPath::VarAndGepTypePair& gep_pair, const GepStmt *gep); | |||
|
|||
/// Return the Index offset from one gep param offset | |||
std::pair<APOffset, APOffset> getIndexfromGepTypePair(const AccessPath::VarAndGepTypePair& gep_pair, const GepStmt *gep); |
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.
getItvOfFlattenedElemIndex
@@ -74,7 +74,7 @@ class SVFIR2ItvExeState | |||
VAddrs getGepObjAddress(u32_t pointer, APOffset offset); | |||
|
|||
/// Return the byte offset from one gep param offset | |||
std::pair<APOffset, APOffset> getBytefromGepTypePair(const AccessPath::VarAndGepTypePair& gep_pair, const GepStmt *gep); | |||
IntervalValue getBytefromGepTypePair(const AccessPath::VarAndGepTypePair& gep_pair, const GepStmt *gep); |
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.
getByteOffset
@@ -84,7 +84,7 @@ class SVFIR2ItvExeState | |||
/// e.g. GepStmt* gep = [i32*10], x, and x is [0,3] | |||
/// std::pair<s32_t, s32_t> byteOffset = getGepByteOffset(gep); | |||
/// byteOffset should be [0, 12] since i32 is 4 bytes. | |||
std::pair<APOffset, APOffset> getGepByteOffset(const GepStmt *gep); | |||
IntervalValue getGepByteOffset(const GepStmt *gep); | |||
|
|||
/// Return the offset expression of a GepStmt | |||
std::pair<APOffset, APOffset> getGepOffset(const GepStmt *gep); |
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.
getItvOfFlattenedElemIndex
@@ -74,7 +74,7 @@ class SVFIR2ItvExeState | |||
VAddrs getGepObjAddress(u32_t pointer, APOffset offset); | |||
|
|||
/// Return the byte offset from one gep param offset | |||
std::pair<APOffset, APOffset> getBytefromGepTypePair(const AccessPath::VarAndGepTypePair& gep_pair, const GepStmt *gep); | |||
IntervalValue getBytefromGepTypePair(const AccessPath::VarAndGepTypePair& gep_pair, const GepStmt *gep); |
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.
VarAndGepTypePair => IdxVarAndGepTypePair
No description provided.