OLD | NEW |
---|---|
(Empty) | |
1 //===- subzero/src/IceInstrumentation.h - ICE instrumentation ---*- C++ -*-===// | |
2 // | |
3 // The Subzero Code Generator | |
4 // | |
5 // This file is distributed under the University of Illinois Open Source | |
6 // License. See LICENSE.TXT for details. | |
7 // | |
8 //===----------------------------------------------------------------------===// | |
9 /// | |
10 /// \file | |
11 /// \brief Declares the Ice::Instrumentation class. | |
12 /// | |
13 /// Instrumentation is an abstract class used to drive the instrumentation | |
14 /// process for tools such as AddressSanitizer and MemorySanitizer. It uses a | |
15 /// LoweringContext to enable the insertion of new instructions into a given | |
16 /// Cfg. Although Instrumentation is an abstract class, each of its virtual | |
17 /// functions is has a trivial default implementation to make subclasses more | |
Roland McGrath
2016/06/06 22:28:45
s/is has/has/
tlively
2016/06/07 00:43:06
Done.
| |
18 /// succinct. | |
19 /// | |
20 //===----------------------------------------------------------------------===// | |
21 | |
22 #pragma clang diagnostic ignored "-Wunused-parameter" | |
Karl
2016/06/06 22:27:03
Don't change command line flags within a file, esp
Roland McGrath
2016/06/06 22:28:45
Why is this outside the include guard?
And do you
tlively
2016/06/07 00:43:06
This fix makes the code much larger and uglier. Wh
Karl
2016/06/07 14:42:40
Please do NOT add code that changes command line a
| |
23 | |
24 | |
25 #ifndef SUBZERO_SRC_ICEASANLOWERING_H | |
Karl
2016/06/06 22:27:03
The coding convention is that the define name shou
tlively
2016/06/07 00:43:06
Done.
| |
26 #define SUBZERO_SRC_ICEASANLOWERING_H | |
27 | |
28 #include "IceDefs.h" | |
29 | |
30 namespace Ice { | |
31 | |
32 class LoweringContext; | |
33 | |
34 class Instrumentation { | |
35 Instrumentation() = delete; | |
36 Instrumentation(const Instrumentation &) = delete; | |
37 Instrumentation &operator=(const Instrumentation &) = delete; | |
38 | |
39 protected: | |
Karl
2016/06/06 22:27:03
Generally, we don't like introducing fields before
tlively
2016/06/07 00:43:06
Done.
| |
40 GlobalContext *Ctx; | |
41 | |
42 public: | |
43 Instrumentation(GlobalContext *Ctx) : Ctx(Ctx) {} | |
44 | |
45 virtual void instrumentGlobals() {}; | |
46 void instrumentFunc(Cfg *Func); | |
47 | |
48 private: | |
49 void instrumentInst(LoweringContext &Context); | |
50 virtual void instrumentFuncStart(LoweringContext &Context) {}; | |
51 virtual void instrumentAlloca(LoweringContext &Context, | |
52 const class InstAlloca *Instr) {}; | |
53 virtual void instrumentArithmetic(LoweringContext &Context, | |
54 const class InstArithmetic *Instr) {}; | |
55 virtual void instrumentBr(LoweringContext &Context, | |
56 const class InstBr *Instr) {}; | |
57 virtual void instrumentCall(LoweringContext &Context, | |
58 const class InstCall *Instr) {}; | |
59 virtual void instrumentCast(LoweringContext &Context, | |
60 const class InstCast *Instr) {}; | |
61 virtual void instrumentExtractElement(LoweringContext &Context, | |
62 const class InstExtractElement *Instr) { }; | |
63 virtual void instrumentFcmp(LoweringContext &Context, | |
64 const class InstFcmp *Instr) {}; | |
65 virtual void instrumentIcmp(LoweringContext &Context, | |
66 const class InstIcmp *Instr) {}; | |
67 virtual void instrumentInsertElement(LoweringContext &Context, | |
68 const class InstInsertElement *Instr) {}; | |
69 virtual void instrumentIntrinsicCall(LoweringContext &Context, | |
70 const class InstIntrinsicCall *Instr) {}; | |
71 virtual void instrumentLoad(LoweringContext &Context, | |
72 const class InstLoad *Instr) {}; | |
73 virtual void instrumentPhi(LoweringContext &Context, | |
74 const class InstPhi *Instr) {}; | |
75 virtual void instrumentRet(LoweringContext &Context, | |
76 const class InstRet *Instr) {}; | |
77 virtual void instrumentSelect(LoweringContext &Context, | |
78 const class InstSelect *Instr) {}; | |
79 virtual void instrumentStore(LoweringContext &Context, | |
80 const class InstStore *Instr) {}; | |
81 virtual void instrumentSwitch(LoweringContext &Context, | |
82 const class InstSwitch *Instr) {}; | |
83 virtual void instrumentUnreachable(LoweringContext &Context, | |
84 const class InstUnreachable *Instr) {}; | |
85 virtual void instrumentLocalVars(Cfg *Func) {}; | |
86 }; | |
87 | |
88 } // end of namespace Ice | |
89 | |
90 #endif // SUBZERO_SRC_ICEASANLOWERING_H | |
OLD | NEW |