1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

521 Commits

Author SHA1 Message Date
Duncan Sands
948343f861 It looks like this has been broken for some time -
get it to compile.

llvm-svn: 44791
2007-12-10 14:43:10 +00:00
Chris Lattner
e297cb5408 simplify creation of the interpreter, make ExecutionEngine ctor protected,
delete one ExecutionEngine ctor, minor cleanup.

llvm-svn: 44646
2007-12-06 01:08:09 +00:00
Duncan Sands
1b0feb42e2 Add some convenience methods for querying attributes, and
use them.

llvm-svn: 44403
2007-11-28 17:07:01 +00:00
Duncan Sands
eb464e976f Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.
The meaning of getTypeSize was not clear - clarifying it is important
now that we have x86 long double and arbitrary precision integers.
The issue with long double is that it requires 80 bits, and this is
not a multiple of its alignment.  This gives a primitive type for
which getTypeSize differed from getABITypeSize.  For arbitrary precision
integers it is even worse: there is the minimum number of bits needed to
hold the type (eg: 36 for an i36), the maximum number of bits that will
be overwriten when storing the type (40 bits for i36) and the ABI size
(i.e. the storage size rounded up to a multiple of the alignment; 64 bits
for i36).

This patch removes getTypeSize (not really - it is still there but
deprecated to allow for a gradual transition).  Instead there is:

(1) getTypeSizeInBits - a number of bits that suffices to hold all
values of the type.  For a primitive type, this is the minimum number
of bits.  For an i36 this is 36 bits.  For x86 long double it is 80.
This corresponds to gcc's TYPE_PRECISION.

(2) getTypeStoreSizeInBits - the maximum number of bits that is
written when storing the type (or read when reading it).  For an
i36 this is 40 bits, for an x86 long double it is 80 bits.  This
is the size alias analysis is interested in (getTypeStoreSize
returns the number of bytes).  There doesn't seem to be anything
corresponding to this in gcc.

(3) getABITypeSizeInBits - this is getTypeStoreSizeInBits rounded
up to a multiple of the alignment.  For an i36 this is 64, for an
x86 long double this is 96 or 128 depending on the OS.  This is the
spacing between consecutive elements when you form an array out of
this type (getABITypeSize returns the number of bytes).  This is
TYPE_SIZE in gcc.

Since successive elements in a SequentialType (arrays, pointers
and vectors) need to be aligned, the spacing between them will be
given by getABITypeSize.  This means that the size of an array
is the length times the getABITypeSize.  It also means that GEP
computations need to use getABITypeSize when computing offsets.
Furthermore, if an alloca allocates several elements at once then
these too need to be aligned, so the size of the alloca has to be
the number of elements multiplied by getABITypeSize.  Logically
speaking this doesn't have to be the case when allocating just
one element, but it is simpler to also use getABITypeSize in this
case.  So alloca's and mallocs should use getABITypeSize.  Finally,
since gcc's only notion of size is that given by getABITypeSize, if
you want to output assembler etc the same as gcc then getABITypeSize
is the size you want.

Since a store will overwrite no more than getTypeStoreSize bytes,
and a read will read no more than that many bytes, this is the
notion of size appropriate for alias analysis calculations.

In this patch I have corrected all type size uses except some of
those in ScalarReplAggregates, lib/Codegen, lib/Target (the hard
cases).  I will get around to auditing these too at some point,
but I could do with some help.

Finally, I made one change which I think wise but others might
consider pointless and suboptimal: in an unpacked struct the
amount of space allocated for a field is now given by the ABI
size rather than getTypeStoreSize.  I did this because every
other place that reserves memory for a type (eg: alloca) now
uses getABITypeSize, and I didn't want to make an exception
for unpacked structs, i.e. I did it to make things more uniform.
This only effects structs containing long doubles and arbitrary
precision integers.  If someone wants to pack these types more
tightly they can always use a packed struct.

llvm-svn: 43620
2007-11-01 20:53:16 +00:00
Gabor Greif
0fb7aa568a Fix an assertion abort on sparc. malloc(0) is allowed to
return NULL.

llvm-svn: 42871
2007-10-11 19:40:35 +00:00
Chris Lattner
6820dc306f #ifdef out unsafe tracing code, which fixes PR1689
llvm-svn: 42205
2007-09-21 18:30:39 +00:00
Chris Lattner
742b745b0c rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned()
Add an APSInt::toString() method.

llvm-svn: 41309
2007-08-23 05:15:32 +00:00
Anton Korobeynikov
73add7de64 Add a comment: don't expect from external function resolver in interpreter
things, it wasn't designed to handle.

llvm-svn: 40608
2007-07-30 23:03:25 +00:00
Dan Gohman
75473b49ea More explicit keywords.
llvm-svn: 40589
2007-07-30 14:51:59 +00:00
Chuck Rose III
4a3a018844 VStudio compiler errors and placing Function*->ExFunc map under ManagedStatic control.
This commit fixes two things.  One is a pair of VStudio compiler errors stemming from variables
which defined within the for loop statement and also within the body of the for loop.  I fixed these 
by renaming one of the two variables.  Additionally, I've made the Function*->ExFunc map in 
ExternalFunctions.cpp a ManagedStatic object, so that cleanup will be done on llvm_shutdown.  In repeated
uses of the interpreter, where the same Function* address may get used for completely differnet functions,
this was causing a crash.

llvm-svn: 40558
2007-07-27 18:26:35 +00:00
Reid Spencer
9baf82d943 For PR1486:
Avoid overwriting the APInt instance with 0 bytes which causes the bitwidth
to be set to 0 (illegal) producing a subsequent assert.

llvm-svn: 37391
2007-06-01 22:23:29 +00:00
Reid Spencer
2fc9ebc62a On Linux platforms and at optimization levels -O1 and above, llvm-gcc can
turn "putchar" calls into _IO_putc calls which is a lower-level interface.
This patch allows these calls to be executed by lli in interpreter mode.

llvm-svn: 37254
2007-05-19 01:36:17 +00:00
Reid Spencer
e22c276c5c Print integer values as both decimal and hexadecimal for convenience
of verifying result values when debugging.

llvm-svn: 37156
2007-05-17 06:47:54 +00:00
Reid Spencer
a89e097aa2 Avoid a "loss of precision" error in gcc 4.1.3.
llvm-svn: 37105
2007-05-16 16:39:29 +00:00
Reid Spencer
3c3aa55322 Implement printing of instruction result values when debug info is turned
on. This helps to speed up the debugging time by showing computational
results as the program executes.

llvm-svn: 37095
2007-05-16 02:05:13 +00:00
Reid Spencer
68ab99ffb6 Bitcast all the bits of a floating point value, not just one. The zero
extension is needed because the constructor for the Destination value
causes the APInt to have a bit width of 1.
Patch by Guoling Han.

llvm-svn: 36733
2007-05-04 03:37:38 +00:00
Reid Spencer
6200dc3275 1. Don't swap byte order in scanf. It isn't necessary and leads to
incorrect results (canonicalization was dropped several commits ago).
2. Add support for fscanf.
3. Suppress a warning about cast to pointer from non-pointer-sized integer.

llvm-svn: 36482
2007-04-26 18:19:35 +00:00
Reid Spencer
a7bedff902 We only need one putchar which gives it a shot at getting matched by its
users.

llvm-svn: 36305
2007-04-21 17:11:45 +00:00
Chris Lattner
058a0c6977 eliminate use of Instruction::getPrev(). Patch by Gabor Greif in 2005.
llvm-svn: 36198
2007-04-17 17:38:28 +00:00
Reid Spencer
d22d480758 Implement @sext and @zext parameter attribute handling properly instead of
forcing every small argument of every function regardless of attributes or
calling convention to be expanded.

llvm-svn: 36174
2007-04-16 21:50:40 +00:00
Reid Spencer
e1fed6f90d For PR1293:
* Rename the FunctionType* parameter from M to FT on all the functions.
* Implement a fix for PR1293 by just asserting that library functions that
  must return pointers should have pointer typed results. This just makes
  sure that we don't attempt to use an uninitialized integer or something
  later on.

llvm-svn: 35508
2007-03-30 16:41:50 +00:00
Bill Wendling
4e2fff5898 Don't use std::hex.
llvm-svn: 35038
2007-03-08 23:37:24 +00:00
Bill Wendling
80cc8c4502 Don't use a cast. It causes an error on some platforms.
llvm-svn: 35037
2007-03-08 23:26:50 +00:00
Reid Spencer
5816281df1 Fix some thinko's in the last patch. PtrSize has to be in bits and we
might need to zext not just trunc the value.

llvm-svn: 34955
2007-03-06 03:46:41 +00:00
Reid Spencer
854b342a38 Fix a bug in IntToPtr. Truncating to 64-bits only works if the integer
is larger. Adjust so that it truncates to pointer width, only if necessary.

llvm-svn: 34954
2007-03-06 03:41:50 +00:00
Reid Spencer
d333ccc051 Radically simplify execution. This patch gets rid of all the special
handling for integer of various sizes. GenericValue now has just a single
integer field of type APInt. We use its facilities directly in the
execution of all instructions.

llvm-svn: 34951
2007-03-06 03:09:31 +00:00
Reid Spencer
ccb2a63443 Adjust and simplify external function processing now that GenericValue has
a single integer field of type APInt.

llvm-svn: 34950
2007-03-06 03:08:12 +00:00
Reid Spencer
7985dd51a2 APInt's are no longer allocated on the heap because they are direct
members of GenericValue. Consequently the code to clean them up isn't
needed.

llvm-svn: 34948
2007-03-06 03:06:48 +00:00
Reid Spencer
0e27441b52 Remove the insufficient code in Interpreter::create that computed the
Target DataLayout incorrectly. For now, we'll trust that the module has
got the correct DataLayout. In the future, this needs to be changed to
tell the TargetData to be "current host".

llvm-svn: 34947
2007-03-06 03:05:57 +00:00
Reid Spencer
4ab5a02fb1 Remove unnecessary #include.
llvm-svn: 34889
2007-03-03 18:29:16 +00:00
Reid Spencer
4610488330 Deal with error handling better.
llvm-svn: 34887
2007-03-03 18:19:18 +00:00
Reid Spencer
8aaa36a012 Complete the APIntification of the interpreter. All asserts for > 64 bits
have been removed and dealt with. The interpreter should now be able to
execute any LLVM program using any bit width.

llvm-svn: 34884
2007-03-03 08:38:04 +00:00
Reid Spencer
747e872c5b Implement APInt support for the binary operators.
Move the getConstantExpr function towards the end of the file so we don't
need a dozen forward declarations.

llvm-svn: 34877
2007-03-03 06:22:22 +00:00
Reid Spencer
11a355139c 1. Have the ExecutionContext keep track of the APInt's allocated and
ensure they are cleaned up when the stack frame exits.
2. Move a function to the Execution.cpp file where it belongs.

llvm-svn: 34876
2007-03-03 06:19:55 +00:00
Chris Lattner
fc2686da00 From Dan Gohman:
While preparing http://llvm.org/PR1198 I noticed several asserts
protecting unprepared code from i128 types that weren't actually failing
when they should because they were written as assert("foo") instead of
something like assert(0 && "foo"). This patch fixes all the cases that a
quick grep found.

llvm-svn: 34267
2007-02-14 06:20:04 +00:00
Chris Lattner
9dafd9fe90 Privatize StructLayout::MemberOffsets, adding an accessor
llvm-svn: 34156
2007-02-10 19:55:17 +00:00
Reid Spencer
6e19d7114f For PR1188:
Compute BitMask correctly.

Patch by Leo (wenwenti@hotmail.com).

llvm-svn: 34026
2007-02-08 00:29:31 +00:00
Reid Spencer
591bfa1e0b Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types.  This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
   shl i32 %X, 1
instead of
   shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.

llvm-svn: 33776
2007-02-02 02:16:23 +00:00
Reid Spencer
19af04a142 For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.

llvm-svn: 33663
2007-01-30 20:08:39 +00:00
Reid Spencer
f7024eb670 Remove tabs.
llvm-svn: 33620
2007-01-29 17:55:50 +00:00
Reid Spencer
c0ebe17b6a Implement use of new IntrinsicLowering interface.
llvm-svn: 33619
2007-01-29 17:51:02 +00:00
Reid Spencer
cec82ab067 For PR761:
The Module::setEndianness and Module::setPointerSize methods have been
removed. Instead you can get/set the DataLayout. Adjust thise accordingly.

llvm-svn: 33530
2007-01-26 08:11:39 +00:00
Reid Spencer
e33c18f4d2 For PR970:
Clean up handling of isFloatingPoint() and dealing with PackedType.
Patch by Gordon Henriksen!

llvm-svn: 33415
2007-01-21 00:29:26 +00:00
Reid Spencer
16f559f465 Implement the signed icmp instructions properly. To do this we introduce
a small inline function to sign extend a uint64_t value based on its
type's bitwidth. This function is then used in both executeSExtInst and
the various executeICMP_S** functions.

llvm-svn: 33403
2007-01-20 20:12:29 +00:00
Reid Spencer
14d12fbaa6 Implement bit-accurate sext instruction.
This patch fixes test/Integer/2007-01-17-TruncSext.ll

llvm-svn: 33394
2007-01-20 08:32:52 +00:00
Reid Spencer
e242773c58 Use the new maskToBitWidth function to ensure that the results of
computations do not overflow the intended bit width.

llvm-svn: 33326
2007-01-18 02:12:51 +00:00
Reid Spencer
bff2bccb7c Add an inline helper function that masks a GenericValue to a specified
bit width.

llvm-svn: 33325
2007-01-18 02:12:10 +00:00
Reid Spencer
539c40505b Make shl instruction mask its result to the correct bitsize. This is
sufficient to get llvm-test/SingleSource/UnitTests/Integer/general-test.ll
working with lli in interpreter mode.

llvm-svn: 33321
2007-01-18 01:32:46 +00:00
Reid Spencer
0524da8d3d Two changes:
1. Fix logic for executeGEP. Only 32-bit and 64-bit integer types are
   acceptable as indices.
2. Ensure that all integer cast operations truncate their result to the
   integer size of the operand.

llvm-svn: 33318
2007-01-18 01:25:42 +00:00
Chris Lattner
c5e1611848 rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent.  For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)

llvm-svn: 33225
2007-01-15 02:27:26 +00:00
Chris Lattner
f48900e322 eliminate calls to Type::isInteger, preferring isIntegral instead.
llvm-svn: 33222
2007-01-15 02:03:16 +00:00
Reid Spencer
373d2bccea For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.

llvm-svn: 33113
2007-01-12 07:05:14 +00:00
Reid Spencer
f3265181e2 Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Reid Spencer
a3ebd9757c For PR950:
Convert signed integer types to signless ones.

llvm-svn: 32787
2006-12-31 05:51:36 +00:00
Reid Spencer
4428c3483b For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.

llvm-svn: 32751
2006-12-23 06:05:41 +00:00
Chris Lattner
49f77ec857 elimiante Statistic static ctors
llvm-svn: 32702
2006-12-19 22:56:53 +00:00
Bill Wendling
23b8b13c9d Removing even more <iostream> includes.
llvm-svn: 32320
2006-12-07 20:04:42 +00:00
Bill Wendling
a3246c4272 Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.

llvm-svn: 32298
2006-12-07 01:30:32 +00:00
Chris Lattner
a531ce882e Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.

llvm-svn: 32279
2006-12-06 17:46:33 +00:00
Jeff Cohen
f99052befb Unbreak VC++ build.
llvm-svn: 32113
2006-12-02 02:22:01 +00:00
Bill Wendling
dc4b499ace Removed #include <iostream> and replaced streams with llvm streams.
llvm-svn: 31949
2006-11-27 23:54:50 +00:00
Reid Spencer
992d9788b3 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.

llvm-svn: 31931
2006-11-27 01:05:10 +00:00
Chris Lattner
ccbbe940eb Simplify IntrinsicLowering and clarify that it is only for use by the
CBE and interpreter.

llvm-svn: 31755
2006-11-15 18:00:10 +00:00
Jim Laskey
28fec74f1b Remove redundant <cmath>.
llvm-svn: 31561
2006-11-08 19:16:44 +00:00
Reid Spencer
da1f5b882a For PR950:
This patch converts the old SHR instruction into two instructions,
AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not
dependent on the sign of their operands.

llvm-svn: 31542
2006-11-08 06:47:33 +00:00
Reid Spencer
34154e10e7 Remove a function prototype that is no longer needed (REM patch missed it)
llvm-svn: 31374
2006-11-02 08:12:02 +00:00
Reid Spencer
1abf69e923 For PR950:
Replace the REM instruction with UREM, SREM and FREM.

llvm-svn: 31369
2006-11-02 01:53:59 +00:00
Reid Spencer
a47902dc6f Remove unnecessary sign conversions made possible by last patch.
llvm-svn: 31339
2006-11-01 03:45:43 +00:00
Reid Spencer
ea7b487e03 Fix a bug in the interpreter where divides of unmatched signed operands
would fail. E.g. udiv sint X, Y  or sdiv uint X, Y would fail to find a
type match in the switch statement and fail the operation.

llvm-svn: 31338
2006-11-01 03:41:05 +00:00
Reid Spencer
6833ffe8b8 For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.

llvm-svn: 31195
2006-10-26 06:15:43 +00:00
Reid Spencer
d414793dbc For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.

llvm-svn: 31063
2006-10-20 07:07:24 +00:00
Chris Lattner
1eabe5fb58 initial changes to support JIT'ing from multiple module providers, implicitly
linking the program on the fly.

llvm-svn: 29721
2006-08-16 01:24:12 +00:00
Chris Lattner
5a1f56fc2a Simplify TargetData ctor call
llvm-svn: 28832
2006-06-16 18:24:38 +00:00
Chris Lattner
ac373d311b Simplify interpreter construction.
llvm-svn: 28826
2006-06-16 18:08:38 +00:00
Chris Lattner
50af98a5f2 Fix -pedantic warnings
llvm-svn: 28635
2006-06-01 17:27:11 +00:00
Reid Spencer
574d4e6992 For PR786:
Minor tweaks in public headers and a few .cpp files so that LLVM can build
successfully with -pedantic and projects using LLVM with -pedantic don't
get warnings from LLVM. There's still more -pedantic warnings to fix.

llvm-svn: 28453
2006-05-24 19:21:13 +00:00
Owen Anderson
71bc529dfa Refactor TargetMachine, pushing handling of TargetData into the target-specific subclasses. This has one caller-visible change: getTargetData() now returns a pointer instead of a reference.
This fixes PR 759.

llvm-svn: 28074
2006-05-03 01:29:57 +00:00
Jeff Cohen
dab30f45d8 Get JIT/Interpreter working on Windows again.
llvm-svn: 27037
2006-03-24 02:53:49 +00:00
Chris Lattner
2aa3f9a6b5 remove the intrinsiclowering hook
llvm-svn: 26970
2006-03-23 05:22:51 +00:00
Chris Lattner
ab22cd5c33 Eliminate the dependency of ExecutionEngine on the JIT/Interpreter libraries.
Now you can build a tool with just the JIT or just the interpreter.

llvm-svn: 26946
2006-03-22 06:07:50 +00:00
Jeff Cohen
e66383eb06 The interpreter assumes that the caller of runFunction() must be lli, and
therefore the function being called must be a main() returning an int.  The
consequences when these assumptions are false are not good, so don't assume
them.

llvm-svn: 26031
2006-02-07 05:29:44 +00:00
Jeff Cohen
bd51ec7461 Eliminate all remaining tabs and trailing spaces.
llvm-svn: 22523
2005-07-27 06:12:32 +00:00
Andrew Lenharth
a9214fec08 core changes for varargs
llvm-svn: 22254
2005-06-18 18:34:52 +00:00
Misha Brukman
3ef1d71bfa Convert tabs to spaces
llvm-svn: 21440
2005-04-22 04:08:30 +00:00
Misha Brukman
dda9dce10f * Remove trailing whitespace
* Convert tabs to spaces

llvm-svn: 21421
2005-04-21 22:43:08 +00:00
Chris Lattner
4b688a1c70 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner
24bf1ca350 If the interpreter tries to execute an external function, kill it. Of course
since we are dirty, special case __main.  This should fix the infinite loop
horrible stuff that happens on linux-alpha when configuring llvm-gcc.  It
might also help cygwin, who knows??

llvm-svn: 19729
2005-01-21 19:59:37 +00:00
Chris Lattner
605b9a23a2 Improve compatiblity with HPUX on Itanium, patch by Duraid Madina
llvm-svn: 19586
2005-01-16 01:31:31 +00:00
Chris Lattner
7a6914d3fc Silence warnings
llvm-svn: 19392
2005-01-08 20:13:44 +00:00
Chris Lattner
a4a16f17a3 Silence VS warnings
llvm-svn: 19389
2005-01-08 20:05:34 +00:00
Reid Spencer
74b17227a5 Use System/DynamicLibrary instead of Support/DynamicLinker
llvm-svn: 18357
2004-11-29 14:11:29 +00:00
Misha Brukman
8c397821a5 Implement ExecutionEngine::freeMachineCodeForFunction()
llvm-svn: 17601
2004-11-07 23:58:46 +00:00
Reid Spencer
1be896397a Fix library name.
llvm-svn: 17307
2004-10-28 05:37:24 +00:00
Reid Spencer
1a344dfd95 Changes to support rand48 tests
llvm-svn: 17284
2004-10-27 23:03:44 +00:00
Reid Spencer
e48ba34fd4 We won't use automake
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Reid Spencer
ce514b1c2c Initial automake generated Makefile template
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Chris Lattner
2fae8a1ef9 Add support for unreachable
llvm-svn: 17056
2004-10-16 18:21:33 +00:00
Reid Spencer
e6418ec30f Update to reflect changes in Makefile rules.
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Reid Spencer
7d9cba7a0f Initial version of automake Makefile.am file.
llvm-svn: 16885
2004-10-10 20:43:57 +00:00
Reid Spencer
c6a8d70cff Convert code to compile with vc7.1.
Patch contributed by Paolo Invernizzi. Thanks Paolo!

llvm-svn: 16368
2004-09-15 17:06:42 +00:00
Reid Spencer
c4abcbefb1 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
Chris Lattner
d7870e4b1a Fixes for PR341
llvm-svn: 14848
2004-07-15 02:51:32 +00:00
Chris Lattner
94212f7102 Fixes for PR341
llvm-svn: 14847
2004-07-15 02:51:31 +00:00
Reid Spencer
50ec3f9325 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
cc465361d9 Move the IntrinsicLowering header into the CodeGen directory, as per PR346
llvm-svn: 14266
2004-06-20 07:49:54 +00:00
Chris Lattner
0cd29ae2cd Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Brian Gaeke
19d2a396da Add int ferror(FILE *)
llvm-svn: 14194
2004-06-16 02:56:40 +00:00
Chris Lattner
8014d498cb These #includes are long dead
llvm-svn: 13856
2004-05-27 21:24:38 +00:00
Reid Spencer
63530c743e 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
aaeb4c4d23 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
96889991bb 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
Chris Lattner
8b841e0e35 Add support for the select instruction
llvm-svn: 13076
2004-04-20 16:43:21 +00:00
Chris Lattner
27dff42330 Adjust to new interface
llvm-svn: 12646
2004-04-04 19:47:06 +00:00
Chris Lattner
5c053bfa99 Adjust to new gep_type_iterator prototypes.
llvm-svn: 12644
2004-04-04 17:30:06 +00:00
Chris Lattner
f7bc6fd913 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
Chris Lattner
5924de460e remove obsolete comment
llvm-svn: 11872
2004-02-26 07:59:22 +00:00
Brian Gaeke
aba4159be8 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
40b9cf9615 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
212ffba663 The Interpreter was failing the AtExit UnitTest. This fixes it.
llvm-svn: 11367
2004-02-13 05:48:00 +00:00
Chris Lattner
a1757d1d91 Start using the new and improve interface to FunctionType arguments
llvm-svn: 11224
2004-02-09 04:14:01 +00:00
Chris Lattner
68fdb35576 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
7824ed3d12 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
c37577eb9f 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
44f1ab7c2f 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
Chris Lattner
d7d8336d73 No longer run atExit functions from run()
rename run to runFunction

llvm-svn: 10609
2003-12-26 06:13:05 +00:00
Chris Lattner
9047cde657 Finegrainify namespacification
llvm-svn: 10465
2003-12-14 23:25:48 +00:00
Brian Gaeke
84101bcdb8 Dynamically get the right-sized member of a GenericValue to hold a size_t, and
use it to return the result of strlen.

llvm-svn: 10433
2003-12-12 15:38:06 +00:00
Brian Gaeke
fb0c4c3d39 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
7fe399f169 Fix typo in comment. Add prototype for getConstantExprValue().
llvm-svn: 10390
2003-12-11 00:23:28 +00:00
Brian Gaeke
e7599245cb 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
369445aaa6 implement method
llvm-svn: 10321
2003-12-08 08:23:04 +00:00
Chris Lattner
50a3a40d5f Do not depend on structure elements being of type UByteTy
llvm-svn: 10224
2003-11-25 20:44:56 +00:00
Brian Gaeke
d966bbe9bf 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
d25f86d683 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
d246e0be30 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
22bfc41ae1 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
88a4c1b68b Add stub version of unwind support
llvm-svn: 9789
2003-11-07 20:07:06 +00:00
Brian Gaeke
059af2222a visitCallInst --> visitCallSite.
Use visitCallSite to implement both CallInsts and InvokeInsts.

llvm-svn: 9788
2003-11-07 20:04:22 +00:00
Brian Gaeke
f7f7310b47 Make the operation of visitCallInst() only depend on the CallSite.
llvm-svn: 9787
2003-11-07 19:59:08 +00:00
Brian Gaeke
29d6325ca3 Use CallSites for call sites, instead of CallInsts. A revolutionary concept.
llvm-svn: 9784
2003-11-07 19:26:23 +00:00
Brian Gaeke
252fd99794 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
3099f615fa Be friendly to gcc 3.4... good compiler. Nice compiler.
llvm-svn: 9726
2003-11-05 06:20:27 +00:00
Brian Gaeke
ee15c93eda Abort when the user program calls abort, instead of printing a funny message and calling exit(1).
llvm-svn: 9716
2003-11-05 01:18:49 +00:00
Brian Gaeke
251ac27789 Use regular old malloc to emulate malloc/alloca instructions.
llvm-svn: 9713
2003-11-05 01:02:14 +00:00
Brian Gaeke
246426591b Remove a comment which no longer applies.
llvm-svn: 9712
2003-11-05 00:59:28 +00:00
Chris Lattner
4271c6fea0 Unbreak the build
llvm-svn: 9502
2003-10-25 16:18:03 +00:00
Brian Gaeke
1de42e556d 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().

llvm-svn: 9493
2003-10-24 19:59:37 +00:00
Brian Gaeke
8abf6d4df3 ExecutionEngine::create no longer takes a TraceMode argument.
CurFrame, TraceMode, and the CachedWriter are history.

llvm-svn: 9492
2003-10-24 19:59:28 +00:00
Brian Gaeke
719a4c165f The ExecutionAnnotations (SlotNumber, InstNumber, and FunctionInfo) are history.
llvm-svn: 9490
2003-10-24 19:59:18 +00:00
Brian Gaeke
032ca42757 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
de34542f41 Added LLVM copyright header.
llvm-svn: 9321
2003-10-21 15:17:13 +00:00
John Criswell
71d2894956 Added LLVM copyright notice to Makefiles.
llvm-svn: 9312
2003-10-20 22:26:57 +00:00
John Criswell
b402729b30 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
79135c051e Interpret the new varargs intrinsics correctly
llvm-svn: 9222
2003-10-18 05:55:25 +00:00
Misha Brukman
50fa0a7bae Order #includes as per the style guide.
llvm-svn: 9128
2003-10-14 21:42:11 +00:00
Brian Gaeke
a3f850a182 Don't include Config/stdio.h or <stdio.h>.
llvm-svn: 9031
2003-10-10 18:46:29 +00:00
Misha Brukman
32c5aec6ec Fix spelling.
llvm-svn: 9021
2003-10-10 17:42:19 +00:00
Brian Gaeke
c38ad8b86e Never set any signal handlers.
Never call setjmp(), longjmp() or strsignal().

llvm-svn: 9014
2003-10-10 17:03:22 +00:00
Brian Gaeke
e90a3199eb 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.

llvm-svn: 9013
2003-10-10 17:03:10 +00:00
Chris Lattner
01d8fd6a3b Do not read past the end of the contained type list
llvm-svn: 8986
2003-10-09 20:31:18 +00:00
Chris Lattner
68f6d33416 Squelch warning
llvm-svn: 8659
2003-09-22 20:33:34 +00:00
Chris Lattner
a54026a27b 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
Chris Lattner
6c68b828f6 Reorder #includes to follow LLVM conventions
llvm-svn: 8375
2003-09-05 20:08:15 +00:00
Brian Gaeke
ba6d0a6759 ExecutionEngine.h, GenericValue.h --> include/llvm/ExecutionEngine/
Build ExecutionEngine as library.

llvm-svn: 8370
2003-09-05 19:39:22 +00:00
Brian Gaeke
8e1bb0bcb2 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
e157a77485 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
Brian Gaeke
7be0ff04e5 Remove printOperandInfo(), and simplify run().
llvm-svn: 8362
2003-09-05 05:22:08 +00:00
Brian Gaeke
b42a2de8a9 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
edded6bce7 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
5efbdb852a 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
6d7d9f9cd9 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
Brian Gaeke
cec978e0ed 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
Chris Lattner
24b58d4b81 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
Chris Lattner
688dd40912 Add preliminary support for "any" pointersize/endianness. This will need
to change soon though.

llvm-svn: 8123
2003-08-24 14:02:47 +00:00
John Criswell
8bc390da1b 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
Misha Brukman
56f7db4178 Spell `necessary' correctly.
llvm-svn: 7944
2003-08-18 14:43:39 +00:00
Brian Gaeke
2e59087317 Deconstify parameter to getPointerToFunction().
llvm-svn: 7822
2003-08-13 18:17:54 +00:00
Chris Lattner
dd48c4b1e4 Remove redundant const qualifier
llvm-svn: 7254
2003-07-23 15:30:32 +00:00
John Criswell
258dfc0319 Merged in autoconf branch. This provides configuration via the autoconf
system.

llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Brian Gaeke
af128adb0a Include <cmath> instead of <math.h>
Remove isnan; it's too unportable to handle cleanly at this point.

llvm-svn: 6866
2003-06-23 19:41:55 +00:00
Brian Gaeke
db4d9c9bd8 Use std::isnan instead of isnan. Brought back to you from the
future, by the reconciliation of the C++ and C99 standards. Someday.

llvm-svn: 6751
2003-06-17 19:59:17 +00:00
Chris Lattner
cbf31910a5 Add support for atexit function, remove support for __main function
llvm-svn: 6194
2003-05-14 14:21:30 +00:00
Chris Lattner
46f2fc75da 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
Chris Lattner
023c628a58 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
011dba165e Fix testcase: SingleSource/UnitTests/2003-05-02-DependantPHI.c
llvm-svn: 6074
2003-05-10 20:21:16 +00:00
Chris Lattner
f5a5ed1a59 Implement varargs support for LLI!
llvm-svn: 6043
2003-05-08 16:52:43 +00:00
Chris Lattner
818643d3e9 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
6aa2e81ec4 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
bbe1aba425 Remove two fields from TargetData which are target specific.
llvm-svn: 5963
2003-04-26 20:11:09 +00:00
Chris Lattner
dc49712791 Only do the %ld -> %lld promotion when running a 64 bit bytecode on a 32 bit host
llvm-svn: 5942
2003-04-25 18:28:44 +00:00
Chris Lattner
e8eb2cb855 Add __strdup
llvm-svn: 5941
2003-04-25 18:23:38 +00:00
Chris Lattner
4196cc4916 MAke sure that LLI properly configures align_of(double)
llvm-svn: 5938
2003-04-25 06:15:05 +00:00
Chris Lattner
b72c6d38da 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
84efc8b467 Add memcpy
llvm-svn: 5887
2003-04-23 20:23:16 +00:00
Chris Lattner
55a3471dab Fix a problem with setcc instructions and pointers
llvm-svn: 5886
2003-04-23 19:55:35 +00:00
Chris Lattner
34be06fad1 Implement a bunch of new external functions
llvm-svn: 5885
2003-04-23 19:55:24 +00:00
Chris Lattner
90d0ad7683 Implement &|^ on bool values
llvm-svn: 5884
2003-04-23 19:21:00 +00:00
Chris Lattner
48e894f97b Add support for _IO_getc function used on linux
llvm-svn: 5883
2003-04-23 19:20:50 +00:00
Chris Lattner
4ffd4c9cd8 Kill using declarations
Kill code for invalid operations on pointers

llvm-svn: 5856
2003-04-22 21:22:33 +00:00
Chris Lattner
56dc44e98a Implement cast to bool
llvm-svn: 5855
2003-04-22 21:15:56 +00:00
Chris Lattner
bdfa086221 Get rid of extraneous arguments to implementation functions
llvm-svn: 5852
2003-04-22 20:37:39 +00:00
Chris Lattner
43d3c3666b Add support to LLI for switch instruction
llvm-svn: 5851
2003-04-22 20:34:47 +00:00
Chris Lattner
dd3c1121d0 Fix wierd idiom
llvm-svn: 5831
2003-04-21 22:43:32 +00:00
Chris Lattner
2fc856e8b6 fprintf CAN take exactly 2 args
llvm-svn: 5830
2003-04-21 22:43:20 +00:00
Chris Lattner
7bfad931b8 Implement scanf and fix sscanf to actually endian swap the results correctly
llvm-svn: 5763
2003-03-31 22:12:37 +00:00
Chris Lattner
ce3e651af6 Fix typeo
llvm-svn: 5624
2003-02-25 21:14:59 +00:00
Chris Lattner
0cd2433ab5 * Wrap at 80 columns
* Fix a ton of warnings
* Implement puts

llvm-svn: 5254
2003-01-13 00:59:47 +00:00
Chris Lattner
fbaa392c19 Handle value promotion properly to work with tracing better
llvm-svn: 5253
2003-01-13 00:58:52 +00:00
Chris Lattner
5fe4097f52 Initial checkin of new LLI with JIT compiler
llvm-svn: 5126
2002-12-24 00:01:05 +00:00
Chris Lattner
42057e4d2a Substantial changes to refactor LLI to incorporate both the Jello JIT and
the traditional LLI interpreter

llvm-svn: 5125
2002-12-23 23:59:41 +00:00
Chris Lattner
6b8e873886 Add support for isnan
llvm-svn: 5111
2002-12-20 04:18:13 +00:00
Chris Lattner
883827db1c Namespacify more
llvm-svn: 4956
2002-12-08 06:01:34 +00:00
Chris Lattner
f525e2f95e Add support to count the number of dynamic instructions executed by LLI
llvm-svn: 4955
2002-12-08 05:51:08 +00:00
Chris Lattner
b5027095e5 - Eliminated the deferred symbol table stuff in Module & Function, it really
wasn't an optimization and it was causing lots of bugs.

llvm-svn: 4779
2002-11-20 18:36:02 +00:00
Chris Lattner
dda5d522bc Implement feof
llvm-svn: 4627
2002-11-08 19:10:26 +00:00
Chris Lattner
8674baf660 Implement freopen for burg
llvm-svn: 4606
2002-11-07 19:33:50 +00:00
Chris Lattner
419dd5f0c1 Make command line arguments setup be endian correct!!
llvm-svn: 4605
2002-11-07 19:29:31 +00:00
Chris Lattner
84ed927ae7 Implement fprintf
llvm-svn: 4585
2002-11-06 23:05:03 +00:00
Chris Lattner
b1a9401c59 Implement fputc and ungetc to allow burg to run in lli
llvm-svn: 4584
2002-11-06 22:59:28 +00:00
Chris Lattner
0396c5461e Fix two problems:
* Load Implementation can cause unaligned memory accesses, which caused
    problems for sparc.
  * cast from pointer to pointer would zero the upper 32 bits of the pointer
    which obviously causes problems on 64 bit hosts.

llvm-svn: 4454
2002-10-30 21:47:57 +00:00
Chris Lattner
c44cc692c6 Fix a major bug in lli
llvm-svn: 4289
2002-10-26 01:57:15 +00:00
Chris Lattner
b7af4caaf8 - Fix LLI so that it simulates the endianness of the target machine
correctly, despite the fact that the host machine might not be the same.

llvm-svn: 4180
2002-10-15 20:34:05 +00:00
Chris Lattner
bdbc272229 * Implement the getc() function
* Support usage of stdin, stdout & stderr correctly in LLI!

llvm-svn: 4022
2002-10-02 21:12:13 +00:00
Chris Lattner
f6b465732c Cleanup #includes, expose module
llvm-svn: 4021
2002-10-02 21:11:16 +00:00
Chris Lattner
68960ff1c7 Expose TD to ExternalFunctions.cpp
llvm-svn: 4020
2002-10-02 21:10:48 +00:00
Chris Lattner
7de3aaa26f * Fix a bug that was causing lli to misrun:
test/Regression/Transforms/DecomposeMultiDimRefs/mixedindices.c
* Eliminate unneccesary #include

llvm-svn: 3712
2002-09-13 23:30:42 +00:00
Chris Lattner
c96a7a51bf Another portability patch graciously provided by Casey Carter
llvm-svn: 3698
2002-09-13 14:41:38 +00:00
Chris Lattner
cb973bf5ee - Change getelementptr instruction to use long indexes instead of uint
indexes for sequential types.

llvm-svn: 3683
2002-09-11 01:21:35 +00:00
Chris Lattner
3ce5b343c5 - Renamed Type::isIntegral() to Type::isInteger()
- Added new method Type::isIntegral() that is the same as isInteger, but
    also accepts bool.

llvm-svn: 3574
2002-09-03 01:08:28 +00:00
Chris Lattner
236778fa0f Implement ConstantPointerRef support, & ConstantExpr support for Cast, GEP & Add.
llvm-svn: 3516
2002-08-27 22:33:45 +00:00
Chris Lattner
20b85d96e4 Eliminated the MemAccessInst class, folding contents into GEP class.
llvm-svn: 3487
2002-08-22 23:37:20 +00:00
Chris Lattner
969c616d51 Load & StoreInst no longer derive from MemAccessInst, so we don't have
to handle indexing anymore

llvm-svn: 3485
2002-08-22 22:49:05 +00:00
Chris Lattner
c8183d92e3 Remove support for NOT instruction
llvm-svn: 3313
2002-08-14 17:45:39 +00:00
Chris Lattner
3d013e4c40 Minor change to make lli print out characters numerically as well as symbolically
llvm-svn: 3303
2002-08-13 20:45:11 +00:00
Chris Lattner
5f2b5e70e0 Fix problem where lli would not print out a 64 bit value when the client code
uses the modifier "%ld".  Now lli passes off "%lld" to the underlying runtime
library in this case.

llvm-svn: 3230
2002-08-02 23:08:32 +00:00
Chris Lattner
64e62f9a50 Fix one real nasty bug
llvm-svn: 3227
2002-08-02 22:06:04 +00:00
Chris Lattner
f4d892dffb Fix gcc 3.1 complaint
llvm-svn: 3091
2002-07-25 17:37:05 +00:00
Chris Lattner
99ad379582 *** empty log message ***
llvm-svn: 2985
2002-07-22 02:10:13 +00:00
Chris Lattner
128410dd4c Implementing shift left & shift right on pointers
llvm-svn: 2844
2002-07-09 18:42:36 +00:00
Chris Lattner
d7cbd7d5d2 MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt

llvm-svn: 2778
2002-06-25 16:13:21 +00:00
Chris Lattner
7d07dffa5f Remove explicit support for tracing code. It should be linked into the
executable just like everything else.

llvm-svn: 2674
2002-05-20 21:17:16 +00:00
Vikram S. Adve
02f9033264 Added external functions for hashing pointers to sequence numbers.
llvm-svn: 2659
2002-05-19 15:59:25 +00:00
Chris Lattner
9e1c79995e Updates to move some header files out of include/llvm/Transforms into
the Scalar and Utils subdirectories

llvm-svn: 2523
2002-05-07 18:36:35 +00:00
Chris Lattner
8898eec72c Change usage of isPointerType to use isa
llvm-svn: 2487
2002-05-06 16:15:49 +00:00
Chris Lattner
beb2a36b9e Implement the NOT operator.
llvm-svn: 2455
2002-05-03 19:52:30 +00:00
Chris Lattner
dff0195064 Implement cast operations on booleans to allow casting bools to ints, f.e.
llvm-svn: 2437
2002-05-02 19:28:45 +00:00
Chris Lattner
05a37c1dae Fix #include broken by iMemory.h not including DerivedTypes.h
llvm-svn: 2407
2002-04-29 18:56:45 +00:00
Chris Lattner
9e194d76a1 FIXME removed: malloc/alloca ALWAYS have a size argument
llvm-svn: 2389
2002-04-28 21:57:33 +00:00
Chris Lattner
321a8cf4ba Split ConstantVals.h into Constant.h and Constants.h
llvm-svn: 2378
2002-04-28 19:55:58 +00:00
Chris Lattner
a903875f0f Eliminate use of SymTabValue class
llvm-svn: 2357
2002-04-28 04:55:14 +00:00