clang  3.7.0
CheckerHelpers.h
Go to the documentation of this file.
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 
19 namespace clang {
20 
21 namespace ento {
22 
23 bool containsMacro(const Stmt *S);
24 bool containsEnum(const Stmt *S);
25 bool containsStaticLocal(const Stmt *S);
26 bool containsBuiltinOffsetOf(const Stmt *S);
27 template <class T> bool containsStmt(const Stmt *S) {
28  if (isa<T>(S))
29  return true;
30 
31  for (const Stmt *Child : S->children())
32  if (Child && containsStmt<T>(Child))
33  return true;
34 
35  return false;
36 }
37 
38 } // end GR namespace
39 
40 } // end clang namespace
41 
42 #endif
bool containsStaticLocal(const Stmt *S)
bool containsBuiltinOffsetOf(const Stmt *S)
bool containsStmt(const Stmt *S)
bool containsMacro(const Stmt *S)
bool containsEnum(const Stmt *S)