1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

368 Commits

Author SHA1 Message Date
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
John Criswell
de34542f41 Added LLVM copyright header.
llvm-svn: 9321
2003-10-21 15:17:13 +00:00
John Criswell
71d2894956 Added LLVM copyright notice to Makefiles.
llvm-svn: 9312
2003-10-20 22:26:57 +00:00
John Criswell
b402729b30 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Chris Lattner
bdc522f19d Hrm, a relic from the past. How cute :)
llvm-svn: 9283
2003-10-20 05:45:49 +00:00
Chris Lattner
79135c051e Interpret the new varargs intrinsics correctly
llvm-svn: 9222
2003-10-18 05:55:25 +00:00
Misha Brukman
546d6e6764 Don't release the Module, as that invalidates the Module* within the
ModuleProvider, which has bad consequences in lli::callAsMain() which tries to
access that same Module*.

llvm-svn: 9205
2003-10-17 18:31:59 +00:00
Brian Gaeke
eaf7472fd7 Tidy up doxygen comment for getPointerToFunction().
Add prototypes for recompileAndRelinkFunction() and runJITOnFunction().

llvm-svn: 9200
2003-10-17 18:27:12 +00:00
Brian Gaeke
7b9b6dbd63 Refactor running the JIT passes on a single function into the new method,
runJITOnFunction().

Add new method for recompiling and patching in new versions of functions,
recompileAndRelinkFunction().

llvm-svn: 9199
2003-10-17 18:27:00 +00:00
Brian Gaeke
9b4da738dd Fix a typo in a comment, and zap a blank line.
llvm-svn: 9184
2003-10-16 23:33:38 +00:00
Misha Brukman
d5c9118c89 JIT.cpp:
* #include "llvm/ModuleProvider"
* alphabetize #includes
* omit extraneous parens in pointer expressions

VM.cpp:
* #include "llvm/ModuleProvider"
* alphabetize #includes

llvm-svn: 9182
2003-10-16 21:19:34 +00:00
Misha Brukman
45a9016e1d * Reorder includes as per the style guide
* Move the constructors from .h file here
* Document ExecutionEngine::create()
* Catch exception possibly thrown by ModuleProvider::releaseModule()

llvm-svn: 9181
2003-10-16 21:18:05 +00:00
Misha Brukman
50fa0a7bae Order #includes as per the style guide.
llvm-svn: 9128
2003-10-14 21:42:11 +00:00
Misha Brukman
5252af2728 Enabling incremental bytecode loading in the JIT:
* The VM is now constructed with a ModuleProvider

llvm-svn: 9125
2003-10-14 21:37:41 +00:00
Misha Brukman
cc1cfd01ed Enabling incremental bytecode loading in the JIT:
* ExecutionEngine and VM can be constructed using a ModuleProvider.

llvm-svn: 9124
2003-10-14 21:36:31 +00:00
Brian Gaeke
143f9b5000 Make mmap's fd for anonymous memory acquisition default to -1, except on
Linux. This is consistent with what FreeBSD and Solaris both want.
This makes the JIT work on FreeBSD 5.1-RELEASE. Whee.

llvm-svn: 9045
2003-10-11 03:51:18 +00:00
Brian Gaeke
a3f850a182 Don't include Config/stdio.h or <stdio.h>.
llvm-svn: 9031
2003-10-10 18:46:29 +00:00
Misha Brukman
e7d07e3cf1 * Tabs to spaces
* Doxygenified function comments
* Added FIXMEs to solicit documentation for other functions

llvm-svn: 9022
2003-10-10 17:45:12 +00:00
Misha Brukman
32c5aec6ec Fix spelling.
llvm-svn: 9021
2003-10-10 17:42:19 +00:00
Brian Gaeke
c38ad8b86e Never set any signal handlers.
Never call setjmp(), longjmp() or strsignal().

llvm-svn: 9014
2003-10-10 17:03:22 +00:00
Brian Gaeke
e90a3199eb Rewrite head-of-file comment.
In lookupFunction():
 Change to use "F" for Function argument instead of ancient "M".
 Remove commented-out code.
 Change to use GetAddressOfSymbol instead of dlsym.

llvm-svn: 9013
2003-10-10 17:03:10 +00:00
Brian Gaeke
30e2817dc5 Change to use GetAddressOfSymbol instead of dlsym.
llvm-svn: 9012
2003-10-10 17:02:42 +00:00
Chris Lattner
01d8fd6a3b Do not read past the end of the contained type list
llvm-svn: 8986
2003-10-09 20:31:18 +00:00
Chris Lattner
151444f98f Actually _PASS IN_ NO_RESERVE if we have it.
Thanks to Brian for fixing this obvious oops

llvm-svn: 8899
2003-10-06 19:07:41 +00:00
Chris Lattner
68f6d33416 Squelch warning
llvm-svn: 8659
2003-09-22 20:33:34 +00:00
Chris Lattner
a54026a27b Change FunctionInfo from being an annotation put on Functions to be
something which is mapped from functions.

llvm-svn: 8580
2003-09-17 17:26:22 +00:00
Misha Brukman
262290ec19 * Move include files from middle of file to the top where they belong, moving
the #define up there too
* Since we're including system headers, use the ones in include/llvm/Config
* While we're here, use the canonical LLVM header ordering algorithm

llvm-svn: 8463
2003-09-10 20:52:05 +00:00
Misha Brukman
286f1a0fe8 Fix warning when _POSIX_MAPPED_FILES is already defined in unistd.h
llvm-svn: 8436
2003-09-10 15:09:45 +00:00
Chris Lattner
978ba8d937 Remove a bunch of unneeded stuph
llvm-svn: 8400
2003-09-08 18:19:58 +00:00
Chris Lattner
6c68b828f6 Reorder #includes to follow LLVM conventions
llvm-svn: 8375
2003-09-05 20:08:15 +00:00
Brian Gaeke
ba6d0a6759 ExecutionEngine.h, GenericValue.h --> include/llvm/ExecutionEngine/
Build ExecutionEngine as library.

llvm-svn: 8370
2003-09-05 19:39:22 +00:00
Brian Gaeke
8e1bb0bcb2 Make getOperandValue and executeCastOperation methods of Interpreter.
This lets us protect a few more ExecutionEngine methods.

llvm-svn: 8367
2003-09-05 18:55:03 +00:00
Brian Gaeke
e157a77485 Make CreateArgv part of lli rather than part of ExecutionEngine.
Switch Interpreter and JIT's "run" methods to take a Function and a vector of
 GenericValues.
Move (almost all of) the stuff that constructs a canonical call to main()
 into lli (new methods "callAsMain", "makeStringVector").
Nuke getCurrentExecutablePath(), enableTracing(), getCurrentFunction(),
 isStopped(), and many dead decls from interpreter.
Add linux strdup() support to interpreter.
Make interpreter's atexit handler runner and JIT's runAtExitHandlers() look
 more alike, in preparation for refactoring.
atexit() is spelled "atexit", not "at_exit".

llvm-svn: 8366
2003-09-05 18:42:01 +00:00
Brian Gaeke
7be0ff04e5 Remove printOperandInfo(), and simplify run().
llvm-svn: 8362
2003-09-05 05:22:08 +00:00
Brian Gaeke
b42a2de8a9 Remove support for printing values from a module by name, only used
w/ interactive keyboard entry of names.
With that, Support.cpp is history.

llvm-svn: 8360
2003-09-05 05:04:32 +00:00
Brian Gaeke
edded6bce7 Remove support for interactive (step finish next) instructions.
Remove printCurrentInstruction, printStackFrame and infoValue
 (only used interactively) and other unused methods of Interpreter.
Fold UserInput.cpp containing only callMainFunction() into Interpreter.cpp.
Remove unused Profile flag.

llvm-svn: 8359
2003-09-05 04:46:26 +00:00
Brian Gaeke
5efbdb852a Remove support for breakpoints (not used).
Remove some dead code and whitespace.

llvm-svn: 8346
2003-09-04 23:15:40 +00:00
Brian Gaeke
0fdcd57402 Move EE dtor where it belongs
llvm-svn: 8345
2003-09-04 22:57:27 +00:00
Brian Gaeke
6d7d9f9cd9 Interpreter cleanups:
Get rid of support for DebugMode (make it always off).
Mung some comments.
Get rid of interpreter's PROFILE_STRUCTURE_FIELDS and PerformExitStuff
 which have been disabled forever.
Get rid of -abort-on-exception (make it always on).
Get rid of user interaction stuff (debug mode innards).
Simplify Interpreter's callMainFunction().

llvm-svn: 8344
2003-09-04 22:21:24 +00:00
Brian Gaeke
cec978e0ed ExecutionEngine.cpp: Move execution engine creation stuff into a new
static method here.
 Remove some extra blank lines.
ExecutionEngine.h: Add its prototype.
lli.cpp: Call it.

Make creation method for each type of EE into a static method of its
own subclass.

Interpreter/Interpreter.cpp: ExecutionEngine::createInterpreter -->
 Interpreter::create
Interpreter/Interpreter.h: Likewise.
JIT/JIT.cpp: ExecutionEngine::createJIT --> VM::create
JIT/VM.h: Likewise.

llvm-svn: 8343
2003-09-03 20:34:19 +00:00
Chris Lattner
f2e4f5a388 Preselection is now integrated into the Sparc target library
llvm-svn: 8305
2003-09-01 20:30:17 +00:00
Chris Lattner
25669f3e09 Sparc peephole optimizer moved out of post-opts library into Sparc target library
llvm-svn: 8302
2003-09-01 20:26:14 +00:00
Chris Lattner
94184ddd7b Consult the target data, not the module, about how large the current pointer
size is.  This ensures that if the module has no specified pointer size that
things will work correctly.

llvm-svn: 8136
2003-08-24 19:55:26 +00:00
Chris Lattner
24b58d4b81 Targets now configure themselves based on the source module, not on the
ad-hoc "Config" flags

llvm-svn: 8134
2003-08-24 19:50:53 +00:00
Chris Lattner
688dd40912 Add preliminary support for "any" pointersize/endianness. This will need
to change soon though.

llvm-svn: 8123
2003-08-24 14:02:47 +00:00
Chris Lattner
d9a212abca Minor cleanups: wrap at 80 lines. Convert file comment to doxygen format and
llvm style

llvm-svn: 8024
2003-08-21 21:32:12 +00:00
John Criswell
8bc390da1b The JIT now passes the environment pointer to the main() function when it
starts a program.  This allows the GNU env program to compile and JIT under
LLVM.

llvm-svn: 8022
2003-08-21 21:12:30 +00:00
Chris Lattner
785885a8c0 no really, implement it!
llvm-svn: 7955
2003-08-18 17:33:15 +00:00
Chris Lattner
d737232814 Add support for casting any pointer to any integer type
llvm-svn: 7953
2003-08-18 17:23:40 +00:00
Misha Brukman
56f7db4178 Spell `necessary' correctly.
llvm-svn: 7944
2003-08-18 14:43:39 +00:00
Chris Lattner
0427dd4f4f rename selection library to selectiondag
llvm-svn: 7878
2003-08-15 04:56:09 +00:00
Chris Lattner
25f5c7bbb3 Implement a _REAL_ memory manager for the code generated by the JIT. This
speeds up program execution by 15% pretty consistently for large programs

llvm-svn: 7845
2003-08-14 18:35:27 +00:00
Brian Gaeke
2e59087317 Deconstify parameter to getPointerToFunction().
llvm-svn: 7822
2003-08-13 18:17:54 +00:00
Brian Gaeke
39ff839ca3 Deconstify parameter to getPointerToFunction().
Use a FunctionPassManager instead of a PassManager.

llvm-svn: 7820
2003-08-13 18:16:50 +00:00
Brian Gaeke
a6ca67ed4a Deconstify parameter to getPointerToFunction().
Run passes on single function (hey, just-in-time compilation!)
 instead of the entire module that contains it.

llvm-svn: 7819
2003-08-13 18:16:34 +00:00
Brian Gaeke
f162b11e38 In ExecutionEngine::getPointerToGlobal(), throw away const qualifier
on Function * when passing it to getPointerToFunction().

llvm-svn: 7818
2003-08-13 18:16:14 +00:00
Chris Lattner
6cc411cb24 Incorporate mapping library into the sparc library
llvm-svn: 7800
2003-08-13 02:28:20 +00:00
Chris Lattner
a0d327277d Include the new selection library for the X86 target
llvm-svn: 7720
2003-08-11 14:59:53 +00:00
Chris Lattner
7e9e83e817 Specify DEBUG_TYPE's for the JIT debug messages
llvm-svn: 7604
2003-08-05 17:00:32 +00:00
Chris Lattner
64fade1536 DEBUG got moved to Debug.h
llvm-svn: 7491
2003-08-01 22:13:59 +00:00
Misha Brukman
442175ec3b * Stop hard-coding a value for beginning of emitted code on Sparc since we can
now handle far calls (i.e., beyond the 30-bit limit in call instructions).
* As a side-effect, this allows us to unify and clean up the mmap() call and
  code around it.

llvm-svn: 7381
2003-07-29 16:57:16 +00:00
Misha Brukman
c77e286633 Add rationale for the MAP_ANONYMOUS vs. MAP_ANON flags.
llvm-svn: 7368
2003-07-28 19:26:19 +00:00
Misha Brukman
c0193ca460 Add ability for external C code to get pointers to functions given their name.
This us used by bugpoint -- when code is compiled to a shared object to be
JITted, it must use the JIT's lazy resolution method to find function addresses,
because some functions will not be available at .so load time, as they are in
the bytecode file.

llvm-svn: 7363
2003-07-28 19:09:06 +00:00
Misha Brukman
752c6f4548 Clean up code dealing with RTLD_SELF differences on Sparc and X86.
llvm-svn: 7362
2003-07-28 19:07:30 +00:00
Misha Brukman
cd6e03cb52 Fix reference to architecture.
llvm-svn: 7361
2003-07-28 19:06:50 +00:00
Misha Brukman
f4702ed4d1 Add in support to load shared objects (-load is provided by Support library).
llvm-svn: 7360
2003-07-28 19:06:19 +00:00