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 range-loop-analysis #1478

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions svf-llvm/lib/ObjTypeInference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ const Type *ObjTypeInference::fwInferObjType(const Value *var)
}
if (const auto *gepInst = SVFUtil::dyn_cast<GetElementPtrInst>(curValue))
insertInferSite(gepInst);
for (const auto &it: curValue->users())
for (const auto it: curValue->users())
{
if (const auto *loadInst = SVFUtil::dyn_cast<LoadInst>(it))
{
Expand All @@ -233,7 +233,7 @@ const Type *ObjTypeInference::fwInferObjType(const Value *var)
}
else
{
for (const auto &nit: storeInst->getPointerOperand()->users())
for (const auto nit: storeInst->getPointerOperand()->users())
{
/*
* propagate across store (value operand) and load
Expand Down Expand Up @@ -265,14 +265,14 @@ const Type *ObjTypeInference::fwInferObjType(const Value *var)
const Value *gepBase = gepInst->getPointerOperand();
if(const auto *load = SVFUtil::dyn_cast<LoadInst>(gepBase))
{
for (const auto &loadUse: load->getPointerOperand()->users())
for (const auto loadUse: load->getPointerOperand()->users())
{
if (loadUse == load || !SVFUtil::isa<LoadInst>(loadUse))
continue;
for (const auto &gepUse: loadUse->users())
for (const auto gepUse: loadUse->users())
{
if (!SVFUtil::isa<GetElementPtrInst>(gepUse)) continue;
for (const auto &loadUse2: gepUse->users())
for (const auto loadUse2: gepUse->users())
{
if (SVFUtil::isa<LoadInst>(loadUse2))
{
Expand All @@ -294,10 +294,10 @@ const Type *ObjTypeInference::fwInferObjType(const Value *var)
%6 = load ptr, ptr %5, align 8
%7 = getelementptr inbounds %struct.ll, ptr %6, i32 0, i32 0
*/
for (const auto &gepUse: alloc->users())
for (const auto gepUse: alloc->users())
{
if (!SVFUtil::isa<GetElementPtrInst>(gepUse)) continue;
for (const auto &loadUse2: gepUse->users())
for (const auto loadUse2: gepUse->users())
{
if (SVFUtil::isa<LoadInst>(loadUse2))
{
Expand Down Expand Up @@ -344,7 +344,7 @@ const Type *ObjTypeInference::fwInferObjType(const Value *var)
%call = call i8* @malloc_wrapper()
..infer based on %call..
*/
for (const auto &callsite: retInst->getFunction()->users())
for (const auto callsite: retInst->getFunction()->users())
{
if (const auto *callBase = SVFUtil::dyn_cast<CallBase>(callsite))
{
Expand Down Expand Up @@ -499,7 +499,7 @@ Set<const Value *> &ObjTypeInference::bwfindAllocOfVar(const Value *var)
}
else if (const auto *loadInst = SVFUtil::dyn_cast<LoadInst>(curValue))
{
for (const auto &use: loadInst->getPointerOperand()->users())
for (const auto use: loadInst->getPointerOperand()->users())
{
if (const StoreInst *storeInst = SVFUtil::dyn_cast<StoreInst>(use))
{
Expand All @@ -512,7 +512,7 @@ Set<const Value *> &ObjTypeInference::bwfindAllocOfVar(const Value *var)
}
else if (const auto *argument = SVFUtil::dyn_cast<Argument>(curValue))
{
for (const auto &use: argument->getParent()->users())
for (const auto use: argument->getParent()->users())
{
if (const CallBase *callBase = SVFUtil::dyn_cast<CallBase>(use))
{
Expand Down
2 changes: 1 addition & 1 deletion svf/include/MemoryModel/MutablePointsToDS.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class MutablePTData : public PTData<Key, KeySet, Data, DataSet>
{
if (this->rev)
{
for (const Data &d : pts) clearSingleRevPts(revPtsMap[d], k);
for (const Data d : pts) clearSingleRevPts(revPtsMap[d], k);
}
}
///@}
Expand Down
2 changes: 1 addition & 1 deletion svf/include/MemoryModel/PersistentPointsToDS.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class PersistentPTData : public PTData<Key, KeySet, Data, DataSet>
if (this->rev)
{
const DataSet &srcPts = ptCache.getActualPts(srcId);
for (const Data &d : srcPts) SVFUtil::insertKey(dstKey, revPtsMap[d]);
for (const Data d : srcPts) SVFUtil::insertKey(dstKey, revPtsMap[d]);
}
}

Expand Down
Loading