Commit Graph

269 Commits

Author SHA1 Message Date
Brian Gaeke
364f86d4df 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9045 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-11 03:51:18 +00:00
Brian Gaeke
e24b616faa Don't include Config/stdio.h or <stdio.h>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9031 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 18:46:29 +00:00
Misha Brukman
4afac18fd4 * Tabs to spaces
* Doxygenified function comments
* Added FIXMEs to solicit documentation for other functions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9022 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:45:12 +00:00
Misha Brukman
d5d96b9fcd Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9021 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:42:19 +00:00
Brian Gaeke
235b200e6b Never set any signal handlers.
Never call setjmp(), longjmp() or strsignal().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9014 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:03:22 +00:00
Brian Gaeke
58a6faac65 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9013 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:03:10 +00:00
Brian Gaeke
322cdb2e63 Change to use GetAddressOfSymbol instead of dlsym.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9012 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:02:42 +00:00
Chris Lattner
ae19bf7c37 Do not read past the end of the contained type list
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8986 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-09 20:31:18 +00:00
Chris Lattner
011efae2f0 Actually _PASS IN_ NO_RESERVE if we have it.
Thanks to Brian for fixing this obvious oops


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8899 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-06 19:07:41 +00:00
Chris Lattner
021c190f8d Squelch warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8659 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 20:33:34 +00:00
Chris Lattner
63bd61330b Change FunctionInfo from being an annotation put on Functions to be
something which is mapped from functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8580 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-17 17:26:22 +00:00
Misha Brukman
36d10ef7e7 * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8463 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 20:52:05 +00:00
Misha Brukman
88b4855499 Fix warning when _POSIX_MAPPED_FILES is already defined in unistd.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8436 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 15:09:45 +00:00
Chris Lattner
bd9df30983 Remove a bunch of unneeded stuph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8400 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 18:19:58 +00:00
Chris Lattner
fd13129bdf Reorder #includes to follow LLVM conventions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8375 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 20:08:15 +00:00
Brian Gaeke
9722294d30 ExecutionEngine.h, GenericValue.h --> include/llvm/ExecutionEngine/
Build ExecutionEngine as library.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8370 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 19:39:22 +00:00
Brian Gaeke
29794cba81 Make getOperandValue and executeCastOperation methods of Interpreter.
This lets us protect a few more ExecutionEngine methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8367 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 18:55:03 +00:00
Brian Gaeke
70975eef57 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".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8366 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 18:42:01 +00:00
Brian Gaeke
d5caf7c432 Remove printOperandInfo(), and simplify run().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8362 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 05:22:08 +00:00
Brian Gaeke
932539a941 Remove support for printing values from a module by name, only used
w/ interactive keyboard entry of names.
With that, Support.cpp is history.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8360 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 05:04:32 +00:00
Brian Gaeke
413ab6655b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8359 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 04:46:26 +00:00
Brian Gaeke
9ad671d540 Remove support for breakpoints (not used).
Remove some dead code and whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8346 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-04 23:15:40 +00:00
Brian Gaeke
8e53948881 Move EE dtor where it belongs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8345 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-04 22:57:27 +00:00
Brian Gaeke
f58815e161 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().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8344 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-04 22:21:24 +00:00
Brian Gaeke
82d8277ad5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8343 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-03 20:34:19 +00:00
Chris Lattner
253aef8e59 Preselection is now integrated into the Sparc target library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8305 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:30:17 +00:00
Chris Lattner
0748a3904a Sparc peephole optimizer moved out of post-opts library into Sparc target library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8302 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:26:14 +00:00
Chris Lattner
c879e8ffc4 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8136 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 19:55:26 +00:00
Chris Lattner
39c07264da Targets now configure themselves based on the source module, not on the
ad-hoc "Config" flags


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8134 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 19:50:53 +00:00
Chris Lattner
1543e40cea Add preliminary support for "any" pointersize/endianness. This will need
to change soon though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8123 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 14:02:47 +00:00
Chris Lattner
05a1a306bc Minor cleanups: wrap at 80 lines. Convert file comment to doxygen format and
llvm style


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8024 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 21:32:12 +00:00
John Criswell
69582b35b6 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8022 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 21:12:30 +00:00
Chris Lattner
c88a4ea0d6 no really, implement it!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7955 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 17:33:15 +00:00
Chris Lattner
74cf81919d Add support for casting any pointer to any integer type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7953 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 17:23:40 +00:00
Misha Brukman
5560c9d49c Spell `necessary' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7944 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 14:43:39 +00:00
Chris Lattner
80df4638fe rename selection library to selectiondag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7878 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 04:56:09 +00:00
Chris Lattner
688506de24 Implement a _REAL_ memory manager for the code generated by the JIT. This
speeds up program execution by 15% pretty consistently for large programs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7845 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 18:35:27 +00:00
Brian Gaeke
fb0ef2e82c Deconstify parameter to getPointerToFunction().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7822 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:17:54 +00:00
Brian Gaeke
c227c1fc7f Deconstify parameter to getPointerToFunction().
Use a FunctionPassManager instead of a PassManager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7820 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:16:50 +00:00
Brian Gaeke
71d8478117 Deconstify parameter to getPointerToFunction().
Run passes on single function (hey, just-in-time compilation!)
 instead of the entire module that contains it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7819 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:16:34 +00:00
Brian Gaeke
37df460874 In ExecutionEngine::getPointerToGlobal(), throw away const qualifier
on Function * when passing it to getPointerToFunction().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7818 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:16:14 +00:00
Chris Lattner
4c7fc1e813 Incorporate mapping library into the sparc library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7800 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 02:28:20 +00:00
Chris Lattner
4c08840e4b Include the new selection library for the X86 target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7720 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 14:59:53 +00:00
Chris Lattner
3785fad56e Specify DEBUG_TYPE's for the JIT debug messages
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7604 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 17:00:32 +00:00
Chris Lattner
c648dabf65 DEBUG got moved to Debug.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7491 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 22:13:59 +00:00
Misha Brukman
89e8be00c5 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7381 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 16:57:16 +00:00
Misha Brukman
fd31a78124 Add rationale for the MAP_ANONYMOUS vs. MAP_ANON flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7368 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 19:26:19 +00:00
Misha Brukman
d69c1e6dc2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7363 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 19:09:06 +00:00
Misha Brukman
d94a50f99d Clean up code dealing with RTLD_SELF differences on Sparc and X86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7362 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 19:07:30 +00:00
Misha Brukman
df38dae949 Fix reference to architecture.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7361 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 19:06:50 +00:00