Skip to content

Commit

Permalink
Optimized deprecation warinings for getAsJson
Browse files Browse the repository at this point in the history
  • Loading branch information
mxHuber committed Apr 28, 2024
1 parent fa6bb87 commit cb8bc83
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions include/phasar/Pointer/AliasInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ class AliasInfoRef : public AnalysisPropertiesMixin<AliasInfoRef<V, N>> {
VT->Print(AA, OS);
}

[[nodiscard]] nlohmann::json getAsJson() const {
[[nodiscard, deprecated("Use printAsJson() instead")]] nlohmann::json
getAsJson() const {
assert(VT != nullptr);
return VT->GetAsJson(AA);
}
Expand Down Expand Up @@ -239,11 +240,13 @@ class AliasInfoRef : public AnalysisPropertiesMixin<AliasInfoRef<V, N>> {
static_cast<const ConcreteAA *>(AA)->print(OS);
},
[](const void *AA) noexcept {
/// TODO: die commit changes von fabian nehmen
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated"
if constexpr (has_getAsJson<ConcreteAA>::value) {
return static_cast<const ConcreteAA *>(AA)->getAsJson();
}
return nlohmann::json();
#pragma GCC diagnostic pop
},
[](const void *AA, llvm::raw_ostream &OS) {
static_cast<const ConcreteAA *>(AA)->printAsJson(OS);
Expand Down

0 comments on commit cb8bc83

Please sign in to comment.