/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h
Line | Count | Source (jump to first uncovered line) |
1 | | //== CheckerHelpers.h - Helper functions for checkers ------------*- C++ -*--=// |
2 | | // |
3 | | // The LLVM Compiler Infrastructure |
4 | | // |
5 | | // This file is distributed under the University of Illinois Open Source |
6 | | // License. See LICENSE.TXT for details. |
7 | | // |
8 | | //===----------------------------------------------------------------------===// |
9 | | // |
10 | | // This file defines CheckerVisitor. |
11 | | // |
12 | | //===----------------------------------------------------------------------===// |
13 | | |
14 | | #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_CHECKERHELPERS_H |
15 | | #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_CHECKERHELPERS_H |
16 | | |
17 | | #include "clang/AST/Stmt.h" |
18 | | #include <tuple> |
19 | | |
20 | | namespace clang { |
21 | | |
22 | | class Expr; |
23 | | class VarDecl; |
24 | | |
25 | | namespace ento { |
26 | | |
27 | | bool containsMacro(const Stmt *S); |
28 | | bool containsEnum(const Stmt *S); |
29 | | bool containsStaticLocal(const Stmt *S); |
30 | | bool containsBuiltinOffsetOf(const Stmt *S); |
31 | 40 | template <class T> bool containsStmt(const Stmt *S) { |
32 | 40 | if (isa<T>(S)) |
33 | 1 | return true; |
34 | 40 | |
35 | 39 | for (const Stmt *Child : S->children()) |
36 | 30 | if (30 Child && 30 containsStmt<T>(Child)30 ) |
37 | 0 | return true; |
38 | 39 | |
39 | 39 | return false; |
40 | 40 | } |
41 | | |
42 | | std::pair<const clang::VarDecl *, const clang::Expr *> |
43 | | parseAssignment(const Stmt *S); |
44 | | |
45 | | } // end GR namespace |
46 | | |
47 | | } // end clang namespace |
48 | | |
49 | | #endif |