Skip to content

Commit ab0e1a5

Browse files
committed
Cleanup stuff
1 parent bdb40a9 commit ab0e1a5

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

clang/lib/StaticAnalyzer/Checkers/AssumeModeling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//=== AssumeModeling.cpp ----------------------------------------*- C++ -*-===//
1+
//=== AssumeModeling.cpp --------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.

clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
//
1515
//===----------------------------------------------------------------------===//
1616

17-
#include "clang/AST/AttrIterator.h"
1817
#include "clang/Basic/Builtins.h"
1918
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
2019
#include "clang/StaticAnalyzer/Checkers/Taint.h"
@@ -91,29 +90,8 @@ QualType getOverflowBuiltinResultType(const CallEvent &Call, CheckerContext &C,
9190
}
9291
}
9392

94-
class BuiltinFunctionChecker
95-
: public Checker<eval::Call, check::PostStmt<AttributedStmt>> {
93+
class BuiltinFunctionChecker : public Checker<eval::Call> {
9694
public:
97-
void checkPostStmt(const AttributedStmt *A, CheckerContext &C) const {
98-
if (!hasSpecificAttr<CXXAssumeAttr>(A->getAttrs()))
99-
return;
100-
101-
for (const auto *Attr : getSpecificAttrs<CXXAssumeAttr>(A->getAttrs())) {
102-
SVal AssumptionVal = C.getSVal(Attr->getAssumption());
103-
104-
// The assumption is not evaluated at all if it had sideffects; skip them.
105-
if (AssumptionVal.isUnknown())
106-
continue;
107-
108-
const auto *Assumption = AssumptionVal.getAsInteger();
109-
assert(Assumption &&
110-
"We should know the exact outcome of an assume expr");
111-
if (Assumption && Assumption->isZero()) {
112-
C.addSink();
113-
}
114-
}
115-
}
116-
11795
bool evalCall(const CallEvent &Call, CheckerContext &C) const;
11896
void handleOverflowBuiltin(const CallEvent &Call, CheckerContext &C,
11997
BinaryOperator::Opcode Op,

0 commit comments

Comments
 (0)