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
51f100753c
The Interpreter was failing the AtExit UnitTest. This fixes it.
...
llvm-svn: 11367
2004-02-13 05:48:00 +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
Brian Gaeke
1c0133ffd9
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.
llvm-svn: 10844
2004-01-14 06:02:53 +00:00
Chris Lattner
5d236005b0
Clean up a lot of the code I added yesterday by exposing the IntrinsicLowering
...
implementation from the TargetMachine directly.
llvm-svn: 10636
2003-12-28 21:23:38 +00:00
Chris Lattner
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
Brian Gaeke
8657acc07e
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.
llvm-svn: 10426
2003-12-12 05:13:05 +00:00
Brian Gaeke
5a8ec7d5f6
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.
llvm-svn: 10389
2003-12-11 00:22:59 +00:00
Chris Lattner
f078808a2b
Do not depend on structure elements being of type UByteTy
...
llvm-svn: 10224
2003-11-25 20:44:56 +00:00
Brian Gaeke
d81ca471dd
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.)
llvm-svn: 9965
2003-11-13 06:06:01 +00:00
Brian Gaeke
960707c335
Put all LLVM code into the llvm namespace, as per bug 109.
...
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Brian Gaeke
9ef636c698
Implement vaarg instruction. This is not quite perfect: 2003-08-11-VaListArg
...
still causes a crash. But it's better than before.
llvm-svn: 9794
2003-11-07 21:20:47 +00:00
Brian Gaeke
85baf8c65a
popStackAndReturnValueToCaller() must advance instruction pointer to normal
...
destination, if returning from an invoke.
Implement 'unwind' instruction.
llvm-svn: 9792
2003-11-07 20:44:58 +00:00
Brian Gaeke
6d145eb65f
Add stub version of unwind support
...
llvm-svn: 9789
2003-11-07 20:07:06 +00:00
Brian Gaeke
a6454d3532
visitCallInst --> visitCallSite.
...
Use visitCallSite to implement both CallInsts and InvokeInsts.
llvm-svn: 9788
2003-11-07 20:04:22 +00:00
Brian Gaeke
a6d48e4db2
Make the operation of visitCallInst() only depend on the CallSite.
...
llvm-svn: 9787
2003-11-07 19:59:08 +00:00
Brian Gaeke
18b59578c9
Use CallSites for call sites, instead of CallInsts. A revolutionary concept.
...
llvm-svn: 9784
2003-11-07 19:26:23 +00:00
Brian Gaeke
65cac90a92
Refactor the return-from-function code into popStackAndReturnValueToCaller().
...
Make external function calls slightly less special; now they get a stack frame.
llvm-svn: 9765
2003-11-07 05:22:49 +00:00
Chris Lattner
b5b9ba6ff6
Be friendly to gcc 3.4... good compiler. Nice compiler.
...
llvm-svn: 9726
2003-11-05 06:20:27 +00:00
Brian Gaeke
221827ab07
Use regular old malloc to emulate malloc/alloca instructions.
...
llvm-svn: 9713
2003-11-05 01:02:14 +00:00
Brian Gaeke
175018317e
Remove a comment which no longer applies.
...
llvm-svn: 9712
2003-11-05 00:59:28 +00:00
Brian Gaeke
e278c22380
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.
llvm-svn: 9489
2003-10-24 19:59:01 +00:00
John Criswell
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
Chris Lattner
fefd3bebc4
Interpret the new varargs intrinsics correctly
...
llvm-svn: 9222
2003-10-18 05:55:25 +00:00
Misha Brukman
aa7d26c8c8
Fix spelling.
...
llvm-svn: 9021
2003-10-10 17:42:19 +00:00
Brian Gaeke
20c65741d0
Never set any signal handlers.
...
Never call setjmp(), longjmp() or strsignal().
llvm-svn: 9014
2003-10-10 17:03:22 +00:00
Chris Lattner
a28e1f281a
Change FunctionInfo from being an annotation put on Functions to be
...
something which is mapped from functions.
llvm-svn: 8580
2003-09-17 17:26:22 +00:00
Brian Gaeke
9b518bc0be
Make getOperandValue and executeCastOperation methods of Interpreter.
...
This lets us protect a few more ExecutionEngine methods.
llvm-svn: 8367
2003-09-05 18:55:03 +00:00
Brian Gaeke
33d98aebe7
Remove printOperandInfo(), and simplify run().
...
llvm-svn: 8362
2003-09-05 05:22:08 +00:00
Brian Gaeke
ed9917b3f8
Remove support for printing values from a module by name, only used
...
w/ interactive keyboard entry of names.
With that, Support.cpp is history.
llvm-svn: 8360
2003-09-05 05:04:32 +00:00
Brian Gaeke
8421765778
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.
llvm-svn: 8359
2003-09-05 04:46:26 +00:00
Brian Gaeke
411281cc82
Remove support for breakpoints (not used).
...
Remove some dead code and whitespace.
llvm-svn: 8346
2003-09-04 23:15:40 +00:00
Brian Gaeke
e80e5ba7f8
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().
llvm-svn: 8344
2003-09-04 22:21:24 +00:00
Chris Lattner
625eef3e41
Remove redundant const qualifier
...
llvm-svn: 7254
2003-07-23 15:30:32 +00:00
Chris Lattner
4a5bb95729
Add support for atexit function, remove support for __main function
...
llvm-svn: 6194
2003-05-14 14:21:30 +00:00
Chris Lattner
185045c494
switch main LLI core execution to use an InstVisitor instead of a switch statement
...
llvm-svn: 6081
2003-05-10 21:22:39 +00:00
Chris Lattner
bd6771cb25
Fix testcase: SingleSource/UnitTests/2003-05-02-DependantPHI.c
...
llvm-svn: 6074
2003-05-10 20:21:16 +00:00
Chris Lattner
525e251c4e
Implement varargs support for LLI!
...
llvm-svn: 6043
2003-05-08 16:52:43 +00:00
Chris Lattner
470754e3ca
A large number of simple changes:
...
* s/Method/Function
* Kill some obsolete (external) functions that used to be to support tracing
llvm-svn: 6041
2003-05-08 16:18:31 +00:00
Chris Lattner
22e90434f3
Add support for recording arguments passed through the ... of a varargs function
...
llvm-svn: 6040
2003-05-08 16:06:52 +00:00
Chris Lattner
ba90675054
Fix problem where we would read 64 bits worth of pointer information, even on 32 bit targets!
...
llvm-svn: 5930
2003-04-25 04:21:19 +00:00
Chris Lattner
ed27f84ed9
Fix a problem with setcc instructions and pointers
...
llvm-svn: 5886
2003-04-23 19:55:35 +00:00
Chris Lattner
7881fc8704
Implement &|^ on bool values
...
llvm-svn: 5884
2003-04-23 19:21:00 +00:00
Chris Lattner
aee56b8d34
Kill using declarations
...
Kill code for invalid operations on pointers
llvm-svn: 5856
2003-04-22 21:22:33 +00:00
Chris Lattner
bbd1157f71
Implement cast to bool
...
llvm-svn: 5855
2003-04-22 21:15:56 +00:00
Chris Lattner
fa5fc55f83
Get rid of extraneous arguments to implementation functions
...
llvm-svn: 5852
2003-04-22 20:37:39 +00:00
Chris Lattner
d215af03a3
Add support to LLI for switch instruction
...
llvm-svn: 5851
2003-04-22 20:34:47 +00:00
Chris Lattner
f11d8a35ab
Fix wierd idiom
...
llvm-svn: 5831
2003-04-21 22:43:32 +00:00
Chris Lattner
13b3e5bdab
Fix typeo
...
llvm-svn: 5624
2003-02-25 21:14:59 +00:00
Chris Lattner
4e7aa44644
Handle value promotion properly to work with tracing better
...
llvm-svn: 5253
2003-01-13 00:58:52 +00:00