Skip to content

Commit

Permalink
Add some more deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianbs96 committed May 19, 2024
1 parent 4eb1f12 commit 987050c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
3 changes: 2 additions & 1 deletion include/phasar/ControlFlow/CFGBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ template <typename Derived> class CFGBase {
void print(ByConstRef<f_t> Fun, llvm::raw_ostream &OS) const {
self().printImpl(Fun, OS);
}
[[nodiscard]] nlohmann::json getAsJson(ByConstRef<f_t> Fun) const {
[[nodiscard, deprecated("Please use printAsJson() instead")]] nlohmann::json
getAsJson(ByConstRef<f_t> Fun) const {
return self().getAsJsonImpl(Fun);
}

Expand Down
29 changes: 15 additions & 14 deletions include/phasar/PhasarLLVM/Pointer/LLVMAliasGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ struct AliasInfoTraits<LLVMAliasGraph>
*
* @brief Represents the points-to graph of a function.
*/
class LLVMAliasGraph : public AnalysisPropertiesMixin<LLVMAliasGraph>,
AliasInfoBaseUtils {
class [[deprecated("Use LLVMAliasSet Instead")]] LLVMAliasGraph
: public AnalysisPropertiesMixin<LLVMAliasGraph>,
AliasInfoBaseUtils {
using traits_t = AliasInfoTraits<LLVMAliasGraph>;

public:
Expand Down Expand Up @@ -126,9 +127,9 @@ class LLVMAliasGraph : public AnalysisPropertiesMixin<LLVMAliasGraph>,
* considered. False, if May and Must Aliases should be
* considered.
*/
explicit LLVMAliasGraph(
LLVMProjectIRDB &IRDB, bool UseLazyEvaluation = true,
AliasAnalysisType PATy = AliasAnalysisType::CFLAnders);
explicit LLVMAliasGraph(LLVMProjectIRDB & IRDB, bool UseLazyEvaluation = true,
AliasAnalysisType PATy =
AliasAnalysisType::CFLAnders);

/**
* @brief Returns true if graph contains 0 nodes.
Expand Down Expand Up @@ -162,15 +163,15 @@ class LLVMAliasGraph : public AnalysisPropertiesMixin<LLVMAliasGraph>,
* @param F Function pointer
* @return Vector with pointers.
*/
std::vector<const llvm::Value *>
getPointersEscapingThroughReturnsForFunction(const llvm::Function *Fd) const;
std::vector<const llvm::Value *> getPointersEscapingThroughReturnsForFunction(
const llvm::Function *Fd) const;

/**
* @brief Checks if a given value is represented by a vertex in the points-to
* graph.
* @return True, the points-to graph contains the given value.
*/
bool containsValue(llvm::Value *V);
bool containsValue(llvm::Value * V);

/**
* The value-vertex-map maps each Value of the points-to graph to
Expand All @@ -192,8 +193,8 @@ class LLVMAliasGraph : public AnalysisPropertiesMixin<LLVMAliasGraph>,
const graph_t &PAG;
};

static inline PointerVertexOrEdgePrinter
makePointerVertexOrEdgePrinter(const graph_t &PAG) {
static inline PointerVertexOrEdgePrinter makePointerVertexOrEdgePrinter(
const graph_t &PAG) {
return {PAG};
}

Expand All @@ -220,9 +221,9 @@ class LLVMAliasGraph : public AnalysisPropertiesMixin<LLVMAliasGraph>,
AliasSetPtrTy getAliasSet(const llvm::Value *V,
const llvm::Instruction *I = nullptr);

AllocationSiteSetPtrTy
getReachableAllocationSites(const llvm::Value *V, bool IntraProcOnly = false,
const llvm::Instruction *I = nullptr);
AllocationSiteSetPtrTy getReachableAllocationSites(
const llvm::Value *V, bool IntraProcOnly = false,
const llvm::Instruction *I = nullptr);

[[nodiscard]] bool isInReachableAllocationSites(
const llvm::Value *V, const llvm::Value *PotentialValue,
Expand Down Expand Up @@ -251,7 +252,7 @@ class LLVMAliasGraph : public AnalysisPropertiesMixin<LLVMAliasGraph>,

void computeAliasGraph(const llvm::Value *V);

void computeAliasGraph(llvm::Function *F);
void computeAliasGraph(llvm::Function * F);

struct AllocationSiteDFSVisitor;
struct ReachabilityDFSVisitor;
Expand Down
4 changes: 3 additions & 1 deletion include/phasar/TypeHierarchy/TypeHierarchy.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ template <typename T, typename F> class TypeHierarchy {

virtual void print(llvm::raw_ostream &OS = llvm::outs()) const = 0;

[[nodiscard]] virtual nlohmann::json getAsJson() const = 0;
[[nodiscard,
deprecated("Please use printAsJson() instead")]] virtual nlohmann::json
getAsJson() const = 0;

virtual void printAsJson(llvm::raw_ostream &OS) const = 0;
};
Expand Down
4 changes: 3 additions & 1 deletion include/phasar/TypeHierarchy/VFTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ template <typename F> class VFTable {

virtual void print(llvm::raw_ostream &OS) const = 0;

[[nodiscard]] virtual nlohmann::json getAsJson() const = 0;
[[nodiscard,
deprecated("Please use printAsJson() instead")]] virtual nlohmann::json
getAsJson() const = 0;

virtual void printAsJson(llvm::raw_ostream &OS) const = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion lib/PhasarLLVM/ControlFlow/LLVMBasedICFG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ void LLVMBasedICFG::printAsJsonImpl(llvm::raw_ostream &OS) const {
[this](n_t Inst) { return IRDB->getInstructionId(Inst); });
}

[[nodiscard]] nlohmann::json LLVMBasedICFG::getAsJsonImpl() const {
nlohmann::json LLVMBasedICFG::getAsJsonImpl() const {
return CG.getAsJson(
[](f_t F) { return F->getName().str(); },
[this](n_t Inst) { return IRDB->getInstructionId(Inst); });
Expand Down

0 comments on commit 987050c

Please sign in to comment.