Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(81)

Side by Side Diff: lib/ExecutionEngine/JIT/JIT.cpp

Issue 91042: Implement LLVM JIT side of GDB JIT debugging interface (Closed) SVN Base: http://llvm.org/svn/llvm-project/llvm/trunk/
Patch Set: Synced with TOT. Created 2 months, 2 weeks ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 //===-- JIT.cpp - LLVM Just in Time Compiler ------------------------------===// 1 //===-- JIT.cpp - LLVM Just in Time Compiler ------------------------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
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 // This tool implements a just-in-time compiler for LLVM, allowing direct 10 // This tool implements a just-in-time compiler for LLVM, allowing direct
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } 227 }
228 228
229 JIT::JIT(ModuleProvider *MP, TargetMachine &tm, TargetJITInfo &tji, 229 JIT::JIT(ModuleProvider *MP, TargetMachine &tm, TargetJITInfo &tji,
230 JITMemoryManager *JMM, CodeGenOpt::Level OptLevel, bool GVsWithCode) 230 JITMemoryManager *JMM, CodeGenOpt::Level OptLevel, bool GVsWithCode)
231 : ExecutionEngine(MP), TM(tm), TJI(tji), AllocateGVsWithCode(GVsWithCode) { 231 : ExecutionEngine(MP), TM(tm), TJI(tji), AllocateGVsWithCode(GVsWithCode) {
232 setTargetData(TM.getTargetData()); 232 setTargetData(TM.getTargetData());
233 233
234 jitstate = new JITState(MP); 234 jitstate = new JITState(MP);
235 235
236 // Initialize JCE 236 // Initialize JCE
237 JCE = createEmitter(*this, JMM); 237 JCE = createEmitter(*this, JMM, TM);
238 238
239 // Add target data 239 // Add target data
240 MutexGuard locked(lock); 240 MutexGuard locked(lock);
241 FunctionPassManager &PM = jitstate->getPM(locked); 241 FunctionPassManager &PM = jitstate->getPM(locked);
242 PM.add(new TargetData(*TM.getTargetData())); 242 PM.add(new TargetData(*TM.getTargetData()));
243 243
244 // Turn the machine code intermediate representation into bytes in memory that 244 // Turn the machine code intermediate representation into bytes in memory that
245 // may be executed. 245 // may be executed.
246 if (TM.addPassesToEmitMachineCode(PM, *JCE, OptLevel)) { 246 if (TM.addPassesToEmitMachineCode(PM, *JCE, OptLevel)) {
247 llvm_report_error("Target does not support machine code emission!"); 247 llvm_report_error("Target does not support machine code emission!");
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 return Ptr; 772 return Ptr;
773 } 773 }
774 774
775 void JIT::addPendingFunction(Function *F) { 775 void JIT::addPendingFunction(Function *F) {
776 MutexGuard locked(lock); 776 MutexGuard locked(lock);
777 jitstate->getPendingFunctions(locked).push_back(F); 777 jitstate->getPendingFunctions(locked).push_back(F);
778 } 778 }
779 779
780 780
781 JITEventListener::~JITEventListener() {} 781 JITEventListener::~JITEventListener() {}
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld r497