Skip to content

Commit

Permalink
rename sourceElementType
Browse files Browse the repository at this point in the history
  • Loading branch information
jumormt committed Dec 4, 2023
1 parent e6ecc02 commit 9f45edc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions svf/include/MemoryModel/AccessPath.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ class AccessPath
typedef std::vector<IdxOperandPair> IdxOperandPairs;

/// Constructor
AccessPath(APOffset o = 0, const SVFType* srcTy = nullptr) : fldIdx(o), sourceElementType(srcTy) {}
AccessPath(APOffset o = 0, const SVFType* srcTy = nullptr) : fldIdx(o), gepSourceElementType(srcTy) {}

/// Copy Constructor
AccessPath(const AccessPath& ap)
: fldIdx(ap.fldIdx),
idxOperandPairs(ap.getIdxOperandPairVec()),
sourceElementType(ap.getSourceElementType())
gepSourceElementType(ap.getGepSourceElementType())
{
}

Expand All @@ -85,13 +85,13 @@ class AccessPath
{
fldIdx = rhs.fldIdx;
idxOperandPairs = rhs.getIdxOperandPairVec();
sourceElementType = rhs.sourceElementType;
gepSourceElementType = rhs.gepSourceElementType;
return *this;
}
inline bool operator==(const AccessPath& rhs) const
{
return this->fldIdx == rhs.fldIdx &&
this->idxOperandPairs == rhs.idxOperandPairs && this->sourceElementType == rhs.sourceElementType;
this->idxOperandPairs == rhs.idxOperandPairs && this->gepSourceElementType == rhs.gepSourceElementType;
}
//@}

Expand All @@ -109,9 +109,9 @@ class AccessPath
{
return idxOperandPairs;
}
inline const SVFType* getSourceElementType() const
inline const SVFType* getGepSourceElementType() const
{
return sourceElementType;
return gepSourceElementType;
}
//@}

Expand Down Expand Up @@ -173,7 +173,7 @@ class AccessPath

APOffset fldIdx; ///< Accumulated Constant Offsets
IdxOperandPairs idxOperandPairs; ///< a vector of actual offset in the form of <SVF Var, iterator type>
const SVFType* sourceElementType; /// source element type in gep instruction,
const SVFType* gepSourceElementType; /// source element type in gep instruction,
/// e.g., %f1 = getelementptr inbounds %struct.MyStruct, %struct.MyStruct* %arrayidx, i32 0, i32 0
/// the source element type is %struct.MyStruct
};
Expand Down
4 changes: 2 additions & 2 deletions svf/lib/MemoryModel/AccessPath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ APOffset AccessPath::computeConstantOffset() const
assert(isConstantOffset() && "not a constant offset");

// source element type is struct
if(sourceElementType && sourceElementType->isStructTy())
if(gepSourceElementType && gepSourceElementType->isStructTy())
return getConstantStructFldIdx();

APOffset totalConstOffset = 0;
Expand Down Expand Up @@ -256,7 +256,7 @@ NodeBS AccessPath::computeAllLocations() const

AccessPath AccessPath::operator+(const AccessPath& rhs) const
{
assert(sourceElementType == rhs.getSourceElementType() && "source element type not match");
assert(gepSourceElementType == rhs.getGepSourceElementType() && "source element type not match");
AccessPath ap(rhs);
ap.fldIdx += getConstantStructFldIdx();
for (auto &p : ap.getIdxOperandPairVec())
Expand Down

0 comments on commit 9f45edc

Please sign in to comment.