Commit Graph

347 Commits

Author SHA1 Message Date
Brian Gaeke
2cb474c8ad Use CallSites for call sites, instead of CallInsts. A revolutionary concept.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9784 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-07 19:26:23 +00:00
Brian Gaeke
af955ba503 Refactor the return-from-function code into popStackAndReturnValueToCaller().
Make external function calls slightly less special; now they get a stack frame.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9765 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-07 05:22:49 +00:00
Chris Lattner
502dda001a Be friendly to gcc 3.4... good compiler. Nice compiler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9726 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 06:20:27 +00:00
Brian Gaeke
b56a6bc96a Abort when the user program calls abort, instead of printing a funny message and calling exit(1).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9716 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 01:18:49 +00:00
Brian Gaeke
2fa8212a7a Use regular old malloc to emulate malloc/alloca instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9713 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 01:02:14 +00:00
Brian Gaeke
3636f4e0d6 Remove a comment which no longer applies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9712 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 00:59:28 +00:00
Brian Gaeke
11911abf5c In VM::create(), comment out almost the whole function if NO_JITS_ENABLED,
because the Arch variable will likely be undefined.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9576 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-29 04:24:09 +00:00
Chris Lattner
b8afbe6139 Unbreak the build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9502 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-25 16:18:03 +00:00
Brian Gaeke
f143d3c284 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().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9493 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-24 19:59:37 +00:00
Brian Gaeke
a824f42074 ExecutionEngine::create no longer takes a TraceMode argument.
CurFrame, TraceMode, and the CachedWriter are history.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9492 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-24 19:59:28 +00:00
Brian Gaeke
02438ca254 The ExecutionAnnotations (SlotNumber, InstNumber, and FunctionInfo) are history.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9490 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-24 19:59:18 +00:00
Brian Gaeke
03e43dcfe7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9489 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-24 19:59:01 +00:00
Brian Gaeke
20a277e162 ExecutionEngine::create no longer takes a TraceMode argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9488 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-24 19:58:38 +00:00
Brian Gaeke
242978cdee 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9459 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-24 03:55:37 +00:00
John Criswell
856ba76200 Added LLVM copyright header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9321 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 15:17:13 +00:00
John Criswell
e488e9360b Added LLVM copyright notice to Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 22:26:57 +00:00
John Criswell
b576c94c15 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:43:21 +00:00
Chris Lattner
e738656c0b Hrm, a relic from the past. How cute :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9283 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 05:45:49 +00:00
Chris Lattner
4c6654963d Interpret the new varargs intrinsics correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9222 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 05:55:25 +00:00
Misha Brukman
05701573aa 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*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9205 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 18:31:59 +00:00
Brian Gaeke
55c0f02cbf Tidy up doxygen comment for getPointerToFunction().
Add prototypes for recompileAndRelinkFunction() and runJITOnFunction().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9200 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 18:27:12 +00:00
Brian Gaeke
cd64ddfafe 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().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9199 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 18:27:00 +00:00
Brian Gaeke
6020ddd57e Fix a typo in a comment, and zap a blank line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9184 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 23:33:38 +00:00
Misha Brukman
0f4f7d9eb7 JIT.cpp:
* #include "llvm/ModuleProvider"
* alphabetize #includes
* omit extraneous parens in pointer expressions

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9182 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 21:19:34 +00:00
Misha Brukman
19684164a7 * Reorder includes as per the style guide
* Move the constructors from .h file here
* Document ExecutionEngine::create()
* Catch exception possibly thrown by ModuleProvider::releaseModule()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9181 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 21:18:05 +00:00
Misha Brukman
b8d15b2ad0 Order #includes as per the style guide.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9128 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-14 21:42:11 +00:00
Misha Brukman
005e5e9a48 Enabling incremental bytecode loading in the JIT:
* The VM is now constructed with a ModuleProvider


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9125 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-14 21:37:41 +00:00
Misha Brukman
7b2b40f9ac Enabling incremental bytecode loading in the JIT:
* ExecutionEngine and VM can be constructed using a ModuleProvider.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9124 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-14 21:36:31 +00:00
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
Misha Brukman
248ea32cc9 Add in support to load shared objects (-load is provided by Support library).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7360 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 19:06:19 +00:00
Chris Lattner
a84983ea72 Fix space
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7273 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 20:21:06 +00:00
Chris Lattner
832688a6d2 Remove redundant const qualifier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7254 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:30:32 +00:00
Misha Brukman
06dabfaed5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7204 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-18 18:33:38 +00:00
Misha Brukman
859e09f06e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7177 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-15 15:58:26 +00:00
Misha Brukman
291c2c59b0 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7176 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-15 15:55:32 +00:00
Misha Brukman
82742916f3 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7070 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 17:53:19 +00:00
John Criswell
7a73b80b90 Merged in autoconf branch. This provides configuration via the autoconf
system.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7014 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 21:59:07 +00:00
Brian Gaeke
02c26b681e Get rid of the duplicate '0x' in debug mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7012 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 18:06:20 +00:00
Brian Gaeke
703379827f Include <cmath> instead of <math.h>
Remove isnan; it's too unportable to handle cleanly at this point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6866 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-23 19:41:55 +00:00
Brian Gaeke
4399a4982a 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.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6761 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 23:14:06 +00:00
Brian Gaeke
5285270871 Use $(PLATFORMLIBDL) to selectively bring in -ldl only on those platforms where
it is needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6753 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 20:09:18 +00:00
Brian Gaeke
1d0acacc63 Use std::isnan instead of isnan. Brought back to you from the
future, by the reconciliation of the C++ and C99 standards. Someday.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6751 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 19:59:17 +00:00
Chris Lattner
f25b7729c1 Life is too short. Link in too much stuff on Linux to make building on sun easier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6748 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 19:14:59 +00:00
Chris Lattner
da601403d9 The never-ending odyssey trying to get sparc to link
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6747 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 18:19:52 +00:00
Chris Lattner
d562436355 Make sure to get the value of ARCH before we use it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6746 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 17:53:35 +00:00
Chris Lattner
2bf4c61557 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. :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6745 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 15:54:52 +00:00
Chris Lattner
de3209bfdb Apparently "sparc" is a macro on sparcs. Ugh. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6744 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 15:54:02 +00:00
Chris Lattner
7a5500e2f6 Whoops, didn't mean to check that in :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6743 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 15:46:34 +00:00
Chris Lattner
97ac14f33c Use more structured command line option processing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6742 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 15:43:13 +00:00
Chris Lattner
7aefa966cd #ifdef out code that only applies when the HOSTARCH = sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6741 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 15:32:38 +00:00
Chris Lattner
08d5e1f718 Add #include for older GCC's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6670 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-08 06:43:57 +00:00