clang 10.0.0git

LoopUnrolling.cpp
Go to the documentation of this file.
1 //===--- LoopUnrolling.cpp - Unroll loops -----------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// This file contains functions which are used to decide if a loop worth to be
10 /// unrolled. Moreover, these functions manages the stack of loop which is
11 /// tracked by the ProgramState.
12 ///
13 //===----------------------------------------------------------------------===//
14
15 #include "clang/ASTMatchers/ASTMatchers.h"
16 #include "clang/ASTMatchers/ASTMatchFinder.h"
17 #include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
18 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
19 #include "clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h"
20
21 using namespace clang;
22 using namespace ento;
23 using namespace clang::ast_matchers;
24
25 static const int MAXIMUM_STEP_UNROLLED = 128;
26
27 struct LoopState {
28 private:
29 enum Kind { Normal, Unrolled } K;
30 const Stmt *LoopStmt;
31 const LocationContext *LCtx;
32 unsigned maxStep;
33 LoopState(Kind InK, const Stmt *S, const LocationContext *L, unsigned N)
34 : K(InK), LoopStmt(S), LCtx(L), maxStep(N) {}
35
36 public:
37 static LoopState getNormal(const Stmt *S, const LocationContext *L,
38 unsigned N) {
39 return LoopState(Normal, S, L, N);
40 }
41 static LoopState getUnrolled(const Stmt *S, const LocationContext *L,
42 unsigned N) {
43 return LoopState(Unrolled, S, L, N);
44 }
45 bool isUnrolled() const { return K == Unrolled; }
46 unsigned getMaxStep() const { return maxStep; }
47 const Stmt *getLoopStmt() const { return LoopStmt; }
48 const LocationContext *getLocationContext() const { return LCtx; }
49 bool operator==(const LoopState &X) const {
50 return K == X.K && LoopStmt == X.LoopStmt;
51 }
52 void Profile(llvm::FoldingSetNodeID &ID) const {
53 ID.AddInteger(K);
54 ID.AddPointer(LoopStmt);
55 ID.AddPointer(LCtx);
56 ID.AddInteger(maxStep);
57 }
58 };
59
60 // The tracked stack of loops. The stack indicates that which loops the
61 // simulated element contained by. The loops are marked depending if we decided
62 // to unroll them.
63 // TODO: The loop stack should not need to be in the program state since it is
64 // lexical in nature. Instead, the stack of loops should be tracked in the
65 // LocationContext.
66 REGISTER_LIST_WITH_PROGRAMSTATE(LoopStack, LoopState)
67
68 namespace clang {
69 namespace ento {
70
71 static bool isLoopStmt(const Stmt *S) {
72 return S && (isa<ForStmt>(S) || isa<WhileStmt>(S) || isa<DoStmt>(S));
73 }
74
75 ProgramStateRef processLoopEnd(const Stmt *LoopStmt, ProgramStateRef State) {
76 auto LS = State->get<LoopStack>();
77 if (!LS.isEmpty() && LS.getHead().getLoopStmt() == LoopStmt)
78 State = State->set<LoopStack>(LS.getTail());
79 return State;
80 }
81
82 static internal::Matcher<Stmt> simpleCondition(StringRef BindName) {
83 return binaryOperator(anyOf(hasOperatorName("<"), hasOperatorName(">"),
84 hasOperatorName("<="), hasOperatorName(">="),
85 hasOperatorName("!=")),
86 hasEitherOperand(ignoringParenImpCasts(declRefExpr(
87 to(varDecl(hasType(isInteger())).bind(BindName))))),
88 hasEitherOperand(ignoringParenImpCasts(
89 integerLiteral().bind("boundNum"))))
90 .bind("conditionOperator");
91 }
92
93 static internal::Matcher<Stmt>
94 changeIntBoundNode(internal::Matcher<Decl> VarNodeMatcher) {
95 return anyOf(
96 unaryOperator(anyOf(hasOperatorName("--"), hasOperatorName("++")),
97 hasUnaryOperand(ignoringParenImpCasts(
98 declRefExpr(to(varDecl(VarNodeMatcher)))))),
99 binaryOperator(isAssignmentOperator(),
100 hasLHS(ignoringParenImpCasts(
101 declRefExpr(to(varDecl(VarNodeMatcher)))))));
102 }
103
104 static internal::Matcher<Stmt>
105 callByRef(internal::Matcher<Decl> VarNodeMatcher) {
106 return callExpr(forEachArgumentWithParam(
107 declRefExpr(to(varDecl(VarNodeMatcher))),
108 parmVarDecl(hasType(references(qualType(unless(isConstQualified())))))));
109 }
110
111 static internal::Matcher<Stmt>
112 assignedToRef(internal::Matcher<Decl> VarNodeMatcher) {
113 return declStmt(hasDescendant(varDecl(
114 allOf(hasType(referenceType()),
115 hasInitializer(anyOf(
116 initListExpr(has(declRefExpr(to(varDecl(VarNodeMatcher))))),
117 declRefExpr(to(varDecl(VarNodeMatcher)))))))));
118 }
119
120 static internal::Matcher<Stmt>
121 getAddrTo(internal::Matcher<Decl> VarNodeMatcher) {
122 return unaryOperator(
123 hasOperatorName("&"),
124 hasUnaryOperand(declRefExpr(hasDeclaration(VarNodeMatcher))));
125 }
126
127 static internal::Matcher<Stmt> hasSuspiciousStmt(StringRef NodeName) {
128 return hasDescendant(stmt(
129 anyOf(gotoStmt(), switchStmt(), returnStmt(),
130 // Escaping and not known mutation of the loop counter is handled
131 // by exclusion of assigning and address-of operators and
132 // pass-by-ref function calls on the loop counter from the body.
133 changeIntBoundNode(equalsBoundNode(NodeName)),
134 callByRef(equalsBoundNode(NodeName)),
135 getAddrTo(equalsBoundNode(NodeName)),
136 assignedToRef(equalsBoundNode(NodeName)))));
137 }
138
139 static internal::Matcher<Stmt> forLoopMatcher() {
140 return forStmt(
141 hasCondition(simpleCondition("initVarName")),
142 // Initialization should match the form: 'int i = 6' or 'i = 42'.
143 hasLoopInit(
144 anyOf(declStmt(hasSingleDecl(
145 varDecl(allOf(hasInitializer(ignoringParenImpCasts(
146 integerLiteral().bind("initNum"))),
147 equalsBoundNode("initVarName"))))),
148 binaryOperator(hasLHS(declRefExpr(to(varDecl(
149 equalsBoundNode("initVarName"))))),
150 hasRHS(ignoringParenImpCasts(
151 integerLiteral().bind("initNum")))))),
152 // Incrementation should be a simple increment or decrement
153 // operator call.
154 hasIncrement(unaryOperator(
155 anyOf(hasOperatorName("++"), hasOperatorName("--")),
156 hasUnaryOperand(declRefExpr(
157 to(varDecl(allOf(equalsBoundNode("initVarName"),
158 hasType(isInteger())))))))),
159 unless(hasBody(hasSuspiciousStmt("initVarName")))).bind("forLoop");
160 }
161
162 static bool isPossiblyEscaped(const VarDecl *VD, ExplodedNode *N) {
163 // Global variables assumed as escaped variables.
164 if (VD->hasGlobalStorage())
165 return true;
166
167 while (!N->pred_empty()) {
168 // FIXME: getStmtForDiagnostics() does nasty things in order to provide
169 // a valid statement for body farms, do we need this behavior here?
170 const Stmt *S = N->getStmtForDiagnostics();
171 if (!S) {
172 N = N->getFirstPred();
173 continue;
174 }
175
176 if (const DeclStmt *DS = dyn_cast<DeclStmt>(S)) {
177 for (const Decl *D : DS->decls()) {
178 // Once we reach the declaration of the VD we can return.
179 if (D->getCanonicalDecl() == VD)
180 return false;
181 }
182 }
183 // Check the usage of the pass-by-ref function calls and adress-of operator
184 // on VD and reference initialized by VD.
185 ASTContext &ASTCtx =
186 N->getLocationContext()->getAnalysisDeclContext()->getASTContext();
187 auto Match =
188 match(stmt(anyOf(callByRef(equalsNode(VD)), getAddrTo(equalsNode(VD)),
189 assignedToRef(equalsNode(VD)))),
190 *S, ASTCtx);
191 if (!Match.empty())
192 return true;
193
194 N = N->getFirstPred();
195 }
196 llvm_unreachable("Reached root without finding the declaration of VD");
197 }
198
199 bool shouldCompletelyUnroll(const Stmt *LoopStmt, ASTContext &ASTCtx,
200 ExplodedNode *Pred, unsigned &maxStep) {
201
202 if (!isLoopStmt(LoopStmt))
203 return false;
204
205 // TODO: Match the cases where the bound is not a concrete literal but an
206 // integer with known value
207 auto Matches = match(forLoopMatcher(), *LoopStmt, ASTCtx);
208 if (Matches.empty())
209 return false;
210
211 auto CounterVar = Matches[0].getNodeAs<VarDecl>("initVarName");
212 llvm::APInt BoundNum =
213 Matches[0].getNodeAs<IntegerLiteral>("boundNum")->getValue();
214 llvm::APInt InitNum =
215 Matches[0].getNodeAs<IntegerLiteral>("initNum")->getValue();
216 auto CondOp = Matches[0].getNodeAs<BinaryOperator>("conditionOperator");
217 if (InitNum.getBitWidth() != BoundNum.getBitWidth()) {
218 InitNum = InitNum.zextOrSelf(BoundNum.getBitWidth());
219 BoundNum = BoundNum.zextOrSelf(InitNum.getBitWidth());
220 }
221
222 if (CondOp->getOpcode() == BO_GE || CondOp->getOpcode() == BO_LE)
223 maxStep = (BoundNum - InitNum + 1).abs().getZExtValue();
224 else
225 maxStep = (BoundNum - InitNum).abs().getZExtValue();
226
227 // Check if the counter of the loop is not escaped before.
228 return !isPossiblyEscaped(CounterVar->getCanonicalDecl(), Pred);
229 }
230
231 bool madeNewBranch(ExplodedNode *N, const Stmt *LoopStmt) {
232 const Stmt *S = nullptr;
233 while (!N->pred_empty()) {
234 if (N->succ_size() > 1)
235 return true;
236
237 ProgramPoint P = N->getLocation();
238 if (Optional<BlockEntrance> BE = P.getAs<BlockEntrance>())
239 S = BE->getBlock()->getTerminatorStmt();
240
241 if (S == LoopStmt)
242 return false;
243
244 N = N->getFirstPred();
245 }
246
247 llvm_unreachable("Reached root without encountering the previous step");
248 }
249
250 // updateLoopStack is called on every basic block, therefore it needs to be fast
251 ProgramStateRef updateLoopStack(const Stmt *LoopStmt, ASTContext &ASTCtx,
252 ExplodedNode *Pred, unsigned maxVisitOnPath) {
253 auto State = Pred->getState();
254 auto LCtx = Pred->getLocationContext();
255
256 if (!isLoopStmt(LoopStmt))
257 return State;
258
259 auto LS = State->get<LoopStack>();
260 if (!LS.isEmpty() && LoopStmt == LS.getHead().getLoopStmt() &&
261 LCtx == LS.getHead().getLocationContext()) {
262 if (LS.getHead().isUnrolled() && madeNewBranch(Pred, LoopStmt)) {
263 State = State->set<LoopStack>(LS.getTail());
264 State = State->add<LoopStack>(
265 LoopState::getNormal(LoopStmt, LCtx, maxVisitOnPath));
266 }
267 return State;
268 }
269 unsigned maxStep;
270 if (!shouldCompletelyUnroll(LoopStmt, ASTCtx, Pred, maxStep)) {
271 State = State->add<LoopStack>(
272 LoopState::getNormal(LoopStmt, LCtx, maxVisitOnPath));
273 return State;
274 }
275
276 unsigned outerStep = (LS.isEmpty() ? 1 : LS.getHead().getMaxStep());
277
278 unsigned innerMaxStep = maxStep * outerStep;
279 if (innerMaxStep > MAXIMUM_STEP_UNROLLED)
280 State = State->add<LoopStack>(
281 LoopState::getNormal(LoopStmt, LCtx, maxVisitOnPath));
282 else
283 State = State->add<LoopStack>(
284 LoopState::getUnrolled(LoopStmt, LCtx, innerMaxStep));
285 return State;
286 }
287
288 bool isUnrolledState(ProgramStateRef State) {
289 auto LS = State->get<LoopStack>();
290 if (LS.isEmpty() || !LS.getHead().isUnrolled())
291 return false;
292 return true;
293 }
294 }
295 }
clang::Builtin::ID
ID
Definition: Builtins.h:46
ento
clang::ast_matchers
Definition: ASTMatchers.h:95
clang::ast_matchers::callExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, CallExpr > callExpr
Matches call expressions.
Definition: ASTMatchersInternal.cpp:668
LoopUnrolling.h
clang::OverloadCandidateParamOrder::Normal
clang::ento::ExplodedNode::getStmtForDiagnostics
const Stmt * getStmtForDiagnostics() const
If the node&#39;s program point corresponds to a statement, retrieve that statement.
Definition: ExplodedGraph.cpp:322
clang::ast_matchers::stmt
const internal::VariadicAllOfMatcher< Stmt > stmt
Matches statements.
Definition: ASTMatchersInternal.cpp:661
LoopState::getUnrolled
static LoopState getUnrolled(const Stmt *S, const LocationContext *L, unsigned N)
Definition: LoopUnrolling.cpp:41
clang::ast_matchers::has
const internal::ArgumentAdaptingMatcherFunc< internal::HasMatcher > has
Matches AST nodes that have child AST nodes that match the provided matcher.
Definition: ASTMatchersInternal.cpp:833
clang::ento::shouldCompletelyUnroll
bool shouldCompletelyUnroll(const Stmt *LoopStmt, ASTContext &ASTCtx, ExplodedNode *Pred, unsigned &maxStep)
Definition: LoopUnrolling.cpp:199
ASTMatchFinder.h
clang::Stmt
Stmt - This represents one statement.
Definition: Stmt.h:66
clang::ast_matchers::hasDeclaration
internal::PolymorphicMatcherWithParam1< internal::HasDeclarationMatcher, internal::Matcher< Decl >, void(internal::HasDeclarationSupportedTypes)> hasDeclaration(const internal::Matcher< Decl > &InnerMatcher)
Matches a node if the declaration associated with that node matches the given matcher.
Definition: ASTMatchers.h:3084
clang::ast_matchers::anyOf
const internal::VariadicOperatorMatcherFunc< 2, std::numeric_limits< unsigned >::max()> anyOf
Matches if any of the given matchers matches.
Definition: ASTMatchersInternal.cpp:820
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:88
abs
__DEVICE__ long long abs(long long __n)
Definition: __clang_cuda_cmath.h:49
P
StringRef P
Definition: ASTMatchersInternal.cpp:485
clang::ast_matchers::hasDescendant
const internal::ArgumentAdaptingMatcherFunc< internal::HasDescendantMatcher > hasDescendant
Matches AST nodes that have descendant AST nodes that match the provided matcher. ...
Definition: ASTMatchersInternal.cpp:835
clang::IntegerLiteral
Definition: Expr.h:1446
clang::LocationContext
Definition: AnalysisDeclContext.h:216
clang::ento::ExplodedNode::getState
const ProgramStateRef & getState() const
Definition: ExplodedGraph.h:169
clang::BlockEntrance
Definition: ProgramPoint.h:225
clang::VarDecl
Represents a variable declaration or definition.
Definition: Decl.h:820
clang::AnalysisDeclContext::getASTContext
ASTContext & getASTContext() const
Definition: AnalysisDeclContext.h:103
clang::ast_matchers::allOf
const internal::VariadicOperatorMatcherFunc< 2, std::numeric_limits< unsigned >::max()> allOf
Matches if all given matchers match.
Definition: ASTMatchersInternal.cpp:823
clang::ast_matchers::binaryOperator
const internal::VariadicDynCastAllOfMatcher< Stmt, BinaryOperator > binaryOperator
Matches binary operator expressions.
Definition: ASTMatchersInternal.cpp:782
clang::ento::isUnrolledState
bool isUnrolledState(ProgramStateRef State)
Returns if the given State indicates that is inside a completely unrolled loop.
Definition: LoopUnrolling.cpp:288
clang::ast_matchers::varDecl
const internal::VariadicDynCastAllOfMatcher< Decl, VarDecl > varDecl
Matches variable declarations.
Definition: ASTMatchersInternal.cpp:653
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:168
llvm::Optional
Definition: LLVM.h:37
State
LineState State
Definition: UnwrappedLineFormatter.cpp:932
LoopState
Definition: LoopUnrolling.cpp:27
clang::ento::processLoopEnd
ProgramStateRef processLoopEnd(const Stmt *LoopStmt, ProgramStateRef State)
Updates the given ProgramState.
Definition: LoopUnrolling.cpp:75
clang::ento::ExplodedNode
Definition: ExplodedGraph.h:65
clang::ast_matchers::gotoStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, GotoStmt > gotoStmt
Matches goto statements.
Definition: ASTMatchersInternal.cpp:749
clang::ast_matchers::declStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, DeclStmt > declStmt
Matches declaration statements.
Definition: ASTMatchersInternal.cpp:662
clang::ento::ExplodedNode::succ_size
unsigned succ_size() const
Definition: ExplodedGraph.h:199
clang::ast_matchers::declRefExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, DeclRefExpr > declRefExpr
Matches expressions that refer to declarations.
Definition: ASTMatchersInternal.cpp:737
clang::ento::updateLoopStack
ProgramStateRef updateLoopStack(const Stmt *LoopStmt, ASTContext &ASTCtx, ExplodedNode *Pred, unsigned maxVisitOnPath)
Updates the stack of loops contained by the ProgramState.
Definition: LoopUnrolling.cpp:251
LoopState::isUnrolled
bool isUnrolled() const
Definition: LoopUnrolling.cpp:45
clang::ento::ExplodedNode::getLocationContext
const LocationContext * getLocationContext() const
Definition: ExplodedGraph.h:146
clang::BinaryOperator
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3434
ASTMatchers.h
clang::ento::ExplodedNode::getFirstPred
ExplodedNode * getFirstPred()
Definition: ExplodedGraph.h:210
clang::ast_matchers::match
SmallVector< BoundNodes, 1 > match(MatcherT Matcher, const NodeT &Node, ASTContext &Context)
Returns the results of matching Matcher on Node.
Definition: ASTMatchFinder.h:298
LoopState::getLocationContext
const LocationContext * getLocationContext() const
Definition: LoopUnrolling.cpp:48
clang::ento::assignedToRef
static internal::Matcher< Stmt > assignedToRef(internal::Matcher< Decl > VarNodeMatcher)
Definition: LoopUnrolling.cpp:112
MAXIMUM_STEP_UNROLLED
static const int MAXIMUM_STEP_UNROLLED
Definition: LoopUnrolling.cpp:25
clang::ast_matchers::switchStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, SwitchStmt > switchStmt
Matches switch statements.
Definition: ASTMatchersInternal.cpp:752
REGISTER_LIST_WITH_PROGRAMSTATE
#define REGISTER_LIST_WITH_PROGRAMSTATE(Name, Elem)
Declares an immutable list type NameTy, suitable for placement into the ProgramState.
Definition: ProgramStateTrait.h:132
getValue
static SVal getValue(SVal val, SValBuilder &svalBuilder)
Definition: ArrayBoundCheckerV2.cpp:277
clang::ast_matchers::returnStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ReturnStmt > returnStmt
Matches return statements.
Definition: ASTMatchersInternal.cpp:748
LoopState::getLoopStmt
const Stmt * getLoopStmt() const
Definition: LoopUnrolling.cpp:47
llvm::IntrusiveRefCntPtr< const ProgramState >
clang::ast_matchers::parmVarDecl
const internal::VariadicDynCastAllOfMatcher< Decl, ParmVarDecl > parmVarDecl
Matches parameter variable declarations.
Definition: ASTMatchersInternal.cpp:627
LoopState::getMaxStep
unsigned getMaxStep() const
Definition: LoopUnrolling.cpp:46
clang::ento::madeNewBranch
bool madeNewBranch(ExplodedNode *N, const Stmt *LoopStmt)
Definition: LoopUnrolling.cpp:231
clang::DeclStmt
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Definition: Stmt.h:1225
clang::ast_matchers::integerLiteral
const internal::VariadicDynCastAllOfMatcher< Stmt, IntegerLiteral > integerLiteral
Matches integer literals of all sizes / encodings, e.g.
Definition: ASTMatchersInternal.cpp:768
clang::VarDecl::hasGlobalStorage
bool hasGlobalStorage() const
Returns true for all variables that do not have local storage.
Definition: Decl.h:1087
clang::ast_matchers::qualType
const internal::VariadicAllOfMatcher< QualType > qualType
Matches QualTypes in the clang AST.
Definition: ASTMatchersInternal.cpp:637
clang::ento::ExplodedNode::getLocation
ProgramPoint getLocation() const
getLocation - Returns the edge associated with the given node.
Definition: ExplodedGraph.h:144
clang::interp::APInt
llvm::APInt APInt
Definition: Integral.h:27
clang::ast_matchers::unless
const internal::VariadicOperatorMatcherFunc< 1, 1 > unless
Matches if the provided matcher does not match.
Definition: ASTMatchersInternal.cpp:850
clang::ast_matchers::forStmt
const internal::VariadicDynCastAllOfMatcher< Stmt, ForStmt > forStmt
Matches for statements.
Definition: ASTMatchersInternal.cpp:741
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:21
LoopState::getNormal
static LoopState getNormal(const Stmt *S, const LocationContext *L, unsigned N)
Definition: LoopUnrolling.cpp:37
clang::ento::isLoopStmt
static bool isLoopStmt(const Stmt *S)
Definition: LoopUnrolling.cpp:71
clang::ProgramPoint
Definition: ProgramPoint.h:59
clang::ast_matchers::initListExpr
const internal::VariadicDynCastAllOfMatcher< Stmt, InitListExpr > initListExpr
Matches init list expressions.
Definition: ASTMatchersInternal.cpp:700
clang::ento::forLoopMatcher
static internal::Matcher< Stmt > forLoopMatcher()
Definition: LoopUnrolling.cpp:139
clang::ast_matchers::hasEitherOperand
internal::Matcher< BinaryOperator > hasEitherOperand(const internal::Matcher< Expr > &InnerMatcher)
Matches if either the left hand side or the right hand side of a binary operator matches.
Definition: ASTMatchers.h:4771
clang::ast_matchers::unaryOperator
const internal::VariadicDynCastAllOfMatcher< Stmt, UnaryOperator > unaryOperator
Matches unary operator expressions.
Definition: ASTMatchersInternal.cpp:783
X
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
Definition: SemaDecl.cpp:14780
clang::ento::changeIntBoundNode
static internal::Matcher< Stmt > changeIntBoundNode(internal::Matcher< Decl > VarNodeMatcher)
Definition: LoopUnrolling.cpp:94
clang::ento::hasSuspiciousStmt
static internal::Matcher< Stmt > hasSuspiciousStmt(StringRef NodeName)
Definition: LoopUnrolling.cpp:127
clang::ento::simpleCondition
static internal::Matcher< Stmt > simpleCondition(StringRef BindName)
Definition: LoopUnrolling.cpp:82
clang::ento::ExplodedNode::pred_empty
bool pred_empty() const
Definition: ExplodedGraph.h:202
clang::ento::callByRef
static internal::Matcher< Stmt > callByRef(internal::Matcher< Decl > VarNodeMatcher)
Definition: LoopUnrolling.cpp:105
clang::ento::isPossiblyEscaped
static bool isPossiblyEscaped(const VarDecl *VD, ExplodedNode *N)
Definition: LoopUnrolling.cpp:162
LoopState::operator==
bool operator==(const LoopState &X) const
Definition: LoopUnrolling.cpp:49
clang::ProgramPoint::getAs
Optional< T > getAs() const
Convert to the specified ProgramPoint type, returning None if this ProgramPoint is not of the desired...
Definition: ProgramPoint.h:151
clang::ento::getAddrTo
static internal::Matcher< Stmt > getAddrTo(internal::Matcher< Decl > VarNodeMatcher)
Definition: LoopUnrolling.cpp:121
clang::LocationContext::getAnalysisDeclContext
AnalysisDeclContext * getAnalysisDeclContext() const
Definition: AnalysisDeclContext.h:245
clang::ast_matchers::referenceType
const AstTypeMatcher< ReferenceType > referenceType
Matches both lvalue and rvalue reference types.
Definition: ASTMatchersInternal.cpp:874
CallEvent.h
CheckerContext.h
LoopState::Profile
void Profile(llvm::FoldingSetNodeID &ID) const
Definition: LoopUnrolling.cpp:52