Skip to content

Commit

Permalink
better name of selectlargestType
Browse files Browse the repository at this point in the history
  • Loading branch information
jumormt committed Jan 27, 2024
1 parent af14e7a commit 50e60ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion svf-llvm/include/SVF-LLVM/ObjTypeInference.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class ObjTypeInference

public:
/// Select the largest (conservative) type from all types
const Type *selectLargestType(Set<const Type *> &objTys);
const Type *selectLargestSizedType(Set<const Type *> &objTys);

u32_t objTyToNumFields(const Type *objTy);

Expand Down
6 changes: 3 additions & 3 deletions svf-llvm/lib/ObjTypeInference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const Type *ObjTypeInference::inferObjType(const Value *startValue)
{
types.insert(fwInferObjType(source));
}
const Type *largestTy = selectLargestType(types);
const Type *largestTy = selectLargestSizedType(types);
ABORT_IFNOT(largestTy, "return type cannot be null");
return largestTy;
}
Expand Down Expand Up @@ -355,7 +355,7 @@ const Type *ObjTypeInference::fwInferObjType(const Value *startValue)
std::transform(infersites.begin(), infersites.end(), std::inserter(types, types.begin()),
infersiteToType);
_valueToInferSites[curValue] = SVFUtil::move(infersites);
_valueToType[curValue] = selectLargestType(types);
_valueToType[curValue] = selectLargestSizedType(types);
}
}
const Type *type = _valueToType[startValue];
Expand Down Expand Up @@ -552,7 +552,7 @@ u32_t ObjTypeInference::getArgPosInCall(const CallBase *callBase, const Value *a
}


const Type *ObjTypeInference::selectLargestType(Set<const Type *> &objTys)
const Type *ObjTypeInference::selectLargestSizedType(Set<const Type *> &objTys)
{
if (objTys.empty()) return nullptr;
// map type size to types from with key in descending order
Expand Down

0 comments on commit 50e60ac

Please sign in to comment.