Commit Graph

386 Commits

Author SHA1 Message Date
Chris Lattner 3361c5da6f Add a special case for argc,argv
llvm-svn: 15802
2004-08-16 01:07:04 +00:00
Chris Lattner b1cad0b3bc Don't pass too many arguments into runFunction
llvm-svn: 15801
2004-08-16 01:05:35 +00:00
Chris Lattner 3f9d4ed43d Finally, add support for calling arbitrary non-varargs functions.
llvm-svn: 15799
2004-08-16 00:14:18 +00:00
Chris Lattner 58d0582548 Handle all nullary functions, of any valid return type.
llvm-svn: 15798
2004-08-15 23:53:06 +00:00
Chris Lattner 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
Chris Lattner 8f8f72f21b These only really work if returning int or void
llvm-svn: 15796
2004-08-15 23:34:48 +00:00
Chris Lattner 47380e3ba0 Handle zero arg function case
llvm-svn: 15794
2004-08-15 23:31:43 +00:00
Chris Lattner a349c03347 Simplify code a bit, print error message always instead of asserting.
llvm-svn: 15793
2004-08-15 23:29:50 +00:00
Alkis Evlogimenos 832437255d Stop using getValues().
llvm-svn: 15487
2004-08-04 08:44:43 +00:00
Reid Spencer 6a0fd73bee bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14951
2004-07-18 00:41:27 +00:00
Chris Lattner 5c4de70691 Fixes for PR341
llvm-svn: 14848
2004-07-15 02:51:32 +00:00
Chris Lattner 60a7dd16c4 Fixes for PR341
llvm-svn: 14847
2004-07-15 02:51:31 +00:00
Chris Lattner 802cffd928 The cleanup is done. Update comment.
llvm-svn: 14761
2004-07-11 08:24:02 +00:00
Chris Lattner c4e6bb5f9f Make add constantexprs work with all types, fixing the regressions from last night
llvm-svn: 14760
2004-07-11 08:01:11 +00:00
Chris Lattner 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
Reid Spencer 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
Reid Spencer 6967cd54f3 Fix for bug 391.
Improve exeception handling around bcreader invocations.

llvm-svn: 14674
2004-07-07 21:01:38 +00:00
Reid Spencer eb04d9bcb4 Add #include <iostream> since Value.h does not #include it any more.
llvm-svn: 14622
2004-07-04 12:19:56 +00:00
Chris Lattner bcdadf3765 Move the IntrinsicLowering header into the CodeGen directory, as per PR346
llvm-svn: 14266
2004-06-20 07:49:54 +00:00
Chris Lattner 4c96b0883f Move the IntrinsicLowering header into the CodeGen directory
llvm-svn: 14265
2004-06-20 07:46:18 +00:00
Chris Lattner 6b7275996c Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Brian Gaeke 3b9474ecd7 Add int ferror(FILE *)
llvm-svn: 14194
2004-06-16 02:56:40 +00:00
Chris Lattner 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
Chris Lattner 0bd7797446 Use the SystemUtils.h file to do our dirty work.
llvm-svn: 13868
2004-05-28 00:57:27 +00:00
Chris Lattner cef00ec3da Remove long unused #includes
llvm-svn: 13857
2004-05-27 21:25:44 +00:00
Chris Lattner cb9ccac8a7 These #includes are long dead
llvm-svn: 13856
2004-05-27 21:24:38 +00:00
Chris Lattner 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
Reid Spencer 7b8a3b550a Get rid of a wart: useless getFILE function is now a cast macro.
llvm-svn: 13747
2004-05-25 08:46:15 +00:00
Brian Gaeke 2d7efbbb93 Generalize the strlen size_t hack, for the benefit of the other external
functions with wrappers that either take or return size_ts.

llvm-svn: 13296
2004-05-01 06:42:15 +00:00
Brian Gaeke ad373c8576 Go back to the interpreter main loop after performing intrinsic lowering,
because 1) the first instruction might not be a call site, and
2) CS and SF.Caller were not getting set to point to the new call site
anyway (resulting in a crash on e.g. call %llvm.memset).

llvm-svn: 13122
2004-04-23 18:05:28 +00:00
Brian Gaeke 0c4fb283f3 Implement emitWordAt() for the JIT emitter.
llvm-svn: 13118
2004-04-23 17:11:14 +00:00
Chris Lattner 2b2d7a99be Add support for the select instruction
llvm-svn: 13076
2004-04-20 16:43:21 +00:00
Brian Gaeke 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
Chris Lattner ca76d11a81 Adjust to new interface
llvm-svn: 12646
2004-04-04 19:47:06 +00:00
Chris Lattner 092d260fc1 Adjust to new gep_type_iterator prototypes.
llvm-svn: 12644
2004-04-04 17:30:06 +00:00
Chris Lattner 5def7a57c1 Fix PR296: [execution engines] Unhandled cast constant expression
llvm-svn: 12435
2004-03-16 08:38:56 +00:00
Chris Lattner 071a5e5649 Rename the intrinsic enum values for llvm.va_* from Intrinsic::va_* to
Intrinsic::va*.  This avoid conflicting with macros in the stdlib.h file.

llvm-svn: 12356
2004-03-13 00:24:00 +00:00
Brian Gaeke 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
Brian Gaeke 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
Chris Lattner 234a2d4f19 remove obsolete comment
llvm-svn: 11872
2004-02-26 07:59:22 +00:00
Brian Gaeke 7b4be13f94 Represent va_list in interpreter as a (ec-stack-depth . var-arg-index)
pair, and look up varargs in the execution stack every time, instead of
just pushing iterators (which can be invalidated during callFunction())
around.  (union GenericValue now has a "pair of uints" member, to support
this mechanism.) Fixes Bug 234.

llvm-svn: 11845
2004-02-25 23:01:48 +00:00
Brian Gaeke 84b76c9be0 Great sparc renaming fallout IV: Sparc --> SparcV9.
llvm-svn: 11844
2004-02-25 22:09:36 +00:00
Brian Gaeke 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
Chris Lattner 834b1272f3 Make the JIT zero out globals with memset instead of an element at a time. This
should speed it up a bit on a lot of programs

llvm-svn: 11472
2004-02-15 05:54:06 +00:00
Brian Gaeke 242ebf2523 Fix off-by-one in Interpreter::getFirstVarArg(), which was punishing
any attempts by LLI to use varargs (possibly left over from the introduction
of IntrinsicLowering??)

llvm-svn: 11370
2004-02-13 06:18:39 +00:00
Brian Gaeke 51f100753c The Interpreter was failing the AtExit UnitTest. This fixes it.
llvm-svn: 11367
2004-02-13 05:48:00 +00:00
Chris Lattner fa829be4d3 Start using the new and improve interface to FunctionType arguments
llvm-svn: 11224
2004-02-09 04:14:01 +00:00
Chris Lattner fae8ab3088 rename the "exceptional" destination of an invoke instruction to the 'unwind' dest
llvm-svn: 11202
2004-02-08 21:44:31 +00:00
Chris Lattner dc631735e6 Print out all globals as they are emitted, not just those emitted from
emitGlobals

llvm-svn: 11191
2004-02-08 19:33:23 +00:00
Chris Lattner 6604615a16 There is no reason to #define fd
llvm-svn: 11190
2004-02-08 19:33:07 +00:00