Commit Graph

126 Commits

Author SHA1 Message Date
Alkis Evlogimenos
4283d49e06 Add method to return the type this type will be promoted to if it is
passed through a variable argument function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21462 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 00:11:21 +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
Chris Lattner
82870e0b73 Fix problems compiling with G++ 4.x.x with -pedantic. Thanks to
Vladimir Merzliakov for the patch!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20513 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-07 20:35:45 +00:00
Chris Lattner
e4666594d0 Now that type does not derive from Value, these do not need to be virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20393 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-02 03:43:55 +00:00
Chris Lattner
f8db8a0432 Fix spelling, patch contributed by Gabor Greif
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20342 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-27 06:15:51 +00:00
Misha Brukman
bcb18fa612 primitive' has no a'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19808 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 16:28:03 +00:00
Chris Lattner
49266b2afa Do not return true from isSized for things without a size (like functions and
labels) even though they are concrete.  This fixes the DSA regressions from
last night.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19807 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 16:00:52 +00:00
Chris Lattner
d23a298f28 This giant patch speeds up Type::isSized(). Before, this would have to search
large nested types over and over again to determine if they are sized or not.
Now, isSized() is able to make snap decisions about all concrete types, which
are a common occurance (and includes all primitives).

On 177.mesa, this speeds up DSE from 39.5s -> 21.3s and GCSE from
13.2s -> 11.3s, reducing gccas time from 80s -> 61s (this is a debug build).

DSE and GCSE are still too slow on this testcase, but this is a simple
improvement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19800 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 02:08:34 +00:00
Reid Spencer
4251ce4b10 Added a size_type typedef to LLVM containers to make Visual Studio shut up
(and possibly to make LLVM more x86 64bit friendly).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18891 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 16:28:53 +00:00
Chris Lattner
5b2d43aad0 Add static functions to clear singleton maps. Patch contributed by
Morten Ofstad!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17994 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-19 16:39:04 +00:00
Misha Brukman
481d56c5de On second thought, OpaqueType is not really a good first-class type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16941 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-12 20:35:04 +00:00
Chris Lattner
e004fd005d Add comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16937 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-12 17:08:44 +00:00
Misha Brukman
207f2d4056 Opaque types are considered to be first-class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16936 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-12 17:06:17 +00:00
Chris Lattner
485457f562 Change signature of this method again
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16810 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-07 19:19:12 +00:00
Misha Brukman
f5d9fa7e78 Undoxyfy internal method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16774 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-06 17:19:58 +00:00
Misha Brukman
0cbd1fbb0e Doxygen-ify comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16773 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-06 16:56:16 +00:00
Chris Lattner
df00115aa4 Rename method, change comment, add argument
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16771 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-06 16:34:23 +00:00
Alkis Evlogimenos
148d2065e4 Use class instead of struct for defining classes. This unbreaks the
build on windows. Patch contributed by Paolo Invernizzi!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16531 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-28 01:59:17 +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
80d94b88e1 Final fix for PR341: eliminate operator<<(ostream, Value*). Clients should
now send references to ostreams instead of pointers.  Sending pointers to
ostreams will print their addresses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14849 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 02:54:36 +00:00
Chris Lattner
654b710527 Yeah, how about those 'primative' types huh?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14836 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 01:15:53 +00:00
Chris Lattner
ec90d8f80d Make PATypeHolder and friends return non-const pointers to the types they
hold.  Because types are basically immutable anyway, they should not be
referenced as "const Type*" everywhere.  Just "Type*" should suffice!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14824 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 20:10:26 +00:00
Chris Lattner
20d20fc77d Removed unneeded forward decl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14727 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 17:02:57 +00:00
Chris Lattner
36002e43ec Remove unused method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14726 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 16:48:13 +00:00
Chris Lattner
57cd1ff463 Eliminate the UID field in the Type class, bringing it down to 28 bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14709 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 22:31:37 +00:00
Misha Brukman
0f54f19f29 Fix spelling of `equivalent'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14697 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 17:45:18 +00:00
Chris Lattner
e1d6799661 isSigned/isUnsigned/isInteger methods do not need to be virtual
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14694 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 17:29:36 +00:00
Chris Lattner
c29af0084f Update comment.
Remove unused forward decl of Value.h
Make Type 32 bytes instead of 36 bytes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14692 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 16:09:38 +00:00
Reid Spencer
e753e3b329 Make Type have no base classes. Previously it inherited Value. Also
removed the TypeTyID and TypeTy members so that the notion of the
"Type Type" is no longer present in LLVM. Various other adjustments
resulting from these changes were also made.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14592 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 10:46:49 +00:00
Chris Lattner
c5f143b6e7 Fix Type::isSized() to realize that "{ opaque }" is not sized
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14585 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 23:20:17 +00:00
Chris Lattner
f70c22b019 Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14201 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 18:19:28 +00:00
Reid Spencer
75719bf239 Provide the correct patch for bug 345. The solution is to add a setTypeName
function to llvmAsmParser.y and then use it in the one place in the grammar
that needs it. Also had to make Type::setName public because setTypeName
needs it in order to retain compatibility with setValueName.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13795 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-26 21:48:31 +00:00
Reid Spencer
ec55b08fd0 Give Type its own dump() method in preparation for Type != Value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13746 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-25 08:46:04 +00:00
Chris Lattner
e3651f00e8 Add two methods which have been needed for a long time: Type::get(Un)signedVersion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12522 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-26 21:43:22 +00:00
Chris Lattner
fcdb2c2a7f Add two missing pieces from last checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11513 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-17 03:03:36 +00:00
Chris Lattner
3e3bcbd222 Rearrange code to eliminate warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11512 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-17 02:58:36 +00:00
Misha Brukman
5e871dadae Doxygenify comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11292 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-10 21:48:12 +00:00
Chris Lattner
f32f56862a Now that all of the derived types have disciplined interfaces, we can eliminate
all of the ad-hoc storage of contained types.  This allows getContainedType to
not be virtual, and allows us to entirely delete the TypeIterator class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11230 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-09 05:40:24 +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
Chris Lattner
9f6a519027 Tighten up what we consider to be first class types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9608 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-30 01:38:41 +00:00
John Criswell
6fbcc26f14 Added LLVM copyright header (for lack of a better term).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9304 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 20:19:47 +00:00
Chris Lattner
ba7beb084c Add operator= for type iterators to make them assignable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9083 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 15:34:17 +00:00
Chris Lattner
814f622526 Remove explicit inline qualifiers when the implicit ones work just as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9082 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 15:30:59 +00:00
Chris Lattner
342be126ef Kill warning when compiling in optimized mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8989 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-09 20:43:55 +00:00
Chris Lattner
1bc33a5227 Make getContainedType more efficient by not returning null if out of range!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8987 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-09 20:35:15 +00:00
Chris Lattner
1c5164e9cf Make the PATypeHolder use a simple union-find implementation to handle
merging of types.  This makes it MUCH more efficient than before, also
making things simpler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8833 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-02 23:35:57 +00:00
Chris Lattner
48486893f4 Standardize header file comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8782 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-30 18:37:50 +00:00
Chris Lattner
2a4a4b54ad New method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8331 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 21:54:56 +00:00
Chris Lattner
ca371048a5 Remove the "recursive bit", not only is it unused by anyone, it was also
not correctly calculated, and calculating it wrong for fun seems rather
pointless.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8329 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 21:40:33 +00:00
Chris Lattner
b44cacb647 The description is no longer stored directly in the type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8319 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 16:28:03 +00:00
Misha Brukman
ef6a6a69ff The word dependent' has no a'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8030 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 22:14:26 +00:00
Misha Brukman
f117cc9ee6 s/convertable/convertible/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6248 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-20 18:45:36 +00:00
Chris Lattner
ce8a14915d - Renamed Type::isIntegral() to Type::isInteger()
- Added new method Type::isIntegral() that is the same as isInteger, but
    also accepts bool.
SCVS: ----------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3572 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-03 01:05:48 +00:00
Chris Lattner
2619905926 Convert comments to Doxygen style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3507 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-25 22:54:55 +00:00
Chris Lattner
24e9872732 Use the Support/iterator file to abstract out compiler differences
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3063 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-24 22:07:57 +00:00
Chris Lattner
7f5e6cd751 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3053 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-24 20:44:02 +00:00
Chris Lattner
18961504fc *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2777 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:12:52 +00:00
Chris Lattner
4dedcb2670 * Add getPrimitiveSize method
* Remove isPointerType, isMethodType, etc... methods.  Use isa<> instead
* Added specialization of isa for pointer types so that DerivedTypes.h doesn't
  have to be #included to use isa<PointerType>(..)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2483 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:12:53 +00:00
Chris Lattner
12e8ad6858 * Fix comment
* Add printing support
* add isFloatingPoint method
* Remove isXXXType() methods for non-derived types


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2167 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-08 21:50:15 +00:00
Chris Lattner
6bfd6a578a s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2034 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:44:36 +00:00
Chris Lattner
697954c15d Changes to build successfully with GCC 3.02
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1503 91177308-0d34-0410-b5e6-96231b3b80d8
2002-01-20 22:54:45 +00:00
Chris Lattner
4adc20b41c Implement some nice functions useful for looking at types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1442 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-13 00:40:16 +00:00
Chris Lattner
cee8f9ae67 Create a new #include "Support/..." directory structure to move things
from "llvm/Support/..." that are not llvm dependant.

Move files and fix #includes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1400 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-27 00:03:19 +00:00
Chris Lattner
283f4e5ac4 New Method isLosslesslyConvertableTo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1330 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-26 16:47:10 +00:00
Chris Lattner
b00c582b6d Commit more code over to new cast style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@697 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-02 03:41:24 +00:00
Chris Lattner
cfe26c930a Add more support for new style casts
Convert more code to use them


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@695 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-01 18:26:53 +00:00
Chris Lattner
7295eb4ea3 Add support for newer cleaner isa, cast, dyn_cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@693 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-01 13:58:13 +00:00
Chris Lattner
3ff4387113 Pull iterators out of CFG.h and CFGdecls and put them in Support directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@664 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-28 22:56:31 +00:00
Chris Lattner
be07811cd0 * Method::getType should return type cast as MethodType, eliminate getMethodType
* Make Type::*Ty not be const types
* Add a new Type.def file to provide info about types
* Add a full complement of casting methods to the Type class


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@533 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-10 20:06:17 +00:00
Chris Lattner
74c2b7633f Rename contype to subtype
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@522 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-09 22:26:58 +00:00
Chris Lattner
78914e772f Convert ConstRules to use annotations to clean it up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@514 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-09 21:00:23 +00:00
Chris Lattner
a797d28333 * Add support for Opaque & Abstract types.
* Remove silly enum values that are never going to be used
* What used to be a types "name" is now it's "description"
* Add a new iterator to type to allow users to iterate over subtypes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@426 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-07 16:23:59 +00:00
Chris Lattner
edde66d9e0 Change is*Type to be a casting convertion operator
Add a new isIntegral virtual function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-20 19:12:34 +00:00
Chris Lattner
b9b8959091 The ConstRules class got moved to the opt namespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-30 04:35:01 +00:00
Chris Lattner
009505452b Initial revision
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-06 20:29:01 +00:00