Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Side by Side Diff: src/IceInstrumentation.cpp

Issue 2068593003: Implemented linking to a dummy ASan runtime (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fixed szbuild.py and improved test Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceInstrumentation.h ('k') | tests_lit/asan_tests/globalredzones.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 23 matching lines...) Expand all
34 instrumentFuncStart(Context); 34 instrumentFuncStart(Context);
35 for (CfgNode *Node : Func->getNodes()) { 35 for (CfgNode *Node : Func->getNodes()) {
36 Context.init(Node); 36 Context.init(Node);
37 while (!Context.atEnd()) { 37 while (!Context.atEnd()) {
38 instrumentInst(Context); 38 instrumentInst(Context);
39 // go to next undeleted instruction 39 // go to next undeleted instruction
40 Context.advanceCur(); 40 Context.advanceCur();
41 Context.advanceNext(); 41 Context.advanceNext();
42 } 42 }
43 } 43 }
44
45 if (Func->getFunctionName().toStringOrEmpty() == "_start")
46 instrumentStart(Func);
44 } 47 }
45 48
46 void Instrumentation::instrumentInst(LoweringContext &Context) { 49 void Instrumentation::instrumentInst(LoweringContext &Context) {
47 assert(!Context.atEnd()); 50 assert(!Context.atEnd());
48 Inst *Instr = iteratorToInst(Context.getCur()); 51 Inst *Instr = iteratorToInst(Context.getCur());
49 switch (Instr->getKind()) { 52 switch (Instr->getKind()) {
50 case Inst::Alloca: 53 case Inst::Alloca:
51 instrumentAlloca(Context, llvm::cast<InstAlloca>(Instr)); 54 instrumentAlloca(Context, llvm::cast<InstAlloca>(Instr));
52 break; 55 break;
53 case Inst::Arithmetic: 56 case Inst::Arithmetic:
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 instrumentUnreachable(Context, llvm::cast<InstUnreachable>(Instr)); 102 instrumentUnreachable(Context, llvm::cast<InstUnreachable>(Instr));
100 break; 103 break;
101 default: 104 default:
102 // Only instrument high-level ICE instructions 105 // Only instrument high-level ICE instructions
103 assert(false && "Instrumentation encountered an unexpected instruction"); 106 assert(false && "Instrumentation encountered an unexpected instruction");
104 break; 107 break;
105 } 108 }
106 } 109 }
107 110
108 } // end of namespace Ice 111 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceInstrumentation.h ('k') | tests_lit/asan_tests/globalredzones.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698