Skip to content

Commit 30d2c12

Browse files
committed
style
1 parent e0c5057 commit 30d2c12

7 files changed

Lines changed: 29 additions & 20 deletions

File tree

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/ExtendedTaintAnalysis/AbstractMemoryLocation.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class AbstractMemoryLocationImpl final
7878

7979
AbstractMemoryLocationImpl(const AbstractMemoryLocationImpl &) = delete;
8080
AbstractMemoryLocationImpl(AbstractMemoryLocationImpl &&) = delete;
81+
~AbstractMemoryLocationImpl() = default;
8182

8283
AbstractMemoryLocationImpl &
8384
operator=(const AbstractMemoryLocationImpl &) = delete;
@@ -201,8 +202,10 @@ class AbstractMemoryLocation {
201202
const detail::AbstractMemoryLocationImpl *PImpl = nullptr;
202203
};
203204

205+
// NOLINTNEXTLINE(readability-identifier-naming)
204206
std::string DToString(const AbstractMemoryLocation &AML);
205207

208+
// NOLINTNEXTLINE(readability-identifier-naming)
206209
llvm::hash_code hash_value(psr::AbstractMemoryLocation Val);
207210
} // namespace psr
208211

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/ExtendedTaintAnalysis/AbstractMemoryLocationFactory.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class AbstractMemoryLocationFactoryBase {
8989
const llvm::DataLayout *DL = nullptr;
9090

9191
const detail::AbstractMemoryLocationImpl *
92-
getOrCreateImpl(const llvm::Value *V, llvm::SmallVectorImpl<ptrdiff_t> &&offs,
92+
getOrCreateImpl(const llvm::Value *V, llvm::SmallVectorImpl<ptrdiff_t> &&Offs,
9393
unsigned BOUND);
9494

9595
const detail::AbstractMemoryLocationImpl *
@@ -152,6 +152,9 @@ class AbstractMemoryLocationFactory<AbstractMemoryLocation>
152152
size_t InitialCapacity)
153153
: detail::AbstractMemoryLocationFactoryBase(DL, InitialCapacity) {}
154154
AbstractMemoryLocationFactory(const AbstractMemoryLocationFactory &) = delete;
155+
~AbstractMemoryLocationFactory() = default;
156+
AbstractMemoryLocationFactory &
157+
operator=(const AbstractMemoryLocationFactory &) = delete;
155158

156159
[[nodiscard]] AbstractMemoryLocation Create(const llvm::Value *V,
157160
unsigned BOUND) {

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/ExtendedTaintAnalysis/DebugEdgeIdentity.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
namespace llvm {
1717
class Instruction;
18-
}
18+
} // namespace llvm
1919

2020
namespace psr::XTaint {
2121
class DebugEdgeIdentity

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/ExtendedTaintAnalysis/EdgeDomain.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
namespace psr {
2222
class BasicBlockOrdering;
23-
}
23+
} // namespace psr
2424

2525
namespace psr::XTaint {
2626
class Sanitized {};
@@ -43,11 +43,12 @@ class EdgeDomain final {
4343
inline EdgeDomain(std::nullptr_t) noexcept
4444
: Value(nullptr, Kind::WithSanitizer) {}
4545

46-
inline EdgeDomain(psr::Bottom) noexcept : Value(nullptr, Kind::Bot) {}
46+
inline EdgeDomain(psr::Bottom /*unused*/) noexcept
47+
: Value(nullptr, Kind::Bot) {}
4748

48-
inline EdgeDomain(psr::Top) noexcept : Value(nullptr, Kind::Top) {}
49+
inline EdgeDomain(psr::Top /*unused*/) noexcept : Value(nullptr, Kind::Top) {}
4950

50-
inline EdgeDomain(psr::XTaint::Sanitized) noexcept
51+
inline EdgeDomain(psr::XTaint::Sanitized /*unused*/) noexcept
5152
: Value(nullptr, Kind::Sanitized) {}
5253

5354
inline EdgeDomain(const llvm::Instruction *Sani) noexcept

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/ExtendedTaintAnalysis/GenEdgeFunction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
namespace llvm {
1616
class Instruction;
17-
}
17+
} // namespace llvm
1818

1919
namespace psr::XTaint {
2020
class GenEdgeFunction : public EdgeFunctionBase {

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/ExtendedTaintAnalysis/JoinEdgeFunction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ class JoinEdgeFunction : public EdgeFunctionBase {
2222
static inline EdgeFunctionPtrType getEmptyKey() {
2323
static EdgeFunctionPtrType EmptyKey(
2424
llvm::DenseMapInfo<EdgeFunction<l_t> *>::getEmptyKey(),
25-
[](const EdgeFunction<l_t> *) {});
25+
[](const EdgeFunction<l_t> * /*unused*/) {});
2626

2727
return EmptyKey;
2828
}
2929
static inline EdgeFunctionPtrType getTombstoneKey() {
3030
static EdgeFunctionPtrType TombstoneKey(
3131
llvm::DenseMapInfo<EdgeFunction<l_t> *>::getTombstoneKey(),
32-
[](const EdgeFunction<l_t> *) {});
32+
[](const EdgeFunction<l_t> * /*unused*/) {});
3333

3434
return TombstoneKey;
3535
}

lib/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/IDEExtendedTaintAnalysis.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ IDEExtendedTaintAnalysis::getStoreFF(const llvm::Value *PointerOp,
215215
allTaintedValues.insert(ret.begin(), ret.end());
216216
#endif
217217

218-
std::cerr << "StoreFF(" << Source << ") = " << PrettyPrinter{Ret} << '\n';
218+
// std::cerr << "StoreFF(" << Source << ") = " << PrettyPrinter{Ret} <<
219+
// '\n';
219220

220221
return Ret;
221222
}
@@ -856,15 +857,15 @@ void IDEExtendedTaintAnalysis::doPostProcessing(
856857
llvm::SmallVector<const llvm::Instruction *> RemInst;
857858
for (auto &[Inst, PotentialLeaks] : Leaks) {
858859
llvm::SmallVector<const llvm::Value *, 2> Rem;
859-
std::cerr << "At " << llvmIRToString(Inst) << ":" << std::endl;
860+
// std::cerr << "At " << llvmIRToString(Inst) << ":" << std::endl;
860861

861862
auto Results = SR.resultsAt(Inst);
862863

863864
for (const auto *L : PotentialLeaks) {
864865
auto Found = Results.find(makeFlowFact(L));
865866
if (Found == Results.end()) {
866867
// The sanitizer has been killed, so we must assume the fact as tainted
867-
std::cerr << "No results for " << makeFlowFact(L) << std::endl;
868+
// std::cerr << "No results for " << makeFlowFact(L) << std::endl;
868869
continue;
869870
}
870871

@@ -875,27 +876,28 @@ void IDEExtendedTaintAnalysis::doPostProcessing(
875876
switch (Sani.getKind()) {
876877
case EdgeDomain::Sanitized:
877878
Rem.push_back(L);
878-
std::cerr << "Sanitize " << llvmIRToShortString(L) << " from parent "
879-
<< std::endl;
879+
// std::cerr << "Sanitize " << llvmIRToShortString(L) << " from parent "
880+
// << std::endl;
880881
break;
881882
case EdgeDomain::WithSanitizer:
882883
if (!Sani.getSanitizer()) {
883884
break;
884885
}
885886
if (!Load || BBO.mustComeBefore(Sani.getSanitizer(), Load)) {
886887
Rem.push_back(L);
887-
std::cerr << "Sanitize " << llvmIRToShortString(L) << " with "
888-
<< llvmIRToString(Sani.getSanitizer()) << std::endl;
888+
// std::cerr << "Sanitize " << llvmIRToShortString(L) << " with "
889+
// << llvmIRToString(Sani.getSanitizer()) << std::endl;
889890
break;
890891
}
891892
[[fallthrough]];
892893
default:
893-
std::cerr << " Sani: " << Sani
894-
<< "; Load: " << (Load ? llvmIRToString(Load) : "null")
895-
<< " for FlowFact: " << makeFlowFact(L) << std::endl;
894+
// std::cerr << " Sani: " << Sani
895+
// << "; Load: " << (Load ? llvmIRToString(Load) : "null")
896+
// << " for FlowFact: " << makeFlowFact(L) << std::endl;
897+
break;
896898
}
897899
}
898-
std::cerr << "----------------------------" << std::endl;
900+
// std::cerr << "----------------------------" << std::endl;
899901

900902
for (const auto *R : Rem) {
901903
PotentialLeaks.erase(R);

0 commit comments

Comments
 (0)