]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/TransferFuncs.h
Copy head to stable/9 as part of 9.0-RELEASE release cycle.
[FreeBSD/stable/9.git] / contrib / llvm / tools / clang / include / clang / StaticAnalyzer / Core / PathSensitive / TransferFuncs.h
1 //== TransferFuncs.h - Path-Sens. Transfer Functions Interface ---*- 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 TransferFuncs, which provides a base-class that
11 //  defines an interface for transfer functions used by ExprEngine.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_CLANG_GR_TRANSFERFUNCS
16 #define LLVM_CLANG_GR_TRANSFERFUNCS
17
18 #include "clang/StaticAnalyzer/Core/PathSensitive/GRState.h"
19 #include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
20 #include "clang/StaticAnalyzer/Core/PathSensitive/ObjCMessage.h"
21 #include <vector>
22
23 namespace clang {
24 class ObjCMessageExpr;
25
26 namespace ento {
27 class ExplodedNode;
28 class ExplodedNodeSet;
29 class EndOfFunctionNodeBuilder;
30 class ExprEngine;
31 class StmtNodeBuilder;
32 class StmtNodeBuilderRef;
33
34 class TransferFuncs {
35 public:
36   TransferFuncs() {}
37   virtual ~TransferFuncs() {}
38
39   virtual void RegisterPrinters(std::vector<GRState::Printer*>& Printers) {}
40   virtual void RegisterChecks(ExprEngine& Eng) {}
41
42
43   // Calls.
44
45   virtual void evalCall(ExplodedNodeSet& Dst,
46                         ExprEngine& Engine,
47                         StmtNodeBuilder& Builder,
48                         const CallExpr* CE, SVal L,
49                         ExplodedNode* Pred) {}
50
51   virtual void evalObjCMessage(ExplodedNodeSet& Dst,
52                                ExprEngine& Engine,
53                                StmtNodeBuilder& Builder,
54                                ObjCMessage msg,
55                                ExplodedNode* Pred,
56                                const GRState *state) {}
57
58   // Stores.
59
60   virtual void evalBind(StmtNodeBuilderRef& B, SVal location, SVal val) {}
61
62   // End-of-path and dead symbol notification.
63
64   virtual void evalEndPath(ExprEngine& Engine,
65                            EndOfFunctionNodeBuilder& Builder) {}
66
67
68   virtual void evalDeadSymbols(ExplodedNodeSet& Dst,
69                                ExprEngine& Engine,
70                                StmtNodeBuilder& Builder,
71                                ExplodedNode* Pred,
72                                const GRState* state,
73                                SymbolReaper& SymReaper) {}
74
75   // Return statements.
76   virtual void evalReturn(ExplodedNodeSet& Dst,
77                           ExprEngine& Engine,
78                           StmtNodeBuilder& Builder,
79                           const ReturnStmt* S,
80                           ExplodedNode* Pred) {}
81
82   // Assumptions.
83   virtual const GRState* evalAssume(const GRState *state,
84                                     SVal Cond, bool Assumption) {
85     return state;
86   }  
87 };
88
89 } // end GR namespace
90
91 } // end clang namespace
92
93 #endif