Commit Graph

85 Commits

Author SHA1 Message Date
Chris Lattner
6b8408e910 Add another helper method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29147 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-14 22:19:18 +00:00
Chris Lattner
79ce587cda Add a new method for bugpoint to use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29142 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-14 19:37:01 +00:00
Reid Spencer
461bed2b75 Provide a simpler interface for getting a ConstantArray from a character
string. Instead of specifying the length, just specify whether the user
wants a terminating null or not. The default is "true" to retain the same
behavior as previously provided by this function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28562 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 18:15:07 +00:00
Reid Spencer
efcaa42c28 Properly document the second form of ConstArray::get()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28553 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 08:26:13 +00:00
Reid Spencer
8949477ae4 Adjust the interface to ConstantArray::get. The previous
implementation always added a null byte to the end of the string. It turns
out that this is not always wanted. By adding a length parameter we preserve
this behavior when length==0 (default value) but also allow other lengths
(not null terminated) to be created.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28552 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 08:23:18 +00:00
Reid Spencer
19b7e0e0ca 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28453 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 19:21:13 +00:00
Chris Lattner
9fc18d24ae Add a new shufflevector instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27507 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-08 01:15:18 +00:00
Chris Lattner
ab0e04c2f2 add a new Type::getIntegralTypeMask() method, which is useful for clients that
want to do bitwise inspection of integer types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26032 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-07 06:17:10 +00:00
Robert Bocchino
f999344fa7 Instruction and constant expression definitions for the insertelement
operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25402 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-17 20:05:59 +00:00
Robert Bocchino
49b78a5696 Added an instruction and constant expression for the extractelement
operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25176 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-10 19:04:13 +00:00
Chris Lattner
40cdedecf5 Change the signature of replaceUsesOfWithOnConstant to take a Use* and not
take the bool.  The bool is always true dynamically.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23625 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 18:12:13 +00:00
Chris Lattner
225e8dd2f5 Split SimpleConstantVal up into its components, so each Constant subclass gets
a different enum value.  This allows 'classof' for these to be really simple,
not needing to call getType() anymore.

This speeds up isa/dyncast/etc for constants, and also makes them smaller.
For example, the text section of a release build of InstCombine.cpp shrinks
from 230037 bytes to 216363 bytes, a 6% reduction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23466 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 06:08:32 +00:00
Chris Lattner
a58ef7b652 Add long-overdue helpers for getting constants with known upper bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23426 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-24 22:57:28 +00:00
Jim Laskey
3a1eff732b Move code dependency for MathExtras.h out of Constants.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22840 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 20:06:22 +00:00
Jim Laskey
cb6682fa44 Culling out use of unions for converting FP to bits and vice versa.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22838 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-17 19:34:49 +00:00
Misha Brukman
9769ab2226 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21408 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 20:19:05 +00:00
Alkis Evlogimenos
1cecd3a1d2 Add new function getPtrPtrFromArrayPtr().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20684 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-19 11:40:31 +00:00
Chris Lattner
eecfea4da6 Eliminate the explicit opcode field in ConstantExpr, using the SubclassData
field to hold it instead.  This shrinks memory usage for 176.gcc from
57628728 to 57598144 bytes, a small reduction of about 30K.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20047 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-05 02:00:12 +00:00
Chris Lattner
5181ac8081 Adjust to changes in the User class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19888 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:33:00 +00:00
Chris Lattner
fcdd82e4a9 Change this method to return ulong, not uint, for 64-bit targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18906 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 19:48:51 +00:00
Alkis Evlogimenos
57ebabe9dc Use getOperand() and remove getElementAt() function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18612 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-08 03:45:20 +00:00
Alkis Evlogimenos
43962b5c63 Add accessors for Constants in a ConstantStruct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18550 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-05 20:09:18 +00:00
Misha Brukman
cf1160b012 Fix grammar in comments to getSizeOf()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17200 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-24 03:18:30 +00:00
Alkis Evlogimenos
7be2a12065 Improve comments and wrap to 80 columns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17198 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-24 03:01:32 +00:00
Alkis Evlogimenos
60ab140298 Add ConstantExpr::getSizeOf(Type*).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17196 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-24 01:41:10 +00:00
Chris Lattner
e1e922e090 Add new UndefValue class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17035 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-16 18:05:25 +00:00
Chris Lattner
86e100bd9b Update doco, make doxygen more, use standard dividers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16948 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-13 04:44:53 +00:00
Chris Lattner
7fa6e666ec Allow creation of GEP constantexprs with a vector of value* operands as
well as a vector of constant*'s.  It turns out that this is more efficient
and all of the clients want to do that, so we should cater to them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16923 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-11 22:52:25 +00:00
Reid Spencer
551ccae044 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/.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-01 22:55:40 +00:00
Brian Gaeke
715c90ba52 Packed types, brought to you by Brad Jones
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15938 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-20 06:00:58 +00:00
Chris Lattner
ff4c183790 Move method out of line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15497 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 18:49:52 +00:00
Alkis Evlogimenos
3e0ef89279 Remove uneeded getValues() functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15488 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 08:47:21 +00:00
Chris Lattner
0f42ba6777 Add a special version of getType for ConstantPointerNull, exposing the fact
that all Null pointers have pointer type


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15458 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 02:42:17 +00:00
Misha Brukman
049c48f1ad Convert tabs to spaces; fix name of function in assert() description.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15009 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 21:11:45 +00:00
Chris Lattner
52eb13c58e inline classof implementations, eliminate use of virtual methods.
classof<ConstantXXX> is now MUCH faster than it used to be.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14986 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 00:58:47 +00:00
Reid Spencer
355b0d88cb ****** ABOLISH ConstantPointerRef *****
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14919 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 23:26:57 +00:00
Chris Lattner
c78631f0e2 Add a helper method. The StructType element is completely redundant in most
cases


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14777 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-12 20:36:08 +00:00
Chris Lattner
c2dfb8bb90 Make ConstantBool act like a 1 bit ConstantInt, in order to simplify client
code.  Patch contributed by Vladimir Prus.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14280 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 12:12:12 +00:00
Chris Lattner
02140b025d Add some helpers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13737 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-25 05:32:13 +00:00
Chris Lattner
d144f42a5a Add ConstantExpr::get(Sign|Zero)Extend methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12648 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-04 23:20:30 +00:00
Chris Lattner
4dcb5401e4 Add a bunch of methods that should have been added a long time ago.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12526 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-29 02:37:53 +00:00
Chris Lattner
46a57d8f14 Add support for select constant exprs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12309 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-12 05:50:39 +00:00
Chris Lattner
40bbeb5d07 Add a new ConstantAggregateZero class, to fix PR239. This makes zero
initializers for constant structs and arrays take constant space, instead of
space proportinal to the number of elements.  This reduces the memory usage of
the LLVM compiler by hundreds of megabytes when compiling some nasty SPEC95
benchmarks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11470 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-15 05:53:04 +00:00
Chris Lattner
ca705fa31d ConstantArray::get and ConstantStruct::get now just return pointers to
'Constant', instead of specific subclass pointers.  In the future, these will
return an instance of ConstantAggregateZero if all of the inputs are zeros.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11467 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-15 04:14:47 +00:00
Chris Lattner
c07cd132cb Correct the method I just added to actually return false sometimes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11069 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 18:53:04 +00:00
Chris Lattner
f0fd6845ee Add a new method to ConstantFP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11068 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 18:40:29 +00:00
Chris Lattner
cf2c4f8ae5 The first half of a fix for PR218 & test/Regression/Assembler/2004-02-01-NegativeZero.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11063 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 22:48:09 +00:00
Chris Lattner
9b0a5ee5bb Add new ConstantArray::isString(), as the conditions for using getString()
are complex enough to check that it should be a seperate method.

While I'm here, improve ConstantArray::getNullValue a bit, though the
FIXME is still quite valid.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10850 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 17:06:21 +00:00
Chris Lattner
7e208904ae The getShift method is no obsolete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10797 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:37:26 +00:00
Chris Lattner
48babfa60d The ConstantPointer class is now gone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10057 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-17 19:47:21 +00:00