 |
|
 |
|
| Files: |
1 |
|
Branches Taken: |
0.0% |
0 / 0 |
| Generated: |
2009-05-17 22:47 |
|
Branches Executed: |
0.0% |
0 / 0 |
| |
|
Line Coverage: |
100.0% |
3 / 3 |
| |
 |
|
 |
1 : //===- CallPathManager.h - --*- C++ -*-===//
2 :
3 : #ifndef __UTIL_CALLPATHMANAGER_H__
4 : #define __UTIL_CALLPATHMANAGER_H__
5 :
6 : #include "klee/Statistics.h"
7 :
8 : #include <map>
9 : #include <vector>
10 :
11 : namespace llvm {
12 : class Instruction;
13 : class Function;
14 : }
15 :
16 : namespace klee {
17 : class StatisticRecord;
18 :
19 3045: struct CallSiteInfo {
20 : unsigned count;
21 : StatisticRecord statistics;
22 :
23 : public:
24 435: CallSiteInfo() : count(0) {}
25 : };
26 :
27 : typedef std::map<llvm::Instruction*,
28 : std::map<llvm::Function*, CallSiteInfo> > CallSiteSummaryTable;
29 :
30 2168: class CallPathNode {
31 : friend class CallPathManager;
32 :
33 : public:
34 : // form list of (callSite,function) path
35 : CallPathNode *parent;
36 : llvm::Instruction *callSite;
37 : llvm::Function *function;
38 : std::map<std::pair<llvm::Instruction*, llvm::Function*>,
39 : CallPathNode*> children;
40 :
41 : StatisticRecord statistics;
42 : StatisticRecord summaryStatistics;
43 : unsigned count;
44 :
45 : public:
46 : CallPathNode(CallPathNode *parent,
47 : llvm::Instruction *callSite,
48 : llvm::Function *function);
49 :
50 : void print();
51 : };
52 :
53 : class CallPathManager {
54 : CallPathNode root;
55 : std::vector<CallPathNode*> paths;
56 :
57 : private:
58 : CallPathNode *computeCallPath(CallPathNode *parent,
59 : llvm::Instruction *callSite,
60 : llvm::Function *f);
61 :
62 : public:
63 : CallPathManager();
64 : ~CallPathManager();
65 :
66 : void getSummaryStatistics(CallSiteSummaryTable &result);
67 :
68 : CallPathNode *getCallPath(CallPathNode *parent,
69 : llvm::Instruction *callSite,
70 : llvm::Function *f);
71 : };
72 : }
73 :
74 : #endif
Generated: 2009-05-17 22:47 by zcov