Skip to content

Commit 044908e

Browse files
author
Martin Mory
committed
Merge branch 'f-ClangTidyFixIDEGeneralizedLCA' into f-ClangTidyFixIDELCA
2 parents c1a66d6 + 04a402d commit 044908e

12 files changed

Lines changed: 163 additions & 160 deletions

File tree

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IFDSFieldSensTaintAnalysis/FlowFunctions/MapTaintedValuesToCaller.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ class MapTaintedValuesToCaller : public FlowFunction<ExtendedValue> {
2020
MapTaintedValuesToCaller(const llvm::CallInst *CallInst,
2121
const llvm::ReturnInst *RetInst,
2222
TraceStats &TraceStats, const ExtendedValue &ZV)
23-
: CallInst(CallInst), RetInst(RetInst), TraceStats(TraceStats),
24-
ZV(ZV) {}
23+
: CallInst(CallInst), RetInst(RetInst), TraceStats(TraceStats), ZV(ZV) {}
2524
~MapTaintedValuesToCaller() override = default;
2625

2726
std::set<ExtendedValue> computeTargets(ExtendedValue Fact) override;

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IFDSFieldSensTaintAnalysis/Utils/Log.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
#define LOG_INFO(x) \
1111
do { \
1212
llvm::outs() << "[ENV_TRACE] " << x << "\n"; /*NOLINT*/ \
13-
\
14-
llvm::outs() \
15-
.flush(); \
13+
\
14+
llvm::outs().flush(); \
1615
} while (0)
1716

1817
#ifdef DEBUG_BUILD

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/IDEGeneralizedLCA/EdgeValue.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class EdgeValue {
2929
enum Type { Top, Integer, String, FloatingPoint };
3030

3131
private:
32-
std::variant<llvm::APInt, llvm::APFloat, std::string, std::nullptr_t>
32+
std::variant<llvm::APInt, llvm::APFloat, std::string, std::nullptr_t>
3333
ValVariant = nullptr;
3434
Type VariantType;
3535

@@ -56,7 +56,7 @@ class EdgeValue {
5656
[[nodiscard]] Type getKind() const;
5757
// std::unique_ptr<ObjectLLVM> asObjLLVM(llvm::LLVMContext &ctx) const;
5858
[[nodiscard]] bool sqSubsetEq(const EdgeValue &Other) const;
59-
[[nodiscard]] EdgeValue performBinOp(llvm::BinaryOperator::BinaryOps Op,
59+
[[nodiscard]] EdgeValue performBinOp(llvm::BinaryOperator::BinaryOps Op,
6060
const EdgeValue &Other) const;
6161
[[nodiscard]] EdgeValue typecast(Type Dest, unsigned Bits) const;
6262
EdgeValue &operator=(const EdgeValue &EV);
@@ -89,7 +89,7 @@ using ev_t = EdgeValueSet;
8989
ev_t performBinOp(llvm::BinaryOperator::BinaryOps Op, const ev_t &Lhs,
9090
const ev_t &Rhs, size_t MaxSize);
9191
ev_t performTypecast(const ev_t &Ev, EdgeValue::Type Dest, unsigned Bits);
92-
Ordering compare(const ev_t &Lhs, const ev_t &Rhs);
92+
Ordering compare(const ev_t &Lhs, const ev_t &Rhs);
9393
ev_t join(const ev_t &Lhs, const ev_t &Rhs, size_t MaxSize);
9494
/// \brief implements square subset equal
9595
bool operator<(const ev_t &Lhs, const ev_t &Rhs);
@@ -108,13 +108,13 @@ template <> struct hash<psr::EdgeValue> {
108108
double AsFloat;
109109
string AsString;
110110
if (Val.tryGetInt(AsInt)) {
111-
return hash<uint64_t>()(AsInt) * 31 + Hash;
112-
}
111+
return hash<uint64_t>()(AsInt) * 31 + Hash;
112+
}
113113
if (Val.tryGetFP(AsFloat)) {
114-
return hash<double>()(round(AsFloat)) * 31 + Hash;
115-
}
116-
if (Val.tryGetString(AsString)) {
117-
return hash<string>()(AsString) * 31 + Hash;
114+
return hash<double>()(round(AsFloat)) * 31 + Hash;
115+
}
116+
if (Val.tryGetString(AsString)) {
117+
return hash<string>()(AsString) * 31 + Hash;
118118
}
119119
return Hash;
120120
}

include/phasar/PhasarLLVM/DataFlowSolver/Mono/Contexts/CallStringCTX.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,4 @@ template <typename N, unsigned K> struct hash<psr::CallStringCTX<N, K>> {
9999

100100
} // namespace std
101101

102-
#endif
102+
#endif

lib/PhasarLLVM/ControlFlow/Resolver/Resolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Resolver::Resolver(ProjectIRDB &IRDB, LLVMTypeHierarchy &TH)
7777

7878
const llvm::Function *
7979
Resolver::getNonPureVirtualVFTEntry(const llvm::StructType *T, unsigned Idx,
80-
const llvm::CallBase */*CallSite*/) {
80+
const llvm::CallBase * /*CallSite*/) {
8181
if (TH && TH->hasVFTable(T)) {
8282
const auto *Target = TH->getVFTable(T)->getFunction(Idx);
8383
if (Target && Target->getName() != "__cxa_pure_virtual") {

lib/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/ExtendedTaintAnalysis/ComposeEdgeFunction.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ namespace psr::XTaint {
1818
ComposeEdgeFunction::ComposeEdgeFunction(BasicBlockOrdering &BBO,
1919
EdgeFunctionPtrType F,
2020
EdgeFunctionPtrType G)
21-
: EdgeFunctionBase(EFKind::Compose, BBO), F(std::move(F)), G(std::move(G)) {}
21+
: EdgeFunctionBase(EFKind::Compose, BBO), F(std::move(F)), G(std::move(G)) {
22+
}
2223

2324
auto ComposeEdgeFunction::computeTarget(l_t Source) -> l_t {
2425
return G->computeTarget(F->computeTarget(Source));

lib/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/ExtendedTaintAnalysis/JoinEdgeFunction.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ namespace psr::XTaint {
2323
JoinEdgeFunction::JoinEdgeFunction(BasicBlockOrdering &BBO,
2424
SubEdgeFuctionsTy &&SubEF,
2525
const EdgeDomain &Seed)
26-
: EdgeFunctionBase(EFKind::Join, BBO), SubEF(std::move(SubEF)), Seed(Seed) {}
26+
: EdgeFunctionBase(EFKind::Join, BBO), SubEF(std::move(SubEF)), Seed(Seed) {
27+
}
2728
JoinEdgeFunction::JoinEdgeFunction(
2829
BasicBlockOrdering &BBO, std::initializer_list<EdgeFunctionPtrType> SubEF,
2930
const EdgeDomain &Seed)

0 commit comments

Comments
 (0)