summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused STL header includes.Jay Foad2011-04-231-1/+0
| | | | llvm-svn: 130068
* 80-col fix.Eric Christopher2011-04-221-1/+1
| | | | llvm-svn: 129973
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129558
* MCJIT relocation resolution.Jim Grosbach2011-04-131-0/+2
| | | | llvm-svn: 129445
* Like the coding standards say, do not use "using namespace std".Jay Foad2011-04-131-2/+2
| | | | llvm-svn: 129435
* MCJIT lazy relocation resolution and symbol address re-assignment.Jim Grosbach2011-04-121-98/+234
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add handling for tracking the relocations on symbols and resolving them. Keep track of the relocations even after they are resolved so that if the RuntimeDyld client moves the object, it can update the address and any relocations to that object will be updated. For our trival object file load/run test harness (llvm-rtdyld), this enables relocations between functions located in the same object module. It should be trivially extendable to load multiple objects with mutual references. As a simple example, the following now works (running on x86_64 Darwin 10.6): $ cat t.c int bar() { return 65; } int main() { return bar(); } $ clang t.c -fno-asynchronous-unwind-tables -o t.o -c $ otool -vt t.o t.o: (__TEXT,__text) section _bar: 0000000000000000 pushq %rbp 0000000000000001 movq %rsp,%rbp 0000000000000004 movl $0x00000041,%eax 0000000000000009 popq %rbp 000000000000000a ret 000000000000000b nopl 0x00(%rax,%rax) _main: 0000000000000010 pushq %rbp 0000000000000011 movq %rsp,%rbp 0000000000000014 subq $0x10,%rsp 0000000000000018 movl $0x00000000,0xfc(%rbp) 000000000000001f callq 0x00000024 0000000000000024 addq $0x10,%rsp 0000000000000028 popq %rbp 0000000000000029 ret $ llvm-rtdyld t.o -debug-only=dyld ; echo $? Function sym: '_bar' @ 0 Function sym: '_main' @ 16 Extracting function: _bar from [0, 15] allocated to 0x100153000 Extracting function: _main from [16, 41] allocated to 0x100154000 Relocation at '_main' + 16 from '_bar(Word1: 0x2d000000) Resolving relocation at '_main' + 16 (0x100154010) from '_bar (0x100153000)(pcrel, type: 2, Size: 4). loaded '_main' at: 0x100154000 65 $ llvm-svn: 129388
* Tidy up a bit now that we're using the MemoryManager interface.Jim Grosbach2011-04-121-7/+1
| | | | llvm-svn: 129328
* Just because a GlobalVariable's initializer is [N x { i32, void ()* }] doesn'tNick Lewycky2011-04-111-1/+5
| | | | | | | | | | | | mean that it has to be ConstantArray of ConstantStruct. We might have ConstantAggregateZero, at either level, so don't crash on that. Also, semi-deprecate the sentinal value. The linker isn't aware of sentinals so we end up with the two lists appended, each with their "sentinals" on them. Different parts of LLVM treated sentinals differently, so make them all just ignore the single entry and continue on with the rest of the list. llvm-svn: 129307
* Make error message more useful.Benjamin Kramer2011-04-091-2/+2
| | | | llvm-svn: 129209
* Workaround g++ 4.2.1 warning diagnostic false positive.Jim Grosbach2011-04-081-2/+2
| | | | llvm-svn: 129149
* Refactor MCJIT 32-bit section loading.Jim Grosbach2011-04-082-82/+67
| | | | | | | Teach 32-bit section loading to use the Memory Manager interface, just like the 64-bit loading does. Tidy up a few other things here and there. llvm-svn: 129138
* llvm.global_[cd]tor is defined to be either external, or appending with an arrayNick Lewycky2011-04-081-6/+2
| | | | | | | of { i32, void ()* }. Teach the verifier to verify that, deleting copies of checks strewn about. llvm-svn: 129128
* tidy up.Jim Grosbach2011-04-061-1/+1
| | | | llvm-svn: 129032
* Fix comment to use llvm 2.x syntax.Nick Lewycky2011-04-061-1/+1
| | | | llvm-svn: 129025
* RuntimeDyld should use the memory manager API.Jim Grosbach2011-04-062-91/+88
| | | | | | | | | | Start teaching the runtime Dyld interface to use the memory manager API for allocating space. Rather than mapping directly into the MachO object, we extract the payload for each object and copy it into a dedicated buffer allocated via the memory manager. For now, just do Segment64, so this works on x86_64, but not yet on ARM. llvm-svn: 128973
* Make the virtual destructor out-of-line so we have a key function.Chandler Carruth2011-04-051-0/+3
| | | | llvm-svn: 128964
* Remove extraneous 'return'.Jim Grosbach2011-04-051-2/+1
| | | | llvm-svn: 128959
* Add missing file from r128851.Jim Grosbach2011-04-041-0/+58
| | | | llvm-svn: 128856
* Layer the memory manager between the JIT and the runtime Dyld.Jim Grosbach2011-04-043-18/+21
| | | | | | | | | | | The JITMemory manager references LLVM IR constructs directly, while the runtime Dyld works at a lower level and can handle objects which may not originate from LLVM IR. Introduce a new layer for the memory manager to handle the interface between them. For the MCJIT, this layer will be almost entirely simply a call-through w/ translation between the IR objects and symbol names. llvm-svn: 128851
* Instantiate a JITMemoryManager for MCJIT DyldJim Grosbach2011-03-292-4/+8
| | | | llvm-svn: 128485
* Runtime dylib simple ARM 24-bit branch relocation support.Jim Grosbach2011-03-231-14/+49
| | | | llvm-svn: 128184
* Split out relocation resolution into target-specific bits.Jim Grosbach2011-03-231-3/+71
| | | | llvm-svn: 128173
* Fix double-free of Module.Jim Grosbach2011-03-231-1/+0
| | | | | | | | The ExecutionEngine constructor already added the module, so there's no need to call addModule() directly. Doing so causes a double-free of the Module at program termination. llvm-svn: 128171
* Start of relocation resolution for the runtime dyld library.Jim Grosbach2011-03-231-21/+130
| | | | llvm-svn: 128161
* Make sure to report any errors from the runtime dyld.Jim Grosbach2011-03-231-1/+2
| | | | llvm-svn: 128160
* Tidy up.Jim Grosbach2011-03-221-2/+1
| | | | llvm-svn: 128096
* Add missing file from previous commit.Jim Grosbach2011-03-221-0/+161
| | | | llvm-svn: 128095
* Propogate the error message, not just the error state.Jim Grosbach2011-03-221-0/+5
| | | | llvm-svn: 128094
* Add simple arg passing to MC-JIT and support for exit() call.Jim Grosbach2011-03-223-4/+115
| | | | | | | | | | | | | Support argument passing simple, common, prototypes directly. More complicated scenarios will require building up a stub function, which the MC-JIT isn't set up to handle yet. Add Intercept.cpp, which is just a copy from ExecutionEngine/JIT for now, to handle looking looking up external symbol names. This probably more properly belongs as part of RuntimeDyld. It'll migrate there as things flesh out more fully. llvm-svn: 128090
* Trailing whitespace.Jim Grosbach2011-03-225-46/+46
| | | | llvm-svn: 128086
* Fix comment in header.Eric Christopher2011-03-221-1/+1
| | | | llvm-svn: 128077
* Hook up the MCJIT to the RuntimeDyld library.Jim Grosbach2011-03-223-3/+22
| | | | | | | | Lots of cleanup to make the interfaces prettier, use the JITMemoryManager, handle multiple functions and modules, etc.. This gets far enough that the MCJIT compiles and runs code, though. llvm-svn: 128052
* Initialize HasError.Jim Grosbach2011-03-221-0/+2
| | | | llvm-svn: 128049
* Build the new RuntimeDyld library.Oscar Fuentes2011-03-211-0/+1
| | | | llvm-svn: 128035
* Library-ize the dyld components of llvm-rtdyld.Jim Grosbach2011-03-214-1/+346
| | | | | | | | | Move the dynamic linking functionality of the llvm-rtdyld program into an ExecutionEngine support library. Update llvm-rtdyld to just load an object file into memory, use the library to process it, then run the _main() function, if one is found. llvm-svn: 128031
* Silence a warning.Jim Grosbach2011-03-181-1/+1
| | | | llvm-svn: 127918
* Beginnings of MC-JIT code generation.Jim Grosbach2011-03-182-6/+47
| | | | | | | | | | | Proof-of-concept code that code-gens a module to an in-memory MachO object. This will be hooked up to a run-time dynamic linker library (see: llvm-rtdyld for similarly conceptual work for that part) which will take the compiled object and link it together with the rest of the system, providing back to the JIT a table of available symbols which will be used to respond to the getPointerTo*() queries. llvm-svn: 127916
* Tidy up. Whitespace and 80 column.Jim Grosbach2011-03-162-17/+20
| | | | llvm-svn: 127721
* Trailing whitespae.Jim Grosbach2011-03-151-34/+34
| | | | llvm-svn: 127691
* Support unregistering exception frames of functions when they are removed.Eric Christopher2011-03-042-6/+8
| | | | | | | | Patch by Johannes Schaub! Fixes PR8548 llvm-svn: 127047
* Move library stuff out of the toplevel CMakeLists.txt file.Oscar Fuentes2011-02-181-0/+4
| | | | llvm-svn: 125968
* Fix libffi usage when it is on a custom path.Oscar Fuentes2011-01-281-9/+1
| | | | llvm-svn: 124486
* Use the paths to libffi's header and library even when no customOscar Fuentes2011-01-271-6/+10
| | | | | | location was stated with FFI_INCLUDE_DIR/FFI_LIBRARY_DIR. llvm-svn: 124449
* Handles libffi on the CMake build.Oscar Fuentes2011-01-211-0/+16
| | | | | | Patch by arrowdodger! llvm-svn: 123976
* Rename TargetFrameInfo into TargetFrameLowering. Also, put couple of FIXMEs ↵Anton Korobeynikov2011-01-102-7/+7
| | | | | | and fixes here and there. llvm-svn: 123170
* Remove unneeded zero arrays.Benjamin Kramer2010-12-041-4/+2
| | | | llvm-svn: 120910
* Merge System into Support.Michael J. Spencer2010-11-2913-16/+16
| | | | llvm-svn: 120298
* PR5207: change APInt::doubleToBits() and APInt::floatToBits() to beJay Foad2010-11-282-6/+4
| | | | | | static methods that return a new APInt. llvm-svn: 120261
* Move getInitialFrameState() to TargetFrameInfoAnton Korobeynikov2010-11-182-1/+4
| | | | llvm-svn: 119754
* MCJIT: Stub out MCJIT implementation, still doesn't do anything useful.Daniel Dunbar2010-11-176-1/+269
| | | | llvm-svn: 119509
OpenPOWER on IntegriCloud