Commit Graph

122 Commits

Author SHA1 Message Date
Chris Lattner
aeb2a1d708 rename the "exceptional" destination of an invoke instruction to the 'unwind' dest
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11202 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-08 21:44:31 +00:00
Brian Gaeke
34562bab04 Don't pass anything to the IntrinsicLowering class that is not_intrinsic,
because that makes it abort. Also, fix a typo in a comment.

This checkin brought to you by the "It only takes about 30 seconds to run
ENABLE_LLI tests on Shootout on zion, even if they all dump core" fund.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10844 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 06:02:53 +00:00
Chris Lattner
f70e0c216c Clean up a lot of the code I added yesterday by exposing the IntrinsicLowering
implementation from the TargetMachine directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10636 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 21:23:38 +00:00
Chris Lattner
7301178aac Pass around IntrinsicLowering instances as appropriate.
Reimplement the Interpreters implementation of va_* to be more direct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10627 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 09:44:37 +00:00
Brian Gaeke
2798cd077a Since we are using a gep_type_iterator, we apparently must get the type
index by using I.getOperand() here. This was failing an assertion on
basically every struct access.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10426 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-12 05:13:05 +00:00
Brian Gaeke
63438cc9b0 Add support for --debug-only=interpreter, to print out instrs before
interpreting them.

Move support for getting the value of a ConstantExpr into
getConstantExprValue(), and add support for the rest of the different
kinds of ConstantExprs.  (I don't think I like ConstantExprs!)
This requires separate procedures executeShlInst() and executeShrInst().

Reduce the number of references to TheEE.

Get rid of an old comment mentioning annotations.

Fix exitCalled(), which was crashing the Interpreter. This was a
leftover from the return-value code refactoring.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10389 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 00:22:59 +00:00
Chris Lattner
4af6de8f0a Do not depend on structure elements being of type UByteTy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10224 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 20:44:56 +00:00
Brian Gaeke
8da17489aa Change LLI's internal representation of va_list to a pointer to the next
argument to be returned by va_arg. This allows va_lists to be passed
between different LLVM procedures (though it is unlikely that an LLI
va_list would make sense to an external function, except by chance.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9965 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-13 06:06:01 +00:00
Brian Gaeke
d0fde30ce8 Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 22:41:34 +00:00
Brian Gaeke
c1a2be18ea Implement vaarg instruction. This is not quite perfect: 2003-08-11-VaListArg
still causes a crash. But it's better than before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9794 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-07 21:20:47 +00:00
Brian Gaeke
dbde1ae7a0 popStackAndReturnValueToCaller() must advance instruction pointer to normal
destination, if returning from an invoke.

Implement 'unwind' instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9792 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-07 20:44:58 +00:00
Brian Gaeke
9bf06b155c Add stub version of unwind support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9789 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-07 20:07:06 +00:00
Brian Gaeke
fea483d7c0 visitCallInst --> visitCallSite.
Use visitCallSite to implement both CallInsts and InvokeInsts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9788 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-07 20:04:22 +00:00
Brian Gaeke
ae2495a921 Make the operation of visitCallInst() only depend on the CallSite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9787 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-07 19:59:08 +00:00
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
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
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
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
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
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
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
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
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
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
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
Chris Lattner
44edb6bdd2 Add support for atexit function, remove support for __main function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6194 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-14 14:21:30 +00:00
Chris Lattner
d7916e988c switch main LLI core execution to use an InstVisitor instead of a switch statement
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6081 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-10 21:22:39 +00:00
Chris Lattner
77113b6272 Fix testcase: SingleSource/UnitTests/2003-05-02-DependantPHI.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6074 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-10 20:21:16 +00:00
Chris Lattner
374344c0cc Implement varargs support for LLI!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6043 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 16:52:43 +00:00
Chris Lattner
da82ed52ac A large number of simple changes:
* s/Method/Function
  * Kill some obsolete (external) functions that used to be to support tracing


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6041 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 16:18:31 +00:00
Chris Lattner
cdf5178f83 Add support for recording arguments passed through the ... of a varargs function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6040 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 16:06:52 +00:00
Chris Lattner
d5bc41a249 Fix problem where we would read 64 bits worth of pointer information, even on 32 bit targets!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5930 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-25 04:21:19 +00:00
Chris Lattner
fd506f551d Fix a problem with setcc instructions and pointers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5886 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 19:55:35 +00:00
Chris Lattner
669b76ae87 Implement &|^ on bool values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5884 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 19:21:00 +00:00
Chris Lattner
0286835685 Kill using declarations
Kill code for invalid operations on pointers


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5856 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 21:22:33 +00:00
Chris Lattner
5bff50d1b0 Implement cast to bool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5855 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 21:15:56 +00:00
Chris Lattner
b945e4ddae Get rid of extraneous arguments to implementation functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5852 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 20:37:39 +00:00
Chris Lattner
09e9392d63 Add support to LLI for switch instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5851 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 20:34:47 +00:00
Chris Lattner
04e2ad76f8 Fix wierd idiom
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5831 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-21 22:43:32 +00:00
Chris Lattner
006a4a5990 Fix typeo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5624 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-25 21:14:59 +00:00
Chris Lattner
93780132a7 Handle value promotion properly to work with tracing better
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5253 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 00:58:52 +00:00
Chris Lattner
fe11a97fcd Substantial changes to refactor LLI to incorporate both the Jello JIT and
the traditional LLI interpreter


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5125 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-23 23:59:41 +00:00
Chris Lattner
138b0cd7da Namespacify more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4956 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-08 06:01:34 +00:00