1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

1692 Commits

Author SHA1 Message Date
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
Chris Lattner
fc4a57d904 Fix space
llvm-svn: 7273
2003-07-23 20:21:06 +00:00
Chris Lattner
dd48c4b1e4 Remove redundant const qualifier
llvm-svn: 7254
2003-07-23 15:30:32 +00:00
Misha Brukman
755aa86ca3 Cleaned up the code which chooses the appropriate value for the file descriptor
to pass to dlsym() -- Linux/x86 wants 0 while Sparc/Solaris wants RTLD_SELF,
which is not zero. Thanks to Chris for the suggestion.

llvm-svn: 7204
2003-07-18 18:33:38 +00:00
Misha Brukman
45dc28808e Clean up my last checkin: code is easier to read and explains the differences in
usage of the special file handle RTLD_SELF on Sparc/Solaris vs. 0 on Linux/x86.

llvm-svn: 7177
2003-07-15 15:58:26 +00:00
Misha Brukman
6a087a3a2f On Sparc/Solaris, the special handle RTLD_SELF is used as a handle referring to
the program's executing image, not 0 as it is on Linux/x86 and possibly other
systems.

llvm-svn: 7176
2003-07-15 15:55:32 +00:00
Misha Brukman
009e42dd43 * If compiling on X86 or Sparc, automagically enable the JIT for that arch
* Setting ENABLE_X86_JIT or ENABLE_SPARC_JIT on the `make' command-line will
  force the inclusion of that JIT on a different architecture
* If neither JIT is enabled (e.g., compiling on a different architecture), the
  -march option will not be available to LLI.
* As a side effect of the $ARCH variable, the Sparc LLI can now link just a bit
  faster by not including the x86 library.

llvm-svn: 7070
2003-07-02 17:53:19 +00:00
John Criswell
258dfc0319 Merged in autoconf branch. This provides configuration via the autoconf
system.

llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Brian Gaeke
a00e8c6732 Get rid of the duplicate '0x' in debug mode.
llvm-svn: 7012
2003-06-30 18:06:20 +00:00
Brian Gaeke
af128adb0a Include <cmath> instead of <math.h>
Remove isnan; it's too unportable to handle cleanly at this point.

llvm-svn: 6866
2003-06-23 19:41:55 +00:00
Brian Gaeke
04d082abe5 Add #ifdef hack for MAP_ANONYMOUS being spelled MAP_ANON on some platforms.
(We're already talking about autoconf'ing this, so I'm assuming this hack
will be short-lived...I just don't want it to get lost in my working files.)

llvm-svn: 6761
2003-06-17 23:14:06 +00:00
Brian Gaeke
17f041ba98 Use $(PLATFORMLIBDL) to selectively bring in -ldl only on those platforms where
it is needed.

llvm-svn: 6753
2003-06-17 20:09:18 +00:00
Brian Gaeke
db4d9c9bd8 Use std::isnan instead of isnan. Brought back to you from the
future, by the reconciliation of the C++ and C99 standards. Someday.

llvm-svn: 6751
2003-06-17 19:59:17 +00:00
Chris Lattner
6d0553444b Life is too short. Link in too much stuff on Linux to make building on sun easier
llvm-svn: 6748
2003-06-17 19:14:59 +00:00
Chris Lattner
0fc18257a9 The never-ending odyssey trying to get sparc to link
llvm-svn: 6747
2003-06-17 18:19:52 +00:00
Chris Lattner
85f1b38638 Make sure to get the value of ARCH before we use it
llvm-svn: 6746
2003-06-17 17:53:35 +00:00
Chris Lattner
0c7e4fdfa2 Do not link in the Sparc JIT when building on X86. Eventually the sparc will not
link in the X86 JIT either, but this makes testing easier.

For some reason, the sparc JIT was breaking the X86 JIT when it was linked in. :(

llvm-svn: 6745
2003-06-17 15:54:52 +00:00
Chris Lattner
0aa503a72d Apparently "sparc" is a macro on sparcs. Ugh. :)
llvm-svn: 6744
2003-06-17 15:54:02 +00:00
Chris Lattner
ed38cd7aa9 Whoops, didn't mean to check that in :(
llvm-svn: 6743
2003-06-17 15:46:34 +00:00
Chris Lattner
1afd194a33 Use more structured command line option processing
llvm-svn: 6742
2003-06-17 15:43:13 +00:00
Chris Lattner
1f384965af #ifdef out code that only applies when the HOSTARCH = sparc
llvm-svn: 6741
2003-06-17 15:32:38 +00:00
Chris Lattner
66f5f27dcb Add #include for older GCC's
llvm-svn: 6670
2003-06-08 06:43:57 +00:00
Misha Brukman
1a3c1a6208 ::: HACK ALERT ::: HACK ALERT ::: HACK ALERT ::: HACK ALERT ::: HACK ALERT :::
The JIT is designed to code-generate a function at-a-time. That means that any
pass can only make local changes to its function. Period.

Because the Sparc PreSelection pass claims to be a BasicBlock pass while adding
globals to the Module, it cannot be run with the other passes, because by this
time, the globals have been output already by the JIT, and the addresses of any
globals appearing AFTER this point are not recognized.

However, the PreSelection pass is a requirement for correctness in the Sparc
codegen path, so it MUST be run.

::: HACK ALERT ::: HACK ALERT ::: HACK ALERT ::: HACK ALERT ::: HACK ALERT :::

llvm-svn: 6650
2003-06-06 06:59:55 +00:00
Misha Brukman
6762302093 Output function address as hex.
llvm-svn: 6649
2003-06-06 06:52:35 +00:00
Misha Brukman
999c7802ab Removed debug print statement.
llvm-svn: 6641
2003-06-06 00:00:54 +00:00
Misha Brukman
b2cf47cfc1 * Institute a hack for the Sparc call to mmap() to get our generated code to be
laid out closer to the VM so that calls to library functions (e.g. puts()) and
  callback (e.g.  JITResolver::CompilationCallback) fit into 30 bits of the call
  instruction.
* Abort if architecture is not yet supported (not X86 or Sparc) because it
  likely requires a different set of parameters to mmap() .
* Stop using hard-coded values for page size; use sysconf(_SC_PAGESIZE) instead.

llvm-svn: 6610
2003-06-04 19:45:25 +00:00
Misha Brukman
6e22f0fa52 Sparc's dlsym() requires the special operand RTLD_SELF to find a symbol in the
currently-running process.

llvm-svn: 6592
2003-06-04 01:57:22 +00:00
Misha Brukman
1c70c3f7a3 * Removed SparcEmitter.cpp; rolled into lib/Target/Sparc/SparcV9CodeEmitter.cpp
* No more createX86Emitter() vs. createSparcEmitter() -- there can be only one
* As a result, the memory management semantics must be handled according to
  platform -- the parameters to mmap() are particularly sensitive to the host
  architecture.

llvm-svn: 6527
2003-06-02 03:23:16 +00:00
Brian Gaeke
bbbe5d71d2 The flag modifications weren't picking up the old values of the
flags before. Save them in a temporary variable, then restore them from the
temporary after creating the new constant.

llvm-svn: 6520
2003-06-02 02:10:31 +00:00
Chris Lattner
1136441fcf Remove obsolete code
llvm-svn: 6518
2003-06-02 00:09:00 +00:00
Chris Lattner
a87f53efca Move target specific code to target files. The new MachineCodeEmitter
class is actually target independent!

llvm-svn: 6517
2003-06-01 23:24:36 +00:00
Brian Gaeke
495826a0e5 Fix induction variable name clash in for loops, in finishFunction().
Modify new MachineOperand so that its flags match the old MachineOperand's
 flags, for the flags that matter.

llvm-svn: 6513
2003-06-01 22:08:29 +00:00
Misha Brukman
afa8e60f9f Fixed rewriting of branches -- they now work forward and backward.
llvm-svn: 6463
2003-05-31 06:26:48 +00:00
Misha Brukman
a9a5c77dd4 Since malloc is no longer used, no need to free() memory.
Fixed BasicBlock patching by supplying correct type for the displacement.

llvm-svn: 6453
2003-05-30 20:39:37 +00:00
Brian Gaeke
ad23dd697f Fix call to mmap, so that it can be used on sparc.
llvm-svn: 6424
2003-05-30 03:37:13 +00:00
Misha Brukman
e1a9c59304 mmap() seems to be failing on Sparc, so just use malloc()/free() .
llvm-svn: 6387
2003-05-28 18:44:38 +00:00
Misha Brukman
4931c59635 Link in Sparc libs for the JIT, even on X86 to be able to support debugging
of Sparc JIT (printing out instrs) on X86. Con: this increases linking time.

llvm-svn: 6361
2003-05-27 21:42:05 +00:00
Misha Brukman
afffd58fe6 Allow for specification of which JIT to run on the commandline.
`lli -march=x86' or `lli -march=sparc' will forcefully select the JIT even on a
different platform. Running lli without the -march option will select the JIT
for the platform that it's currently running on.

Pro: can test Sparc JIT (debug printing mode) on X86 -- faster to compile/link
LLVM source base to test changes.
Con: Linking lli on x86 now pulls in all the Sparc libs -> longer link time
(but X86 can bear it, right?)

In the future, perhaps this should be a ./configure option to enable/disable
target JITting...

llvm-svn: 6360
2003-05-27 21:40:39 +00:00
Chris Lattner
bfb822f655 Fix typeos
llvm-svn: 6204
2003-05-14 17:53:49 +00:00
Chris Lattner
5e5564a8de Add support for more constant expressions
llvm-svn: 6203
2003-05-14 17:51:49 +00:00
Chris Lattner
cbf31910a5 Add support for atexit function, remove support for __main function
llvm-svn: 6194
2003-05-14 14:21:30 +00:00
Chris Lattner
e7f979708b Add support for atexit handlers to the JIT, fixing 2003-05-14-AtExit.c
llvm-svn: 6193
2003-05-14 13:53:40 +00:00
Chris Lattner
6f80e1b3c7 Fix compilation problems with previous checking *blush*
llvm-svn: 6191
2003-05-14 13:27:36 +00:00
Chris Lattner
bda312754a Add a framework for intercepting system calls
llvm-svn: 6190
2003-05-14 13:26:47 +00:00
Chris Lattner
65d299c1fa Clean up cast
llvm-svn: 6174
2003-05-13 20:29:17 +00:00
Chris Lattner
46f2fc75da Make sure that globals are emitted AFTER the passmanager is set up for the JIT,
because the globals may refer to functions that need to be compiled!

llvm-svn: 6105
2003-05-12 02:14:34 +00:00
Chris Lattner
023c628a58 switch main LLI core execution to use an InstVisitor instead of a switch statement
llvm-svn: 6081
2003-05-10 21:22:39 +00:00
Chris Lattner
011dba165e Fix testcase: SingleSource/UnitTests/2003-05-02-DependantPHI.c
llvm-svn: 6074
2003-05-10 20:21:16 +00:00
Chris Lattner
62fa228a18 Add support for function stubs, which allow calling functions which need to
have an address available, but have not yet been code generated.

llvm-svn: 6059
2003-05-09 03:30:07 +00:00
Chris Lattner
3656ffff9b Minor speedup by avoiding callbacks to functions already generated
llvm-svn: 6052
2003-05-08 21:44:21 +00:00
Chris Lattner
d397ac4aaf Improve efficiency of JIT by having it use direct function calls instead of
signals to regain control from the executing code

llvm-svn: 6051
2003-05-08 21:34:11 +00:00
Chris Lattner
35b3a10cf3 assert early instead of late for unimplemented feature
llvm-svn: 6050
2003-05-08 21:08:43 +00:00
Chris Lattner
f5a5ed1a59 Implement varargs support for LLI!
llvm-svn: 6043
2003-05-08 16:52:43 +00:00
Chris Lattner
ba9142280a Add a pointersize/endianness safe load routine to match the store routine
llvm-svn: 6042
2003-05-08 16:52:16 +00:00
Chris Lattner
818643d3e9 A large number of simple changes:
* s/Method/Function
  * Kill some obsolete (external) functions that used to be to support tracing

llvm-svn: 6041
2003-05-08 16:18:31 +00:00
Chris Lattner
6aa2e81ec4 Add support for recording arguments passed through the ... of a varargs function
llvm-svn: 6040
2003-05-08 16:06:52 +00:00
Chris Lattner
ba6d6034d5 Fix bug: Jello/2003-05-07-ArgumentTest.llx
Also fixes yacr2/ks benchmarks

llvm-svn: 6017
2003-05-07 20:31:37 +00:00
Chris Lattner
bbe1aba425 Remove two fields from TargetData which are target specific.
llvm-svn: 5963
2003-04-26 20:11:09 +00:00
Chris Lattner
dc49712791 Only do the %ld -> %lld promotion when running a 64 bit bytecode on a 32 bit host
llvm-svn: 5942
2003-04-25 18:28:44 +00:00
Chris Lattner
e8eb2cb855 Add __strdup
llvm-svn: 5941
2003-04-25 18:23:38 +00:00
Chris Lattner
4196cc4916 MAke sure that LLI properly configures align_of(double)
llvm-svn: 5938
2003-04-25 06:15:05 +00:00
Chris Lattner
b72c6d38da Fix problem where we would read 64 bits worth of pointer information, even on 32 bit targets!
llvm-svn: 5930
2003-04-25 04:21:19 +00:00
Chris Lattner
ec21fdc5ce Fix bug where pointers were assumed to always be 64 bits in size!
llvm-svn: 5890
2003-04-23 20:41:01 +00:00
Chris Lattner
84efc8b467 Add memcpy
llvm-svn: 5887
2003-04-23 20:23:16 +00:00
Chris Lattner
55a3471dab Fix a problem with setcc instructions and pointers
llvm-svn: 5886
2003-04-23 19:55:35 +00:00
Chris Lattner
34be06fad1 Implement a bunch of new external functions
llvm-svn: 5885
2003-04-23 19:55:24 +00:00
Chris Lattner
90d0ad7683 Implement &|^ on bool values
llvm-svn: 5884
2003-04-23 19:21:00 +00:00
Chris Lattner
48e894f97b Add support for _IO_getc function used on linux
llvm-svn: 5883
2003-04-23 19:20:50 +00:00
Chris Lattner
896c6970fa * Implement access to external variables in LLI
* Implement GetElementPtr constant expressions when initializing global variables

llvm-svn: 5880
2003-04-23 19:01:49 +00:00
Chris Lattner
9938a43aac We now need to link libscalar to get the switch lowering pass
llvm-svn: 5874
2003-04-23 16:43:02 +00:00
Chris Lattner
4ffd4c9cd8 Kill using declarations
Kill code for invalid operations on pointers

llvm-svn: 5856
2003-04-22 21:22:33 +00:00
Chris Lattner
56dc44e98a Implement cast to bool
llvm-svn: 5855
2003-04-22 21:15:56 +00:00
Chris Lattner
bdfa086221 Get rid of extraneous arguments to implementation functions
llvm-svn: 5852
2003-04-22 20:37:39 +00:00
Chris Lattner
43d3c3666b Add support to LLI for switch instruction
llvm-svn: 5851
2003-04-22 20:34:47 +00:00
Chris Lattner
b315dbe98a Make stderr, stdout, stdin work with LLI
llvm-svn: 5832
2003-04-21 22:44:36 +00:00
Chris Lattner
dd3c1121d0 Fix wierd idiom
llvm-svn: 5831
2003-04-21 22:43:32 +00:00
Chris Lattner
2fc856e8b6 fprintf CAN take exactly 2 args
llvm-svn: 5830
2003-04-21 22:43:20 +00:00
Chris Lattner
7bfad931b8 Implement scanf and fix sscanf to actually endian swap the results correctly
llvm-svn: 5763
2003-03-31 22:12:37 +00:00
Chris Lattner
ce3e651af6 Fix typeo
llvm-svn: 5624
2003-02-25 21:14:59 +00:00
Chris Lattner
79997d01d7 Fix warnings on sparc
llvm-svn: 5427
2003-01-29 18:02:02 +00:00
Chris Lattner
0d35f25ed7 Fix didn't fix the race condition in the makefiles
llvm-svn: 5394
2003-01-22 15:41:10 +00:00
Chris Lattner
7964483787 Fix race condition in Makefile
llvm-svn: 5380
2003-01-21 15:20:50 +00:00
Chris Lattner
424cf48a30 Add support for named functions
llvm-svn: 5258
2003-01-13 01:00:48 +00:00
Chris Lattner
94057813b1 Dead file
llvm-svn: 5257
2003-01-13 01:00:28 +00:00
Chris Lattner
e1dc5ea665 Add support for new types of values
llvm-svn: 5256
2003-01-13 01:00:12 +00:00
Chris Lattner
c1e536c191 Bad segvs actually cause a segv now
llvm-svn: 5255
2003-01-13 01:00:02 +00:00
Chris Lattner
0cd2433ab5 * Wrap at 80 columns
* Fix a ton of warnings
* Implement puts

llvm-svn: 5254
2003-01-13 00:59:47 +00:00
Chris Lattner
fbaa392c19 Handle value promotion properly to work with tracing better
llvm-svn: 5253
2003-01-13 00:58:52 +00:00
Chris Lattner
cffd554b7f No longer need scalaropts lib
llvm-svn: 5252
2003-01-13 00:58:18 +00:00
Chris Lattner
e84201b23e Add fixme
llvm-svn: 5251
2003-01-13 00:58:06 +00:00
Chris Lattner
1ba4cee745 Add diagnostic output
llvm-svn: 5157
2002-12-28 20:00:15 +00:00
Chris Lattner
2ee368e312 Fixes to compile with GCC 3.2
llvm-svn: 5134
2002-12-24 00:39:16 +00:00
Chris Lattner
f67bcaf831 Initial checkin
llvm-svn: 5127
2002-12-24 00:01:22 +00:00
Chris Lattner
5fe4097f52 Initial checkin of new LLI with JIT compiler
llvm-svn: 5126
2002-12-24 00:01:05 +00:00
Chris Lattner
42057e4d2a Substantial changes to refactor LLI to incorporate both the Jello JIT and
the traditional LLI interpreter

llvm-svn: 5125
2002-12-23 23:59:41 +00:00
Chris Lattner
6b8e873886 Add support for isnan
llvm-svn: 5111
2002-12-20 04:18:13 +00:00
Chris Lattner
883827db1c Namespacify more
llvm-svn: 4956
2002-12-08 06:01:34 +00:00
Chris Lattner
f525e2f95e Add support to count the number of dynamic instructions executed by LLI
llvm-svn: 4955
2002-12-08 05:51:08 +00:00
Chris Lattner
b5027095e5 - Eliminated the deferred symbol table stuff in Module & Function, it really
wasn't an optimization and it was causing lots of bugs.

llvm-svn: 4779
2002-11-20 18:36:02 +00:00
Chris Lattner
dda5d522bc Implement feof
llvm-svn: 4627
2002-11-08 19:10:26 +00:00
Chris Lattner
8674baf660 Implement freopen for burg
llvm-svn: 4606
2002-11-07 19:33:50 +00:00
Chris Lattner
419dd5f0c1 Make command line arguments setup be endian correct!!
llvm-svn: 4605
2002-11-07 19:29:31 +00:00
Chris Lattner
84ed927ae7 Implement fprintf
llvm-svn: 4585
2002-11-06 23:05:03 +00:00
Chris Lattner
b1a9401c59 Implement fputc and ungetc to allow burg to run in lli
llvm-svn: 4584
2002-11-06 22:59:28 +00:00
Chris Lattner
c23b57a60d No need to explicitly inclue ExportSymbols now
llvm-svn: 4543
2002-11-04 20:50:57 +00:00
Chris Lattner
0396c5461e Fix two problems:
* Load Implementation can cause unaligned memory accesses, which caused
    problems for sparc.
  * cast from pointer to pointer would zero the upper 32 bits of the pointer
    which obviously causes problems on 64 bit hosts.

llvm-svn: 4454
2002-10-30 21:47:57 +00:00
Chris Lattner
c44cc692c6 Fix a major bug in lli
llvm-svn: 4289
2002-10-26 01:57:15 +00:00
Chris Lattner
b7af4caaf8 - Fix LLI so that it simulates the endianness of the target machine
correctly, despite the fact that the host machine might not be the same.

llvm-svn: 4180
2002-10-15 20:34:05 +00:00
Chris Lattner
bdbc272229 * Implement the getc() function
* Support usage of stdin, stdout & stderr correctly in LLI!

llvm-svn: 4022
2002-10-02 21:12:13 +00:00
Chris Lattner
f6b465732c Cleanup #includes, expose module
llvm-svn: 4021
2002-10-02 21:11:16 +00:00
Chris Lattner
68960ff1c7 Expose TD to ExternalFunctions.cpp
llvm-svn: 4020
2002-10-02 21:10:48 +00:00
Chris Lattner
7de3aaa26f * Fix a bug that was causing lli to misrun:
test/Regression/Transforms/DecomposeMultiDimRefs/mixedindices.c
* Eliminate unneccesary #include

llvm-svn: 3712
2002-09-13 23:30:42 +00:00
Chris Lattner
7fa7135b32 Export symbols for linux
llvm-svn: 3707
2002-09-13 22:20:19 +00:00
Chris Lattner
c96a7a51bf Another portability patch graciously provided by Casey Carter
llvm-svn: 3698
2002-09-13 14:41:38 +00:00
Chris Lattner
cb973bf5ee - Change getelementptr instruction to use long indexes instead of uint
indexes for sequential types.

llvm-svn: 3683
2002-09-11 01:21:35 +00:00
Chris Lattner
3ce5b343c5 - Renamed Type::isIntegral() to Type::isInteger()
- Added new method Type::isIntegral() that is the same as isInteger, but
    also accepts bool.

llvm-svn: 3574
2002-09-03 01:08:28 +00:00
Chris Lattner
236778fa0f Implement ConstantPointerRef support, & ConstantExpr support for Cast, GEP & Add.
llvm-svn: 3516
2002-08-27 22:33:45 +00:00
Chris Lattner
20b85d96e4 Eliminated the MemAccessInst class, folding contents into GEP class.
llvm-svn: 3487
2002-08-22 23:37:20 +00:00
Chris Lattner
969c616d51 Load & StoreInst no longer derive from MemAccessInst, so we don't have
to handle indexing anymore

llvm-svn: 3485
2002-08-22 22:49:05 +00:00
Chris Lattner
c8183d92e3 Remove support for NOT instruction
llvm-svn: 3313
2002-08-14 17:45:39 +00:00
Chris Lattner
3d013e4c40 Minor change to make lli print out characters numerically as well as symbolically
llvm-svn: 3303
2002-08-13 20:45:11 +00:00
Chris Lattner
5f2b5e70e0 Fix problem where lli would not print out a 64 bit value when the client code
uses the modifier "%ld".  Now lli passes off "%lld" to the underlying runtime
library in this case.

llvm-svn: 3230
2002-08-02 23:08:32 +00:00
Chris Lattner
64e62f9a50 Fix one real nasty bug
llvm-svn: 3227
2002-08-02 22:06:04 +00:00
Chris Lattner
f4d892dffb Fix gcc 3.1 complaint
llvm-svn: 3091
2002-07-25 17:37:05 +00:00
Chris Lattner
24bcbdd155 *** empty log message ***
llvm-svn: 3002
2002-07-23 17:52:38 +00:00
Chris Lattner
99ad379582 *** empty log message ***
llvm-svn: 2985
2002-07-22 02:10:13 +00:00
Chris Lattner
128410dd4c Implementing shift left & shift right on pointers
llvm-svn: 2844
2002-07-09 18:42:36 +00:00
Chris Lattner
d7cbd7d5d2 MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt

llvm-svn: 2778
2002-06-25 16:13:21 +00:00
Chris Lattner
7d07dffa5f Remove explicit support for tracing code. It should be linked into the
executable just like everything else.

llvm-svn: 2674
2002-05-20 21:17:16 +00:00
Chris Lattner
7563f3d1fb Remove tracing code hack
llvm-svn: 2673
2002-05-20 21:16:46 +00:00
Vikram S. Adve
db5bc3b4a2 Link with test/Libraries/libinstr32.a for runtime routines
supporting tracing.  That should be moved to a "runtime" directory.

llvm-svn: 2660
2002-05-19 16:00:28 +00:00
Vikram S. Adve
02f9033264 Added external functions for hashing pointers to sequence numbers.
llvm-svn: 2659
2002-05-19 15:59:25 +00:00
Chris Lattner
9e1c79995e Updates to move some header files out of include/llvm/Transforms into
the Scalar and Utils subdirectories

llvm-svn: 2523
2002-05-07 18:36:35 +00:00
Chris Lattner
8898eec72c Change usage of isPointerType to use isa
llvm-svn: 2487
2002-05-06 16:15:49 +00:00
Chris Lattner
beb2a36b9e Implement the NOT operator.
llvm-svn: 2455
2002-05-03 19:52:30 +00:00
Chris Lattner
dff0195064 Implement cast operations on booleans to allow casting bools to ints, f.e.
llvm-svn: 2437
2002-05-02 19:28:45 +00:00
Chris Lattner
05a37c1dae Fix #include broken by iMemory.h not including DerivedTypes.h
llvm-svn: 2407
2002-04-29 18:56:45 +00:00
Chris Lattner
9e194d76a1 FIXME removed: malloc/alloca ALWAYS have a size argument
llvm-svn: 2389
2002-04-28 21:57:33 +00:00
Chris Lattner
321a8cf4ba Split ConstantVals.h into Constant.h and Constants.h
llvm-svn: 2378
2002-04-28 19:55:58 +00:00
Chris Lattner
a903875f0f Eliminate use of SymTabValue class
llvm-svn: 2357
2002-04-28 04:55:14 +00:00
Chris Lattner
e4f2e7ecf4 Fix a bug printing out %c formated characters.
llvm-svn: 2277
2002-04-17 17:43:01 +00:00
Chris Lattner
4434e03eb6 Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.

llvm-svn: 2217
2002-04-09 19:59:31 +00:00
Chris Lattner
a5c460d052 Update comment to reflect class name change.
llvm-svn: 2213
2002-04-09 19:40:40 +00:00
Chris Lattner
ba71c8f7e1 Remove extranous #include
llvm-svn: 2183
2002-04-08 22:05:10 +00:00
Chris Lattner
8b16900b1b Remove asmwriter library from link line, because the useful contents of it
have been incorporated into the vmcore library.

llvm-svn: 2153
2002-04-07 22:35:30 +00:00
Chris Lattner
bc15ae64dd Change references to the Method class to be references to the Function
class.  The Method class is obsolete (renamed) and all references to it
are being converted over to Function.

llvm-svn: 2144
2002-04-07 20:49:59 +00:00
Chris Lattner
dc0566e721 s/Method/Function
llvm-svn: 2036
2002-03-29 03:57:15 +00:00
Chris Lattner
18073550b8 Change from Method to Function
llvm-svn: 1992
2002-03-26 18:02:30 +00:00
Chris Lattner
558efd4bf0 Remove runtime library in favor of users linking against real libraries.
llvm-svn: 1853
2002-03-11 17:57:13 +00:00
Chris Lattner
32669e6211 Do not link in runtime library anymore, assume that user manually links in
libraries.  Code should be generalized to allow lli to take -lc -lm arguments
in the future (todo)

llvm-svn: 1852
2002-03-11 17:52:43 +00:00
Chris Lattner
e71c9ba6d0 Implement a bunch of new functions to support the SPECINT mcf
benchmark

llvm-svn: 1841
2002-03-08 22:51:07 +00:00
Chris Lattner
44d96e69f4 Remove hack. This is better fixed in Makefile.common
llvm-svn: 1795
2002-02-24 23:25:46 +00:00
Chris Lattner
dcdf0532ff Build with newer compiler, with same bug
llvm-svn: 1793
2002-02-24 23:11:05 +00:00
Chris Lattner
f576e43330 Keep track of memory allocated by alloca so that it is freed appropriately
llvm-svn: 1776
2002-02-19 18:50:09 +00:00
Chris Lattner
801f59eb1f Implement exp function
llvm-svn: 1774
2002-02-18 19:06:25 +00:00
Chris Lattner
b0a2c5546b Method.h no longer includes BasicBlock.h
Method::inst_* is now in llvm/Support/InstIterator.h
GraphTraits specializations for BasicBlock and Methods are now in llvm/Support/CFG.h

llvm-svn: 1746
2002-02-12 21:07:25 +00:00
Chris Lattner
ce754be520 Add new abort-on-exceptions flag
llvm-svn: 1737
2002-02-12 15:47:23 +00:00
Chris Lattner
658f0b593d Make array bound checks optional and disabled by default.
llvm-svn: 1725
2002-02-11 20:19:16 +00:00
Chris Lattner
e77bf6231e Implement the clock() function
llvm-svn: 1573
2002-01-23 21:38:07 +00:00
Chris Lattner
10a9b7627d Eliminate opt library
llvm-svn: 1516
2002-01-21 23:13:46 +00:00
Chris Lattner
3dc9a2a61f Changes to build successfully with GCC 3.02
llvm-svn: 1503
2002-01-20 22:54:45 +00:00
Chris Lattner
59918ae040 * Support the new -q flag for automated tests
* Remove unsized array support
* Add pointer indexing support

llvm-svn: 1477
2001-12-14 16:49:29 +00:00
Chris Lattner
eed30bc7da Build runtime library with local GCCAS
llvm-svn: 1447
2001-12-13 00:44:23 +00:00
Chris Lattner
472385127d Implement sprintf
llvm-svn: 1445
2001-12-13 00:43:47 +00:00
Chris Lattner
c4a5815033 Renamed inst_const_iterator -> const_inst_iterator
Renamed op_const_iterator   -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()

llvm-svn: 1408
2001-12-04 00:03:30 +00:00
Chris Lattner
f6b7da2bb5 Rename ConstPoolVal -> Constant
Rename ConstPool*   -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h

llvm-svn: 1407
2001-12-03 22:26:30 +00:00
Chris Lattner
bcf2df7058 Split the PHINode class out from the iOther.h file into the iPHINode.h file
llvm-svn: 1405
2001-12-03 18:02:31 +00:00
Chris Lattner
463cc31132 Create a new #include "Support/..." directory structure to move things
from "llvm/Support/..." that are not llvm dependant.

Move files and fix #includes

llvm-svn: 1400
2001-11-27 00:03:19 +00:00
Chris Lattner
cead7793a7 Move DataTypes.h from llvm/Support to just Support
llvm-svn: 1399
2001-11-26 23:04:08 +00:00
Chris Lattner
90bdf397e1 Use pointertype where appropriate
llvm-svn: 1392
2001-11-26 19:20:16 +00:00
Chris Lattner
f4cbfaed0a Remove invalid,unneccesary ## token
llvm-svn: 1391
2001-11-26 19:19:27 +00:00
Chris Lattner
136ed3b396 * Implement array indexing in lli
* Add external atoi method as well as floor, and srand

llvm-svn: 1355
2001-11-26 18:18:18 +00:00
Chris Lattner
80788c6947 Rename cruft
llvm-svn: 1299
2001-11-14 11:28:18 +00:00
Chris Lattner
2d05a0dd7d Implement some more rand functions for em3d benchmark
llvm-svn: 1291
2001-11-13 05:46:08 +00:00
Chris Lattner
ab0f8a05f6 Print percentages for profiling info better
llvm-svn: 1274
2001-11-12 20:13:14 +00:00
Chris Lattner
29ad087a83 Print profile info if exit() is called
llvm-svn: 1268
2001-11-12 16:28:48 +00:00
Chris Lattner
28afda8ca4 Hack a structure profiling option together
llvm-svn: 1267
2001-11-12 16:19:45 +00:00
Chris Lattner
4bded629ca Correct problem that allows indirect function calls
llvm-svn: 1179
2001-11-07 20:12:30 +00:00
Chris Lattner
caf89d678c * Switch to operation on pointers with PointerTy more consistently
* Fix misspeling
* Catch SIGFPE for traps
* info XXX now prints the raw contents of the GenericValue
* Switch to calloc instead of malloc (temporarily I hope) to bandaid Olden benchmarks
* Implement binary And & Or
* Convert expressions like this:
     PointerTy SrcPtr = getOperandValue(I->getPtrOperand(), SF).PointerVal;
  to:
    GenericValue SRC = getOperandValue(I->getPtrOperand(), SF);
    PointerTy SrcPtr = SRC.PointerVal;
  because the prior way confuses purify.
* Taint the initial values of the value planes
* Handling 'print bb4' in the interpreter without crashing
* Print nicer stack frames with concise return type
* printf doesn't suck nearly as badly as it used to

llvm-svn: 1177
2001-11-07 19:46:27 +00:00
Chris Lattner
7627d5b279 *Print Stack traces better.
* Use the cache writer for all it's problems.
* print arguments to methods in stack traces.
*Print the current stack from for up/down commands.

llvm-svn: 1170
2001-11-07 05:31:27 +00:00
Chris Lattner
b9ca754b0d * Use cached writer to speed up printing and get symbolic types more consistently
* When a segfault or bus error occurs, stop the program, print a stack trace, and dump the user in the debugger mode

llvm-svn: 1169
2001-11-07 04:23:00 +00:00
Chris Lattner
7f56e171e5 Add %p format to printf, which MUST be used when printing pointer values.
llvm-svn: 1166
2001-11-07 02:57:33 +00:00
Chris Lattner
06d10f646d Implement log and drand48 for TSP bm
llvm-svn: 1165
2001-11-06 22:53:25 +00:00
Chris Lattner
d907c7c9eb Implement sqrt, implement printf better, simpler.
llvm-svn: 1161
2001-11-06 21:52:18 +00:00
Chris Lattner
38732a00f5 Be lenient on types so that programs that are not very typesafe will work
llvm-svn: 1104
2001-11-03 10:15:32 +00:00
Chris Lattner
1474ad4c46 Implement xor operator
llvm-svn: 1050
2001-10-30 20:54:36 +00:00
Chris Lattner
5ea831acc4 callExternalMethod now returns the return value of the function
llvm-svn: 1048
2001-10-30 20:28:23 +00:00
Chris Lattner
b773a4e59d Implement a gross function name map that must be used when linking statically
This is for use with purify

llvm-svn: 1047
2001-10-30 20:28:00 +00:00
Chris Lattner
d85d2dfcba * Add some assertions for checking internal error conditions
* Implement the 'rem' instruction
* Fix getelementptr to work right
* Copy the return result of an external function call into the receiving value
* Convert stuff to new style casts

llvm-svn: 1046
2001-10-30 20:27:31 +00:00
Chris Lattner
727495d6dc Don't fail to load runtime if running LLI from the current directory
llvm-svn: 1044
2001-10-30 16:40:37 +00:00
Chris Lattner
84d4bc52df Print out a label if we step into the first instruction of a basic block
llvm-svn: 1038
2001-10-29 20:44:34 +00:00
Chris Lattner
b4899254c0 * Fix pow wrapper to actually work
* Implement rudimentary printf support for lli

llvm-svn: 1037
2001-10-29 20:27:45 +00:00
Chris Lattner
3f63736182 Implement getelementptr instruction as well as the load and store forms
that incorporate gep

llvm-svn: 1036
2001-10-29 19:32:19 +00:00
Chris Lattner
c476c9b156 Remember to print out the next instruction if stepping over an external method call
llvm-svn: 1028
2001-10-29 16:05:19 +00:00
Chris Lattner
3f9f8e34ca Fix problem next'ing over an external method
llvm-svn: 1027
2001-10-29 14:08:33 +00:00
Chris Lattner
4c2070b697 Fix some illegal uses of the ## operator
llvm-svn: 1013
2001-10-28 22:38:22 +00:00
Vikram S. Adve
fa2af8b48c Add methods print<TYPE> for String, Pointer, and each primitive type.
llvm-svn: 994
2001-10-28 20:52:27 +00:00
Chris Lattner
52736dc8e3 Implement a -trace command line option and a trace option in the interpreter.
llvm-svn: 989
2001-10-27 08:43:52 +00:00
Chris Lattner
9def26ab6b * Make pointer values work better by treating them uniformly as 64 bit values.
This causes code that is generated by gcc to work better.
* Implement mul & div
* Export malloc, free, and pow
* add strtol, atoi, and atol to the runtime library

llvm-svn: 988
2001-10-27 08:28:11 +00:00
Chris Lattner
de2726ed00 Provide argv for commands
llvm-svn: 987
2001-10-27 05:54:31 +00:00
Chris Lattner
e04a4efa13 * Implement exit() builtin function
* Implement linked in runtime library with puts(char*) in it
* implement builtin putchar(int) function

llvm-svn: 985
2001-10-27 04:15:57 +00:00
Chris Lattner
fc68c300ce Add support for building a runtime library for LLI
llvm-svn: 983
2001-10-24 19:52:41 +00:00
Chris Lattner
127fa2e39d Enhancements to pass argc & argv to main if required
llvm-svn: 909
2001-10-18 21:55:32 +00:00
Chris Lattner
20a04bd230 Implement ulong & long support
llvm-svn: 843
2001-10-15 19:18:26 +00:00
Chris Lattner
554f1b941d Implement initializers for structs and pointers
llvm-svn: 823
2001-10-15 13:25:40 +00:00
Chris Lattner
af1d77e07c Implement global variables. Struct and Pointer initializers are not implemented yet though
llvm-svn: 818
2001-10-15 05:51:48 +00:00
Chris Lattner
a01eda3091 * Both Method & GlobalVariable now subclass GlobalValue
* ConstPoolPointerReference now represents a pointer to a GlobalValue
* Methods name references are now explicit pointers to methods
* Rename Value::GlobalVal to Value::GlobalVariableVal to avoid confusion

llvm-svn: 703
2001-10-03 14:53:21 +00:00
Chris Lattner
08b1dde37e Commit more code over to new cast style
llvm-svn: 697
2001-10-02 03:41:24 +00:00
Chris Lattner
ad1b0a1a83 Convert more code to use new style casts
Eliminate old style casts from value.h

llvm-svn: 696
2001-10-01 20:11:19 +00:00
Chris Lattner
43781f1f96 Add support for new style casts
llvm-svn: 694
2001-10-01 16:18:37 +00:00
Chris Lattner
97440eba29 File #include file
llvm-svn: 665
2001-09-28 22:56:43 +00:00
Chris Lattner
a0a3946882 Make a new llvm/Target #include directory.
Move files from lib/CodeGen/TargetMachine to lib/Target
Move TargetData.h and TargetMachine.h to Target/{Data.h|Machine.h}
Prepare to split TargetMachine.h into several smaller files

llvm-svn: 566
2001-09-14 05:34:53 +00:00
Chris Lattner
836b03a509 Use the correct style casts
llvm-svn: 546
2001-09-10 20:12:04 +00:00
Chris Lattner
3e7417ba99 Add support for external methods
llvm-svn: 529
2001-09-10 04:50:17 +00:00
Chris Lattner
34c9e1a6fb Genericize support for calling functions a bit
Add external method support

llvm-svn: 528
2001-09-10 04:49:44 +00:00
Chris Lattner
5e9c4e67c2 Make use of the new TOOLNAME/USEDLIBS options provided in Makefile.common
llvm-svn: 501
2001-09-07 22:59:25 +00:00
Chris Lattner
78c2f4ab17 Annotations are now const
llvm-svn: 470
2001-09-07 16:59:15 +00:00
Chris Lattner
0a85e4845d Lots of new functionality
llvm-svn: 372
2001-08-27 05:16:50 +00:00
Chris Lattner
8e225d7a21 Initial checkin of interpreter
llvm-svn: 361
2001-08-23 17:05:04 +00:00