| OLD | NEW |
| 1 //===- subzero/src/IceInstrumentation.cpp - ICE instrumentation framework -===// | 1 //===- subzero/src/IceInstrumentation.cpp - ICE instrumentation framework -===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 /// | 9 /// |
| 10 /// \file | 10 /// \file |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 instrumentInst(Context); | 44 instrumentInst(Context); |
| 45 // go to next undeleted instruction | 45 // go to next undeleted instruction |
| 46 Context.advanceCur(); | 46 Context.advanceCur(); |
| 47 Context.advanceNext(); | 47 Context.advanceNext(); |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 | 50 |
| 51 std::string FuncName = Func->getFunctionName().toStringOrEmpty(); | 51 std::string FuncName = Func->getFunctionName().toStringOrEmpty(); |
| 52 if (FuncName == "_start") | 52 if (FuncName == "_start") |
| 53 instrumentStart(Func); | 53 instrumentStart(Func); |
| 54 |
| 55 finishFunc(Func); |
| 54 } | 56 } |
| 55 | 57 |
| 56 void Instrumentation::instrumentInst(LoweringContext &Context) { | 58 void Instrumentation::instrumentInst(LoweringContext &Context) { |
| 57 assert(!Context.atEnd()); | 59 assert(!Context.atEnd()); |
| 58 Inst *Instr = iteratorToInst(Context.getCur()); | 60 Inst *Instr = iteratorToInst(Context.getCur()); |
| 59 switch (Instr->getKind()) { | 61 switch (Instr->getKind()) { |
| 60 case Inst::Alloca: | 62 case Inst::Alloca: |
| 61 instrumentAlloca(Context, llvm::cast<InstAlloca>(Instr)); | 63 instrumentAlloca(Context, llvm::cast<InstAlloca>(Instr)); |
| 62 break; | 64 break; |
| 63 case Inst::Arithmetic: | 65 case Inst::Arithmetic: |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 instrumentUnreachable(Context, llvm::cast<InstUnreachable>(Instr)); | 111 instrumentUnreachable(Context, llvm::cast<InstUnreachable>(Instr)); |
| 110 break; | 112 break; |
| 111 default: | 113 default: |
| 112 // Only instrument high-level ICE instructions | 114 // Only instrument high-level ICE instructions |
| 113 assert(false && "Instrumentation encountered an unexpected instruction"); | 115 assert(false && "Instrumentation encountered an unexpected instruction"); |
| 114 break; | 116 break; |
| 115 } | 117 } |
| 116 } | 118 } |
| 117 | 119 |
| 118 } // end of namespace Ice | 120 } // end of namespace Ice |
| OLD | NEW |