Skip to content

Commit 9305711

Browse files
committed
Add some typedefs
1 parent 4d3a7ff commit 9305711

5 files changed

Lines changed: 17 additions & 15 deletions

File tree

include/phasar/PhasarLLVM/Pointer/LLVMPointsToGraph.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ class LLVMPointsToGraph : public LLVMPointsToInfo {
136136
AliasResult alias(const llvm::Value *V1, const llvm::Value *V2,
137137
const llvm::Instruction *I = nullptr) override;
138138

139-
std::shared_ptr<std::unordered_set<const llvm::Value *>>
139+
PointsToSetPtrTy
140140
getPointsToSet(const llvm::Value *V,
141141
const llvm::Instruction *I = nullptr) override;
142142

143-
std::shared_ptr<std::unordered_set<const llvm::Value *>>
143+
PointsToSetPtrTy
144144
getReachableAllocationSites(const llvm::Value *V, bool IntraProcOnly = false,
145145
const llvm::Instruction *I = nullptr) override;
146146

include/phasar/PhasarLLVM/Pointer/LLVMPointsToInfo.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ namespace psr {
2323
class LLVMPointsToInfo
2424
: public PointsToInfo<const llvm::Value *, const llvm::Instruction *> {
2525
public:
26+
using PointsToInfo::PointsToSetPtrTy;
27+
using PointsToInfo::PointsToSetTy;
28+
2629
~LLVMPointsToInfo() override = default;
2730

2831
static const llvm::Function *retrieveFunction(const llvm::Value *V);

include/phasar/PhasarLLVM/Pointer/LLVMPointsToSet.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ namespace psr {
3939

4040
class LLVMPointsToSet : public LLVMPointsToInfo {
4141
private:
42-
using PointsToSetTy = std::unordered_set<const llvm::Value *>;
43-
using PointsToSetPtrTy = std::shared_ptr<PointsToSetTy>;
4442
using PointsToSetMap =
4543
std::unordered_map<const llvm::Value *, PointsToSetPtrTy>;
4644

@@ -102,11 +100,11 @@ class LLVMPointsToSet : public LLVMPointsToInfo {
102100
alias(const llvm::Value *V1, const llvm::Value *V2,
103101
const llvm::Instruction *I = nullptr) override;
104102

105-
[[nodiscard]] std::shared_ptr<std::unordered_set<const llvm::Value *>>
103+
[[nodiscard]] PointsToSetPtrTy
106104
getPointsToSet(const llvm::Value *V,
107105
const llvm::Instruction *I = nullptr) override;
108106

109-
[[nodiscard]] std::shared_ptr<std::unordered_set<const llvm::Value *>>
107+
[[nodiscard]] PointsToSetPtrTy
110108
getReachableAllocationSites(const llvm::Value *V, bool IntraProcOnly = false,
111109
const llvm::Instruction *I = nullptr) override;
112110

include/phasar/PhasarLLVM/Pointer/PointsToInfo.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ std::ostream &operator<<(std::ostream &os, const PointerAnalysisType &PA);
4040

4141
template <typename V, typename N> class PointsToInfo {
4242
public:
43+
using PointsToSetTy = std::unordered_set<V>;
44+
using PointsToSetPtrTy = std::shared_ptr<PointsToSetTy>;
45+
4346
virtual ~PointsToInfo() = default;
4447

4548
virtual bool isInterProcedural() const = 0;
@@ -48,10 +51,9 @@ template <typename V, typename N> class PointsToInfo {
4851

4952
virtual AliasResult alias(V V1, V V2, N I = N{}) = 0;
5053

51-
virtual std::shared_ptr<std::unordered_set<V>> getPointsToSet(V V1,
52-
N I = N{}) = 0;
54+
virtual PointsToSetPtrTy getPointsToSet(V V1, N I = N{}) = 0;
5355

54-
virtual std::shared_ptr<std::unordered_set<V>>
56+
virtual PointsToSetPtrTy
5557
getReachableAllocationSites(V V1, bool IntraProcOnly = false, N I = N{}) = 0;
5658

5759
// Checks if V2 is a reachable allocation in the points to set of V1.

lib/PhasarLLVM/Pointer/LLVMPointsToSet.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,9 @@ auto LLVMPointsToSet::getEmptyPointsToSet() -> PointsToSetPtrTy {
475475
return EmptySet;
476476
}
477477

478-
std::shared_ptr<std::unordered_set<const llvm::Value *>>
479-
LLVMPointsToSet::getPointsToSet(const llvm::Value *V,
480-
[[maybe_unused]] const llvm::Instruction *I) {
478+
auto LLVMPointsToSet::getPointsToSet(
479+
const llvm::Value *V, [[maybe_unused]] const llvm::Instruction *I)
480+
-> PointsToSetPtrTy {
481481

482482
// if V is not a (interesting) pointer we can return an empty set
483483
if (!isInterestingPointer(V)) {
@@ -492,10 +492,9 @@ LLVMPointsToSet::getPointsToSet(const llvm::Value *V,
492492
return getEmptyPointsToSet();
493493
}
494494

495-
std::shared_ptr<std::unordered_set<const llvm::Value *>>
496-
LLVMPointsToSet::getReachableAllocationSites(
495+
auto LLVMPointsToSet::getReachableAllocationSites(
497496
const llvm::Value *V, bool IntraProcOnly,
498-
[[maybe_unused]] const llvm::Instruction *I) {
497+
[[maybe_unused]] const llvm::Instruction *I) -> PointsToSetPtrTy {
499498
// if V is not a (interesting) pointer we can return an empty set
500499
if (!isInterestingPointer(V)) {
501500
return getEmptyPointsToSet();

0 commit comments

Comments
 (0)