c27389815d 
								
							 
						 
						
							
							
								
								Match change in MachineCodeEmitter prototype.  
							
							... 
							
							
							
							llvm-svn: 18009 
							
						 
						
							2004-11-19 20:56:46 +00:00  
				
					
						
							
							
								 
						
							
								1edd79a1bc 
								
							 
						 
						
							
							
								
								Now that we have ghost linkage, we can force resolution of external symbols  
							
							... 
							
							
							
							immediately instead of lazily.
In this program, for example:
int main() {
  printf("hello world\n");
  printf("hello world\n");
  printf("hello world\n");
  printf("hello world\n");
}
We used to have to go through compilation callback 4 times (once for each
call to printf), now we don't go to it at all.
Thanks to Misha for noticing this, and for adding the initial ghost linkage
patches.
llvm-svn: 17864 
							
						 
						
							2004-11-15 23:20:04 +00:00  
				
					
						
							
							
								 
						
							
								b264f7f428 
								
							 
						 
						
							
							
								
								There is no reason to try to materialize the function from bytecode if it  
							
							... 
							
							
							
							already has been.  This may be a small speedup.
llvm-svn: 17863 
							
						 
						
							2004-11-15 23:18:09 +00:00  
				
					
						
							
							
								 
						
							
								624685d9a1 
								
							 
						 
						
							
							
								
								Implement ExecutionEngine::freeMachineCodeForFunction()  
							
							... 
							
							
							
							llvm-svn: 17601 
							
						 
						
							2004-11-07 23:58:46 +00:00  
				
					
						
							
							
								 
						
							
								9a51b8ca7c 
								
							 
						 
						
							
							
								
								When emitting debug msgs for function stubs, don't truncate the  
							
							... 
							
							
							
							printed pointer value if sizeof(unsigned) != pointer size.  Instead,
use uintptr_t.
llvm-svn: 17338 
							
						 
						
							2004-10-29 18:22:45 +00:00  
				
					
						
							
							
								 
						
							
								c833eddfe6 
								
							 
						 
						
							
							
								
								Fix library name.  
							
							... 
							
							
							
							llvm-svn: 17307 
							
						 
						
							2004-10-28 05:37:24 +00:00  
				
					
						
							
							
								 
						
							
								37a7102ccb 
								
							 
						 
						
							
							
								
								Use cleaner quoting and eliminate blank space  
							
							... 
							
							
							
							llvm-svn: 17174 
							
						 
						
							2004-10-22 23:35:57 +00:00  
				
					
						
							
							
								 
						
							
								c1c320c335 
								
							 
						 
						
							
							
								
								We won't use automake  
							
							... 
							
							
							
							llvm-svn: 17155 
							
						 
						
							2004-10-22 03:35:04 +00:00  
				
					
						
							
							
								 
						
							
								6a11a75f31 
								
							 
						 
						
							
							
								
								Initial automake generated Makefile template  
							
							... 
							
							
							
							llvm-svn: 17136 
							
						 
						
							2004-10-18 23:55:41 +00:00  
				
					
						
							
							
								 
						
							
								ace94df71f 
								
							 
						 
						
							
							
								
								Update to reflect changes in Makefile rules.  
							
							... 
							
							
							
							llvm-svn: 16950 
							
						 
						
							2004-10-13 11:46:52 +00:00  
				
					
						
							
							
								 
						
							
								b84cbf2725 
								
							 
						 
						
							
							
								
								Initial version of automake Makefile.am file.  
							
							... 
							
							
							
							llvm-svn: 16885 
							
						 
						
							2004-10-10 20:43:57 +00:00  
				
					
						
							
							
								 
						
							
								f7948483d2 
								
							 
						 
						
							
							
								
								Simplify the sys::Memory interface per Chris' request.  
							
							... 
							
							
							
							llvm-svn: 16318 
							
						 
						
							2004-09-13 22:38:11 +00:00  
				
					
						
							
							
								 
						
							
								96019262ca 
								
							 
						 
						
							
							
								
								Convert the Emitter to use the lib/System "Memory" interface instead of the  
							
							... 
							
							
							
							old SystemUtils.h interface to allocate RWX blocks of memory.
llvm-svn: 16286 
							
						 
						
							2004-09-11 04:31:03 +00:00  
				
					
						
							
							
								 
						
							
								7c16caa336 
								
							 
						 
						
							
							
								
								Changes For Bug 352  
							
							... 
							
							
							
							Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.
llvm-svn: 16137 
							
						 
						
							2004-09-01 22:55:40 +00:00  
				
					
						
							
							
								 
						
							
								3361c5da6f 
								
							 
						 
						
							
							
								
								Add a special case for argc,argv  
							
							... 
							
							
							
							llvm-svn: 15802 
							
						 
						
							2004-08-16 01:07:04 +00:00  
				
					
						
							
							
								 
						
							
								3f9d4ed43d 
								
							 
						 
						
							
							
								
								Finally, add support for calling arbitrary non-varargs functions.  
							
							... 
							
							
							
							llvm-svn: 15799 
							
						 
						
							2004-08-16 00:14:18 +00:00  
				
					
						
							
							
								 
						
							
								58d0582548 
								
							 
						 
						
							
							
								
								Handle all nullary functions, of any valid return type.  
							
							... 
							
							
							
							llvm-svn: 15798 
							
						 
						
							2004-08-15 23:53:06 +00:00  
				
					
						
							
							
								 
						
							
								23f7c98016 
								
							 
						 
						
							
							
								
								Fine, go all of the way and check that the argument types are correct as well.  
							
							... 
							
							
							
							llvm-svn: 15797 
							
						 
						
							2004-08-15 23:39:59 +00:00  
				
					
						
							
							
								 
						
							
								8f8f72f21b 
								
							 
						 
						
							
							
								
								These only really work if returning int or void  
							
							... 
							
							
							
							llvm-svn: 15796 
							
						 
						
							2004-08-15 23:34:48 +00:00  
				
					
						
							
							
								 
						
							
								47380e3ba0 
								
							 
						 
						
							
							
								
								Handle zero arg function case  
							
							... 
							
							
							
							llvm-svn: 15794 
							
						 
						
							2004-08-15 23:31:43 +00:00  
				
					
						
							
							
								 
						
							
								a349c03347 
								
							 
						 
						
							
							
								
								Simplify code a bit, print error message always instead of asserting.  
							
							... 
							
							
							
							llvm-svn: 15793 
							
						 
						
							2004-08-15 23:29:50 +00:00  
				
					
						
							
							
								 
						
							
								802cffd928 
								
							 
						 
						
							
							
								
								The cleanup is done.  Update comment.  
							
							... 
							
							
							
							llvm-svn: 14761 
							
						 
						
							2004-07-11 08:24:02 +00:00  
				
					
						
							
							
								 
						
							
								8267b7e17d 
								
							 
						 
						
							
							
								
								Goodbye macro hell, hello nice clean simple extensible code.  This change  
							
							... 
							
							
							
							also gives the JIT the ability to dynamically load targets. e.g.
lli -load libparisc.so -march=parisc foo.bc
llvm-svn: 14750 
							
						 
						
							2004-07-11 04:02:06 +00:00  
				
					
						
							
							
								 
						
							
								1a4152fa2c 
								
							 
						 
						
							
							
								
								Make error message consistent with the rest of LLVM by saying that bytecode  
							
							... 
							
							
							
							is read, not parsed.
llvm-svn: 14677 
							
						 
						
							2004-07-07 21:20:28 +00:00  
				
					
						
							
							
								 
						
							
								6967cd54f3 
								
							 
						 
						
							
							
								
								Fix for bug 391.  
							
							... 
							
							
							
							Improve exeception handling around bcreader invocations.
llvm-svn: 14674 
							
						 
						
							2004-07-07 21:01:38 +00:00  
				
					
						
							
							
								 
						
							
								eb04d9bcb4 
								
							 
						 
						
							
							
								
								Add #include <iostream> since Value.h does not #include it any more.  
							
							... 
							
							
							
							llvm-svn: 14622 
							
						 
						
							2004-07-04 12:19:56 +00:00  
				
					
						
							
							
								 
						
							
								a32ca86c21 
								
							 
						 
						
							
							
								
								Implement PR315: abort, don't warn, when missing external functions encountered  
							
							... 
							
							
							
							This fixes some critical problems building libstdc++ on cygwin.
llvm-svn: 13934 
							
						 
						
							2004-06-01 21:49:00 +00:00  
				
					
						
							
							
								 
						
							
								0bd7797446 
								
							 
						 
						
							
							
								
								Use the SystemUtils.h file to do our dirty work.  
							
							... 
							
							
							
							llvm-svn: 13868 
							
						 
						
							2004-05-28 00:57:27 +00:00  
				
					
						
							
							
								 
						
							
								8232621124 
								
							 
						 
						
							
							
								
								This code is a real mess, but at least get the JIT *building* on platforms  
							
							... 
							
							
							
							(such as plan 9) without mmap.  Of course it won't RUN... but that's another
step.  :)
llvm-svn: 13839 
							
						 
						
							2004-05-27 18:03:56 +00:00  
				
					
						
							
							
								 
						
							
								0c4fb283f3 
								
							 
						 
						
							
							
								
								Implement emitWordAt() for the JIT emitter.  
							
							... 
							
							
							
							llvm-svn: 13118 
							
						 
						
							2004-04-23 17:11:14 +00:00  
				
					
						
							
							
								 
						
							
								aec2bcd63b 
								
							 
						 
						
							
							
								
								Add a TargetData to the PassManager regardless of the TargetMachine.  
							
							... 
							
							
							
							This should unbreak the Sparc JIT again.
llvm-svn: 12949 
							
						 
						
							2004-04-14 17:45:52 +00:00  
				
					
						
							
							
								 
						
							
								1eec234f91 
								
							 
						 
						
							
							
								
								My fix for PR274 broke the build on Darwin/PPC.  As I'm fairly certain this  
							
							... 
							
							
							
							bug only affects Linux systems that use GLIBC, I'm going to put ifdefs around
the array.
llvm-svn: 12269 
							
						 
						
							2004-03-10 17:38:28 +00:00  
				
					
						
							
							
								 
						
							
								96e450b3b2 
								
							 
						 
						
							
							
								
								Address PR274 - '[JIT] Programs cannot resolve the fstat function'  
							
							... 
							
							
							
							by trying to get the compiler to generate an undefined reference for it
and related functions which live in libc_nonshared.a on Linux.
Linkers... sigh.
llvm-svn: 12256 
							
						 
						
							2004-03-09 05:22:10 +00:00  
				
					
						
							
							
								 
						
							
								84b76c9be0 
								
							 
						 
						
							
							
								
								Great sparc renaming fallout IV: Sparc --> SparcV9.  
							
							... 
							
							
							
							llvm-svn: 11844 
							
						 
						
							2004-02-25 22:09:36 +00:00  
				
					
						
							
							
								 
						
							
								068b4596d4 
								
							 
						 
						
							
							
								
								Great renaming part II: Sparc --> SparcV9 (also includes command-line options and Makefiles)  
							
							... 
							
							
							
							llvm-svn: 11827 
							
						 
						
							2004-02-25 19:08:12 +00:00  
				
					
						
							
							
								 
						
							
								6604615a16 
								
							 
						 
						
							
							
								
								There is no reason to #define fd  
							
							... 
							
							
							
							llvm-svn: 11190 
							
						 
						
							2004-02-08 19:33:07 +00:00  
				
					
						
							
							
								 
						
							
								8225d83e7b 
								
							 
						 
						
							
							
								
								Print an error message if there is an error materialize the bc file.  
							
							... 
							
							
							
							llvm-svn: 11041 
							
						 
						
							2004-02-01 00:32:35 +00:00  
				
					
						
							
							
								 
						
							
								c8c6c03dda 
								
							 
						 
						
							
							
								
								Pass around IntrinsicLowering instances as appropriate.  
							
							... 
							
							
							
							Reimplement the Interpreters implementation of va_* to be more direct.
llvm-svn: 10627 
							
						 
						
							2003-12-28 09:44:37 +00:00  
				
					
						
							
							
								 
						
							
								385a90aa6d 
								
							 
						 
						
							
							
								
								No longer run atExit functions from run()  
							
							... 
							
							
							
							rename run to runFunction
Genericize the runFunction code a little bit, though it still stinks
llvm-svn: 10610 
							
						 
						
							2003-12-26 06:13:47 +00:00  
				
					
						
							
							
								 
						
							
								b1bbd7c7f6 
								
							 
						 
						
							
							
								
								This should not be needed anymore  
							
							... 
							
							
							
							llvm-svn: 10558 
							
						 
						
							2003-12-20 10:19:18 +00:00  
				
					
						
							
							
								 
						
							
								fbcc0aa18d 
								
							 
						 
						
							
							
								
								Implement PR135, lazy emission of global variables  
							
							... 
							
							
							
							llvm-svn: 10549 
							
						 
						
							2003-12-20 03:36:47 +00:00  
				
					
						
							
							
								 
						
							
								9bcae072d1 
								
							 
						 
						
							
							
								
								Cleanup the JIT as per PR176.  This renames the VM class to JIT, and merges the  
							
							... 
							
							
							
							VM.cpp and JIT.cpp files into JIT.cpp.  This also splits some nasty code out
into TargetSelect.cpp so that people hopefully won't notice it.  :)
llvm-svn: 10544 
							
						 
						
							2003-12-20 01:46:27 +00:00  
				
					
						
							
							
								 
						
							
								833c3c2597 
								
							 
						 
						
							
							
								
								Rip JIT specific stuff out of TargetMachine, as per PR176  
							
							... 
							
							
							
							llvm-svn: 10542 
							
						 
						
							2003-12-20 01:22:19 +00:00  
				
					
						
							
							
								 
						
							
								89af2d5a36 
								
							 
						 
						
							
							
								
								Implement the ExecutionEngine::getPointerToFunctionOrStub by forwarding the  
							
							... 
							
							
							
							request on to the TargetMachine if it supports the getJITStubForFunction method
llvm-svn: 10431 
							
						 
						
							2003-12-12 07:12:02 +00:00  
				
					
						
							
							
								 
						
							
								c0e1b071b9 
								
							 
						 
						
							
							
								
								Finegrainify namespacification  
							
							... 
							
							
							
							llvm-svn: 10318 
							
						 
						
							2003-12-08 08:06:28 +00:00  
				
					
						
							
							
								 
						
							
								98e72b4bb3 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								873cf93b6e 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								be755279f3 
								
							 
						 
						
							
							
								
								Emit the MachineConstantPool constants in one contiguous memory `pool'.  
							
							... 
							
							
							
							llvm-svn: 10060 
							
						 
						
							2003-11-17 20:40:07 +00:00  
				
					
						
							
							
								 
						
							
								fc16bb1af5 
								
							 
						 
						
							
							
								
								* 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  
				
					
						
							
							
								 
						
							
								960707c335 
								
							 
						 
						
							
							
								
								Put all LLVM code into the llvm namespace, as per bug 109.  
							
							... 
							
							
							
							llvm-svn: 9903 
							
						 
						
							2003-11-11 22:41:34 +00:00  
				
					
						
							
							
								 
						
							
								c3c242c3ac 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								d7bcd99325 
								
							 
						 
						
							
							
								
								Remove the *BIG UGLY HACK* from the JIT: PreSelection is now a FunctionPass.  
							
							... 
							
							
							
							llvm-svn: 9790 
							
						 
						
							2003-11-07 20:32:08 +00:00  
				
					
						
							
							
								 
						
							
								9d2020003b 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								98b618270a 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								29265fe981 
								
							 
						 
						
							
							
								
								Added LLVM copyright header.  
							
							... 
							
							
							
							llvm-svn: 9321 
							
						 
						
							2003-10-21 15:17:13 +00:00  
				
					
						
							
							
								 
						
							
								4436c49787 
								
							 
						 
						
							
							
								
								Added LLVM copyright notice to Makefiles.  
							
							... 
							
							
							
							llvm-svn: 9312 
							
						 
						
							2003-10-20 22:26:57 +00:00  
				
					
						
							
							
								 
						
							
								482202a601 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								f2a34aa278 
								
							 
						 
						
							
							
								
								Hrm, a relic from the past.  How cute :)  
							
							... 
							
							
							
							llvm-svn: 9283 
							
						 
						
							2003-10-20 05:45:49 +00:00  
				
					
						
							
							
								 
						
							
								d2bc5ac045 
								
							 
						 
						
							
							
								
								Tidy up doxygen comment for getPointerToFunction().  
							
							... 
							
							
							
							Add prototypes for recompileAndRelinkFunction() and runJITOnFunction().
llvm-svn: 9200 
							
						 
						
							2003-10-17 18:27:12 +00:00  
				
					
						
							
							
								 
						
							
								3b5f24513c 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								13b9395071 
								
							 
						 
						
							
							
								
								Fix a typo in a comment, and zap a blank line.  
							
							... 
							
							
							
							llvm-svn: 9184 
							
						 
						
							2003-10-16 23:33:38 +00:00  
				
					
						
							
							
								 
						
							
								1273147daf 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								299f3e650f 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								74edce6f7c 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								cc31fddf13 
								
							 
						 
						
							
							
								
								Don't include Config/stdio.h or <stdio.h>.  
							
							... 
							
							
							
							llvm-svn: 9031 
							
						 
						
							2003-10-10 18:46:29 +00:00  
				
					
						
							
							
								 
						
							
								e8bbcfc298 
								
							 
						 
						
							
							
								
								Change to use GetAddressOfSymbol instead of dlsym.  
							
							... 
							
							
							
							llvm-svn: 9012 
							
						 
						
							2003-10-10 17:02:42 +00:00  
				
					
						
							
							
								 
						
							
								a220b04ce4 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								93d0ffb864 
								
							 
						 
						
							
							
								
								* 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  
				
					
						
							
							
								 
						
							
								8c056e4337 
								
							 
						 
						
							
							
								
								Fix warning when _POSIX_MAPPED_FILES is already defined in unistd.h  
							
							... 
							
							
							
							llvm-svn: 8436 
							
						 
						
							2003-09-10 15:09:45 +00:00  
				
					
						
							
							
								 
						
							
								f3a300d578 
								
							 
						 
						
							
							
								
								ExecutionEngine.h, GenericValue.h --> include/llvm/ExecutionEngine/  
							
							... 
							
							
							
							Build ExecutionEngine as library.
llvm-svn: 8370 
							
						 
						
							2003-09-05 19:39:22 +00:00  
				
					
						
							
							
								 
						
							
								a7669038fc 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								4bd3bd5b5a 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								4d4f424f0c 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								abca19d2b3 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								71c3e6236f 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								f26be8427d 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								2b804a2797 
								
							 
						 
						
							
							
								
								Deconstify parameter to getPointerToFunction().  
							
							... 
							
							
							
							Use a FunctionPassManager instead of a PassManager.
llvm-svn: 7820 
							
						 
						
							2003-08-13 18:16:50 +00:00  
				
					
						
							
							
								 
						
							
								5896956ff0 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								ee937c80ed 
								
							 
						 
						
							
							
								
								Specify DEBUG_TYPE's for the JIT debug messages  
							
							... 
							
							
							
							llvm-svn: 7604 
							
						 
						
							2003-08-05 17:00:32 +00:00  
				
					
						
							
							
								 
						
							
								f0c6964470 
								
							 
						 
						
							
							
								
								DEBUG got moved to Debug.h  
							
							... 
							
							
							
							llvm-svn: 7491 
							
						 
						
							2003-08-01 22:13:59 +00:00  
				
					
						
							
							
								 
						
							
								e47f069855 
								
							 
						 
						
							
							
								
								* 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  
				
					
						
							
							
								 
						
							
								c0ae1cd93e 
								
							 
						 
						
							
							
								
								Add rationale for the MAP_ANONYMOUS vs. MAP_ANON flags.  
							
							... 
							
							
							
							llvm-svn: 7368 
							
						 
						
							2003-07-28 19:26:19 +00:00  
				
					
						
							
							
								 
						
							
								057f460053 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								ee79899ce5 
								
							 
						 
						
							
							
								
								Clean up code dealing with RTLD_SELF differences on Sparc and X86.  
							
							... 
							
							
							
							llvm-svn: 7362 
							
						 
						
							2003-07-28 19:07:30 +00:00  
				
					
						
							
							
								 
						
							
								d9a9276fe3 
								
							 
						 
						
							
							
								
								Fix reference to architecture.  
							
							... 
							
							
							
							llvm-svn: 7361 
							
						 
						
							2003-07-28 19:06:50 +00:00  
				
					
						
							
							
								 
						
							
								1442020798 
								
							 
						 
						
							
							
								
								Fix space  
							
							... 
							
							
							
							llvm-svn: 7273 
							
						 
						
							2003-07-23 20:21:06 +00:00  
				
					
						
							
							
								 
						
							
								7dee443c1c 
								
							 
						 
						
							
							
								
								* 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  
				
					
						
							
							
								 
						
							
								3ef61afb76 
								
							 
						 
						
							
							
								
								Merged in autoconf branch.  This provides configuration via the autoconf  
							
							... 
							
							
							
							system.
llvm-svn: 7014 
							
						 
						
							2003-06-30 21:59:07 +00:00  
				
					
						
							
							
								 
						
							
								eba22eb59d 
								
							 
						 
						
							
							
								
								Get rid of the duplicate '0x' in debug mode.  
							
							... 
							
							
							
							llvm-svn: 7012 
							
						 
						
							2003-06-30 18:06:20 +00:00  
				
					
						
							
							
								 
						
							
								a7cf81bc75 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								cf48150098 
								
							 
						 
						
							
							
								
								Apparently "sparc" is a macro on sparcs.  Ugh.  :)  
							
							... 
							
							
							
							llvm-svn: 6744 
							
						 
						
							2003-06-17 15:54:02 +00:00  
				
					
						
							
							
								 
						
							
								d9e6bfae0e 
								
							 
						 
						
							
							
								
								Use more structured command line option processing  
							
							... 
							
							
							
							llvm-svn: 6742 
							
						 
						
							2003-06-17 15:43:13 +00:00  
				
					
						
							
							
								 
						
							
								a5741aca3a 
								
							 
						 
						
							
							
								
								#ifdef out code that only applies when the HOSTARCH = sparc  
							
							... 
							
							
							
							llvm-svn: 6741 
							
						 
						
							2003-06-17 15:32:38 +00:00  
				
					
						
							
							
								 
						
							
								569358416f 
								
							 
						 
						
							
							
								
								Add #include for older GCC's  
							
							... 
							
							
							
							llvm-svn: 6670 
							
						 
						
							2003-06-08 06:43:57 +00:00  
				
					
						
							
							
								 
						
							
								0ccdecbdaa 
								
							 
						 
						
							
							
								
								::: 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  
				
					
						
							
							
								 
						
							
								a2b55253c6 
								
							 
						 
						
							
							
								
								Output function address as hex.  
							
							... 
							
							
							
							llvm-svn: 6649 
							
						 
						
							2003-06-06 06:52:35 +00:00  
				
					
						
							
							
								 
						
							
								6940c8644e 
								
							 
						 
						
							
							
								
								Removed debug print statement.  
							
							... 
							
							
							
							llvm-svn: 6641 
							
						 
						
							2003-06-06 00:00:54 +00:00  
				
					
						
							
							
								 
						
							
								1d443d1250 
								
							 
						 
						
							
							
								
								* 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  
				
					
						
							
							
								 
						
							
								905496e94f 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								6ac7fe7dc0 
								
							 
						 
						
							
							
								
								* 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  
				
					
						
							
							
								 
						
							
								78e8ade959 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								cd0a9fa5b4 
								
							 
						 
						
							
							
								
								Remove obsolete code  
							
							... 
							
							
							
							llvm-svn: 6518 
							
						 
						
							2003-06-02 00:09:00 +00:00  
				
					
						
							
							
								 
						
							
								6b689e3ad4 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								101ed907f4 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								d2b29c8a9e 
								
							 
						 
						
							
							
								
								Fixed rewriting of branches -- they now work forward and backward.  
							
							... 
							
							
							
							llvm-svn: 6463 
							
						 
						
							2003-05-31 06:26:48 +00:00  
				
					
						
							
							
								 
						
							
								d137d6ba65 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								a0967e52e9 
								
							 
						 
						
							
							
								
								Fix call to mmap, so that it can be used on sparc.  
							
							... 
							
							
							
							llvm-svn: 6424 
							
						 
						
							2003-05-30 03:37:13 +00:00  
				
					
						
							
							
								 
						
							
								7297199aeb 
								
							 
						 
						
							
							
								
								mmap() seems to be failing on Sparc, so just use malloc()/free() .  
							
							... 
							
							
							
							llvm-svn: 6387 
							
						 
						
							2003-05-28 18:44:38 +00:00  
				
					
						
							
							
								 
						
							
								56d27325c0 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								2537ca318a 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								c67e340327 
								
							 
						 
						
							
							
								
								Fix compilation problems with previous checking *blush*  
							
							... 
							
							
							
							llvm-svn: 6191 
							
						 
						
							2003-05-14 13:27:36 +00:00  
				
					
						
							
							
								 
						
							
								5a9ea75e6b 
								
							 
						 
						
							
							
								
								Add a framework for intercepting system calls  
							
							... 
							
							
							
							llvm-svn: 6190 
							
						 
						
							2003-05-14 13:26:47 +00:00  
				
					
						
							
							
								 
						
							
								b78244f9e1 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								fdbd98b67f 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								037f1e58bd 
								
							 
						 
						
							
							
								
								Minor speedup by avoiding callbacks to functions already generated  
							
							... 
							
							
							
							llvm-svn: 6052 
							
						 
						
							2003-05-08 21:44:21 +00:00  
				
					
						
							
							
								 
						
							
								d340dbdb5d 
								
							 
						 
						
							
							
								
								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  
				
					
						
							
							
								 
						
							
								974e1d8ec2 
								
							 
						 
						
							
							
								
								assert early instead of late for unimplemented feature  
							
							... 
							
							
							
							llvm-svn: 6050 
							
						 
						
							2003-05-08 21:08:43 +00:00  
				
					
						
							
							
								 
						
							
								75f7f8d906 
								
							 
						 
						
							
							
								
								Fix warnings on sparc  
							
							... 
							
							
							
							llvm-svn: 5427 
							
						 
						
							2003-01-29 18:02:02 +00:00  
				
					
						
							
							
								 
						
							
								4bc4b67eed 
								
							 
						 
						
							
							
								
								Add support for named functions  
							
							... 
							
							
							
							llvm-svn: 5258 
							
						 
						
							2003-01-13 01:00:48 +00:00  
				
					
						
							
							
								 
						
							
								2e8815833a 
								
							 
						 
						
							
							
								
								Dead file  
							
							... 
							
							
							
							llvm-svn: 5257 
							
						 
						
							2003-01-13 01:00:28 +00:00  
				
					
						
							
							
								 
						
							
								4ba3bbb8d4 
								
							 
						 
						
							
							
								
								Add support for new types of values  
							
							... 
							
							
							
							llvm-svn: 5256 
							
						 
						
							2003-01-13 01:00:12 +00:00  
				
					
						
							
							
								 
						
							
								5bebd807a3 
								
							 
						 
						
							
							
								
								Bad segvs actually cause a segv now  
							
							... 
							
							
							
							llvm-svn: 5255 
							
						 
						
							2003-01-13 01:00:02 +00:00  
				
					
						
							
							
								 
						
							
								e6761db961 
								
							 
						 
						
							
							
								
								Initial checkin  
							
							... 
							
							
							
							llvm-svn: 5127 
							
						 
						
							2002-12-24 00:01:22 +00:00  
				
					
						
							
							
								 
						
							
								996fe01028 
								
							 
						 
						
							
							
								
								Initial checkin of new LLI with JIT compiler  
							
							... 
							
							
							
							llvm-svn: 5126 
							
						 
						
							2002-12-24 00:01:05 +00:00