Chris Lattner
46fdc8ce43
Add new ExecutionEngine::getGlobalValueAtAddress method, which can efficiently
...
turn a memory address back into the LLVM global object that starts at that
address. Note that this won't cause any additional datastructures to be built
for clients of the EE that don't need this information.
Also modified some code to not access the GlobalAddress map directly.
llvm-svn: 10674
2003-12-31 20:21:04 +00:00
Chris Lattner
c37577eb9f
Clean up a lot of the code I added yesterday by exposing the IntrinsicLowering
...
implementation from the TargetMachine directly.
llvm-svn: 10636
2003-12-28 21:23:38 +00:00
Chris Lattner
44f1ab7c2f
Pass around IntrinsicLowering instances as appropriate.
...
Reimplement the Interpreters implementation of va_* to be more direct.
llvm-svn: 10627
2003-12-28 09:44:37 +00:00
Chris Lattner
3593bb9dd6
Factor code out of LLI
...
llvm-svn: 10616
2003-12-26 06:50:30 +00:00
Chris Lattner
ddcbddf9e9
No longer run atExit functions from run()
...
rename run to runFunction
Genericize the runFunction code a little bit, though it still stinks
llvm-svn: 10610
2003-12-26 06:13:47 +00:00
Chris Lattner
d7d8336d73
No longer run atExit functions from run()
...
rename run to runFunction
llvm-svn: 10609
2003-12-26 06:13:05 +00:00
Chris Lattner
013d4bee41
This should not be needed anymore
...
llvm-svn: 10558
2003-12-20 10:19:18 +00:00
Chris Lattner
edda0e5d4f
Implement PR135, lazy emission of global variables
...
llvm-svn: 10549
2003-12-20 03:36:47 +00:00
Chris Lattner
214005e5fb
Simple refactorings to prepare for lazy global emission
...
Also, add a stat for the number of globals emitted
llvm-svn: 10547
2003-12-20 02:45:37 +00:00
Chris Lattner
cd8f92bc62
Cleanup the JIT as per PR176. This renames the VM class to JIT, and merges the
...
VM.cpp and JIT.cpp files into JIT.cpp. This also splits some nasty code out
into TargetSelect.cpp so that people hopefully won't notice it. :)
llvm-svn: 10544
2003-12-20 01:46:27 +00:00
Chris Lattner
32658dbaf3
Update for changes in the JIT
...
llvm-svn: 10543
2003-12-20 01:45:17 +00:00
Chris Lattner
1cb1efedb3
Rip JIT specific stuff out of TargetMachine, as per PR176
...
llvm-svn: 10542
2003-12-20 01:22:19 +00:00
Chris Lattner
9047cde657
Finegrainify namespacification
...
llvm-svn: 10465
2003-12-14 23:25:48 +00:00
Brian Gaeke
84101bcdb8
Dynamically get the right-sized member of a GenericValue to hold a size_t, and
...
use it to return the result of strlen.
llvm-svn: 10433
2003-12-12 15:38:06 +00:00
Chris Lattner
f58e098889
Implement the ExecutionEngine::getPointerToFunctionOrStub by forwarding the
...
request on to the TargetMachine if it supports the getJITStubForFunction method
llvm-svn: 10431
2003-12-12 07:12:02 +00:00
Brian Gaeke
fb0c4c3d39
Since we are using a gep_type_iterator, we apparently must get the type
...
index by using I.getOperand() here. This was failing an assertion on
basically every struct access.
llvm-svn: 10426
2003-12-12 05:13:05 +00:00
Brian Gaeke
7fe399f169
Fix typo in comment. Add prototype for getConstantExprValue().
...
llvm-svn: 10390
2003-12-11 00:23:28 +00:00
Brian Gaeke
e7599245cb
Add support for --debug-only=interpreter, to print out instrs before
...
interpreting them.
Move support for getting the value of a ConstantExpr into
getConstantExprValue(), and add support for the rest of the different
kinds of ConstantExprs. (I don't think I like ConstantExprs!)
This requires separate procedures executeShlInst() and executeShrInst().
Reduce the number of references to TheEE.
Get rid of an old comment mentioning annotations.
Fix exitCalled(), which was crashing the Interpreter. This was a
leftover from the return-value code refactoring.
llvm-svn: 10389
2003-12-11 00:22:59 +00:00
Chris Lattner
369445aaa6
implement method
...
llvm-svn: 10321
2003-12-08 08:23:04 +00:00
Chris Lattner
23328c5f69
Use the new method, though noone currently implements it any better than before
...
llvm-svn: 10320
2003-12-08 08:22:48 +00:00
Chris Lattner
ebd5b871e4
Finegrainify namespacification
...
llvm-svn: 10318
2003-12-08 08:06:28 +00:00
Chris Lattner
1a513f2b83
Emit constants to one contiguous block, but this time, respect alignment constraints.
...
If this doesn't work Misha, feel free to revert it.
llvm-svn: 10267
2003-11-30 04:23:21 +00:00
Misha Brukman
acb0d474e9
Go back to allocating memory for each constant separately. Since SPARCs do not
...
allow unaligned loads, that is probably the problem I've been seeing in numerous
SPARC test cases failing. X86, on the other hand, just slows down unaligned
accesses, since it must make 2 aligned accesses for each unaligned one.
llvm-svn: 10266
2003-11-30 00:50:53 +00:00
Chris Lattner
50a3a40d5f
Do not depend on structure elements being of type UByteTy
...
llvm-svn: 10224
2003-11-25 20:44:56 +00:00
Chris Lattner
8c11d31e35
Fine grainify namespaceification
...
llvm-svn: 10093
2003-11-19 21:08:57 +00:00
Misha Brukman
0b639e381c
Emit the MachineConstantPool constants in one contiguous memory `pool'.
...
llvm-svn: 10060
2003-11-17 20:40:07 +00:00
Misha Brukman
023ada1793
* Order #includes as per style guide
...
* Delete blank comment lines
* Eliminate space between function name and open-paren ( to be consistent
llvm-svn: 10059
2003-11-17 20:37:02 +00:00
Brian Gaeke
d966bbe9bf
Change LLI's internal representation of va_list to a pointer to the next
...
argument to be returned by va_arg. This allows va_lists to be passed
between different LLVM procedures (though it is unlikely that an LLI
va_list would make sense to an external function, except by chance.)
llvm-svn: 9965
2003-11-13 06:06:01 +00:00
Brian Gaeke
d25f86d683
Put all LLVM code into the llvm namespace, as per bug 109.
...
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Brian Gaeke
46510fbed5
Remove #include of PassManager.h which was marked FIXME, and apparently is no
...
longer used.
llvm-svn: 9823
2003-11-09 03:15:40 +00:00
Brian Gaeke
d246e0be30
Implement vaarg instruction. This is not quite perfect: 2003-08-11-VaListArg
...
still causes a crash. But it's better than before.
llvm-svn: 9794
2003-11-07 21:20:47 +00:00
Brian Gaeke
22bfc41ae1
popStackAndReturnValueToCaller() must advance instruction pointer to normal
...
destination, if returning from an invoke.
Implement 'unwind' instruction.
llvm-svn: 9792
2003-11-07 20:44:58 +00:00
Misha Brukman
4b82908055
Remove the *BIG UGLY HACK* from the JIT: PreSelection is now a FunctionPass.
...
llvm-svn: 9790
2003-11-07 20:32:08 +00:00
Brian Gaeke
88a4c1b68b
Add stub version of unwind support
...
llvm-svn: 9789
2003-11-07 20:07:06 +00:00
Brian Gaeke
059af2222a
visitCallInst --> visitCallSite.
...
Use visitCallSite to implement both CallInsts and InvokeInsts.
llvm-svn: 9788
2003-11-07 20:04:22 +00:00
Brian Gaeke
f7f7310b47
Make the operation of visitCallInst() only depend on the CallSite.
...
llvm-svn: 9787
2003-11-07 19:59:08 +00:00
Brian Gaeke
29d6325ca3
Use CallSites for call sites, instead of CallInsts. A revolutionary concept.
...
llvm-svn: 9784
2003-11-07 19:26:23 +00:00
Brian Gaeke
252fd99794
Refactor the return-from-function code into popStackAndReturnValueToCaller().
...
Make external function calls slightly less special; now they get a stack frame.
llvm-svn: 9765
2003-11-07 05:22:49 +00:00
Chris Lattner
3099f615fa
Be friendly to gcc 3.4... good compiler. Nice compiler.
...
llvm-svn: 9726
2003-11-05 06:20:27 +00:00
Brian Gaeke
ee15c93eda
Abort when the user program calls abort, instead of printing a funny message and calling exit(1).
...
llvm-svn: 9716
2003-11-05 01:18:49 +00:00
Brian Gaeke
251ac27789
Use regular old malloc to emulate malloc/alloca instructions.
...
llvm-svn: 9713
2003-11-05 01:02:14 +00:00
Brian Gaeke
246426591b
Remove a comment which no longer applies.
...
llvm-svn: 9712
2003-11-05 00:59:28 +00:00
Brian Gaeke
d6816f603f
In VM::create(), comment out almost the whole function if NO_JITS_ENABLED,
...
because the Arch variable will likely be undefined.
llvm-svn: 9576
2003-10-29 04:24:09 +00:00
Chris Lattner
4271c6fea0
Unbreak the build
...
llvm-svn: 9502
2003-10-25 16:18:03 +00:00
Brian Gaeke
1de42e556d
ExecutionEngine::create no longer takes a TraceMode argument.
...
CurFrame, TraceMode, and the CachedWriter are history.
The ExecutionAnnotations (SlotNumber, InstNumber, and FunctionInfo) are history.
ExecutionContext now keeps Values for each stack frame in a std::map.
printValue() and print() are history.
executeInstruction() is now part of run().
llvm-svn: 9493
2003-10-24 19:59:37 +00:00
Brian Gaeke
8abf6d4df3
ExecutionEngine::create no longer takes a TraceMode argument.
...
CurFrame, TraceMode, and the CachedWriter are history.
llvm-svn: 9492
2003-10-24 19:59:28 +00:00
Brian Gaeke
719a4c165f
The ExecutionAnnotations (SlotNumber, InstNumber, and FunctionInfo) are history.
...
llvm-svn: 9490
2003-10-24 19:59:18 +00:00
Brian Gaeke
032ca42757
Reduce the number of #includes.
...
CurFrame, TraceMode, and the CachedWriter are history.
ArrayChecksEnabled and non-QuietMode are history.
The ExecutionAnnotations (SlotNumber, InstNumber, and FunctionInfo) are history.
ExecutionContext now keeps Values for each stack frame in a std::map.
Stop pre-initializing Values on the stack to 42.
Remove some dead variables, excess whitespace and commented-out code.
executeInstruction() is now part of run().
printValue() and print() are history.
llvm-svn: 9489
2003-10-24 19:59:01 +00:00
Brian Gaeke
d857892674
ExecutionEngine::create no longer takes a TraceMode argument.
...
llvm-svn: 9488
2003-10-24 19:58:38 +00:00
Brian Gaeke
a039f6bb07
Destroy MachineFunction for any Function that we are about to
...
recompile and relink. This keeps it from failing an assertion when
it goes and tries to construct a new MachineFunction for that Function.
llvm-svn: 9459
2003-10-24 03:55:37 +00:00