|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| | the Twine was used).
llvm-svn: 131612 | 
| | 
| 
| 
| | llvm-svn: 131603 | 
| | 
| 
| 
| 
| 
| | dealing with them in the MCJIT.
llvm-svn: 131601 | 
| | 
| 
| 
| 
| 
| | rather than throwing an error.
llvm-svn: 131322 | 
| | 
| 
| 
| 
| 
| 
| | As an ExecutionEngine class function, its definition
really belongs in ExecutionEngine.cpp, not JIT.cpp.
llvm-svn: 131320 | 
| | 
| 
| 
| 
| 
| 
| 
| | In particular, into EngineBuilder. This should only impact
the private API between the EE and EB classes, not external
clients, since JITCtor and MCJITCtor are both protected members.
llvm-svn: 131317 | 
| | 
| 
| 
| 
| 
| 
| | This prepares for making JITCtor/MCJITCtor take a
TargetMachine* directly from clients like EngineBuilder.
llvm-svn: 131316 | 
| | 
| 
| 
| 
| 
| 
| | actually takes rather than how much memory was allocated for it. This
is more accurate and should help the manager pack things more effectively.
llvm-svn: 131305 | 
| | 
| 
| 
| 
| 
| 
| | erroring out completely. Some modules produce sections that aren't referenced,
so it's friendlier to clients like LLDB to just skip them, at least for now.
llvm-svn: 131243 | 
| | 
| 
| 
| | llvm-svn: 131234 | 
| | 
| 
| 
| 
| 
| | Please ensure the build is clean and tests are passing when recommitting.
llvm-svn: 131044 | 
| | 
| 
| 
| 
| 
| | Forgot to `svn rm` these in revisions 131025 / 131029.
llvm-svn: 131030 | 
| | 
| 
| 
| 
| 
| | From revision 131025.
llvm-svn: 131029 | 
| | 
| 
| 
| 
| 
| 
| | As an ExecutionEngine class function, its definition
really belongs in ExecutionEngine.cpp, not JIT.cpp.
llvm-svn: 131027 | 
| | 
| 
| 
| 
| 
| 
| 
| | In particular, into EngineBuilder. This should only impact
the private API between the EE and EB classes, not external
clients, since JITCtor and MCJITCtor are both protected members.
llvm-svn: 131026 | 
| | 
| 
| 
| 
| 
| 
| | This prepares for making JITCtor/MCJITCtor take a
TargetMachine* directly from clients like EngineBuilder.
llvm-svn: 131025 | 
| | 
| 
| 
| 
| 
| | template arguments no longer works when the call arguments are lvalues.
llvm-svn: 130513 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | a bit more sinister as the memset doesn't do what the constructor does.
There seems to be a cleaner solution than a cast here though, instead we
can point the memset destination into the union its actually trying to
clear.
An alternative is to point to the Untyped member of this union. Review
appreciated, and if that is cleaner I'm happy to switch. All of these
should be functionally equivalent to the original code.
llvm-svn: 130395 | 
| | 
| 
| 
| | llvm-svn: 130068 | 
| | 
| 
| 
| | llvm-svn: 129973 | 
| | 
| 
| 
| 
| 
| | Luis Felipe Strano Moraes!
llvm-svn: 129558 | 
| | 
| 
| 
| | llvm-svn: 129445 | 
| | 
| 
| 
| | llvm-svn: 129435 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| | llvm-svn: 129328 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| | llvm-svn: 129209 | 
| | 
| 
| 
| | llvm-svn: 129149 | 
| | 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| 
| 
| 
| | of { i32, void ()* }. Teach the verifier to verify that, deleting copies of
checks strewn about.
llvm-svn: 129128 | 
| | 
| 
| 
| | llvm-svn: 129032 | 
| | 
| 
| 
| | llvm-svn: 129025 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| | llvm-svn: 128964 | 
| | 
| 
| 
| | llvm-svn: 128959 | 
| | 
| 
| 
| | llvm-svn: 128856 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| | llvm-svn: 128485 | 
| | 
| 
| 
| | llvm-svn: 128184 | 
| | 
| 
| 
| | llvm-svn: 128173 | 
| | 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| | llvm-svn: 128161 | 
| | 
| 
| 
| | llvm-svn: 128160 | 
| | 
| 
| 
| | llvm-svn: 128096 | 
| | 
| 
| 
| | llvm-svn: 128095 | 
| | 
| 
| 
| | llvm-svn: 128094 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| | llvm-svn: 128086 | 
| | 
| 
| 
| | llvm-svn: 128077 | 
| | 
| 
| 
| 
| 
| 
| 
| | 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 |