summaryrefslogtreecommitdiff
path: root/include/llvm/Type.h
Commit message (Collapse)AuthorAge
* Teach Type::getPointerAddressSpace to look through pointer vectorsChandler Carruth2012-11-01
| | | | | | | | | | politely and document this feature. This simple API extension then allows us to write all of the Instructions' address space query methods much more simply. No functionality change intended here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167223 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a helper for telling whether a type is a pointer or vector of pointer type.Duncan Sands2012-10-30
| | | | | | | | Simplify the implementation of the corresponding integer and float functions and move them inline while there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167014 91177308-0d34-0410-b5e6-96231b3b80d8
* Back out r166591, not sure why this made it through since I cancelled the ↵Micah Villmow2012-10-24
| | | | | | command. Bleh, sorry about this! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166596 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete a directory that wasn't supposed to be checked in yet.Micah Villmow2012-10-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166591 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary classof()'sSean Silva2012-10-11
| | | | | | | isa<> et al. automatically infer when the cast is an upcast (including a self-cast), so these are no longer necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165767 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetData to DataLayout.Micah Villmow2012-10-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165402 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. ↵Sylvestre Ledru2012-09-27
| | | | | | See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164768 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo 'iff' => 'if'Sylvestre Ledru2012-09-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164767 91177308-0d34-0410-b5e6-96231b3b80d8
* add StructType helpers too.Chris Lattner2012-01-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149000 91177308-0d34-0410-b5e6-96231b3b80d8
* Ok, break down and add some cast<>'ing helper methods to the Type classChris Lattner2012-01-26
| | | | | | | | | | | | | to reduce the number of cast<>'s we have. This allows someone to use things like Ty->getVectorNumElements() instead of cast<VectorType>(Ty)->getNumElements() when you know that a type is a vector. It would be a great general cleanup to move the codebase to use these, I will do so in the code I'm touching. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148999 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the Type::getNumElements() method, which is only called in 4 places,Chris Lattner2012-01-25
| | | | | | | | did something extremely surprising, and shadowed actually useful implementations that had completely different behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148898 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR11652: assertion failures when Type.cpp is compiled with -OsStepan Dyatkovskiy2012-01-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147470 91177308-0d34-0410-b5e6-96231b3b80d8
* Type: replaced usage of ID with getTypeID().Stepan Dyatkovskiy2012-01-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147446 91177308-0d34-0410-b5e6-96231b3b80d8
* fix typoChris Lattner2011-12-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147159 91177308-0d34-0410-b5e6-96231b3b80d8
* The powers that be have decided that LLVM IR should now support 16-bitDan Gohman2011-12-17
| | | | | | | | | "half precision" floating-point with a first-class type. This patch adds basic IR support (but not codegen support). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146786 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for vectors of pointers.Nadav Rotem2011-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145801 91177308-0d34-0410-b5e6-96231b3b80d8
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the DerivedType which isn't adding value anymore.Chris Lattner2011-07-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134832 91177308-0d34-0410-b5e6-96231b3b80d8
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch brings numerous advantages to LLVM. One way to look at it is through diffstat: 109 files changed, 3005 insertions(+), 5906 deletions(-) Removing almost 3K lines of code is a good thing. Other advantages include: 1. Value::getType() is a simple load that can be CSE'd, not a mutating union-find operation. 2. Types a uniqued and never move once created, defining away PATypeHolder. 3. Structs can be "named" now, and their name is part of the identity that uniques them. This means that the compiler doesn't merge them structurally which makes the IR much less confusing. 4. Now that there is no way to get a cycle in a type graph without a named struct type, "upreferences" go away. 5. Type refinement is completely gone, which should make LTO much MUCH faster in some common cases with C++ code. 6. Types are now generally immutable, so we can use "Type *" instead "const Type *" everywhere. Downsides of this patch are that it removes some functions from the C API, so people using those will have to upgrade to (not yet added) new API. "LLVM 3.0" is the right time to do this. There are still some cleanups pending after this, this patch is large enough as-is. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
* now that Type::getDescription() is dead, the TypePrinting class can move ↵Chris Lattner2011-06-18
| | | | | | | | | from Assembly/Writer.h to being a private class in AsmWriter.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133361 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the Type::getDescription() method, using "<<" instead. This Chris Lattner2011-06-18
| | | | | | | removes some gunk from LLVMContext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133360 91177308-0d34-0410-b5e6-96231b3b80d8
* improve some comments.Chris Lattner2011-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133359 91177308-0d34-0410-b5e6-96231b3b80d8
* forward declare GraphTraits in Type.h instead of #includ'ing it.Chris Lattner2011-06-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133201 91177308-0d34-0410-b5e6-96231b3b80d8
* remove Type::getVAArgsPromotedType, which is dead, and tidy up a bit.Chris Lattner2011-06-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133190 91177308-0d34-0410-b5e6-96231b3b80d8
* Make codegen able to handle values of empty types. This is one wayRafael Espindola2011-05-13
| | | | | | to fix PR9900. I will keep it open until sable is able to comment on it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131294 91177308-0d34-0410-b5e6-96231b3b80d8
* Add x86MMX a few more places.Dale Johannesen2010-09-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113914 91177308-0d34-0410-b5e6-96231b3b80d8
* Prune includes.Benjamin Kramer2010-09-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113850 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment typo.Dale Johannesen2010-09-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113728 91177308-0d34-0410-b5e6-96231b3b80d8
* Add X86 MMX type to bitcode and Type.Dale Johannesen2010-09-10
| | | | | | | | | (The Ada bindings probably need it too, but all the obvious places to change say "do not edit this file".) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113618 91177308-0d34-0410-b5e6-96231b3b80d8
* remove unions from LLVM IR. They are severely buggy and notChris Lattner2010-08-28
| | | | | | | being actively maintained, improved, or extended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112356 91177308-0d34-0410-b5e6-96231b3b80d8
* give PATypeHolder an explicit copy ctor which initializes the type pointer,Chris Lattner2010-06-29
| | | | | | | | | | | | | | and make PATypeHolder work with null pointers. The implicitly generated one didn't work on numerous levels, but was still accepted, allowing all sorts of bugs with default constructed pa type holders. Previously, they "sort of" worked if they were default constructed and then destructed. Now they really work, and you can even default construct one, then assign to it, amazing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107195 91177308-0d34-0410-b5e6-96231b3b80d8
* VMCore: Add Type::getIntN[Ptr]Ty, which are the obvious generic forms ofDaniel Dunbar2010-04-13
| | | | | | | Type::getInt{1,8,...}[Ptr]Ty, so code can consistently use the methods on Type without occasionally needed to call IntegerType::get. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101111 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch isa_impl from a function template to a class template with aDouglas Gregor2010-03-30
| | | | | | | | static inline member function doit(). This enables the use of partial specialization to override the last stage of the "isa" check. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99898 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct LastPrimitiveTyID: MetadataType is a primitive type.Duncan Sands2010-02-19
| | | | | | | This change probably has no functional effect. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96669 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move someDuncan Sands2010-02-16
| | | | | | | methods to try to have the type predicates be more logically positioned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96349 91177308-0d34-0410-b5e6-96231b3b80d8
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-16
| | | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-15
| | | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96223 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for a union type in LLVM IR. Patch by Talin!Chris Lattner2010-02-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96011 91177308-0d34-0410-b5e6-96231b3b80d8
* Flesh out the list of predicates, for those who like this style. I wasDuncan Sands2010-02-08
| | | | | | | looking for isPointer, and added the rest for uniformity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95557 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new predicate for integer type equality tests.Benjamin Kramer2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92759 91177308-0d34-0410-b5e6-96231b3b80d8
* fix unit test that I broke.Chris Lattner2009-12-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91877 91177308-0d34-0410-b5e6-96231b3b80d8
* types don't need atomic inc/dec, they are local to an llvmcontext.Chris Lattner2009-12-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91873 91177308-0d34-0410-b5e6-96231b3b80d8
* Type.h doesn't need to #include LLVMContext.hChris Lattner2009-10-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85254 91177308-0d34-0410-b5e6-96231b3b80d8
* Move DataTypes.h to include/llvm/System, update all users. This breaks the lastChandler Carruth2009-10-26
| | | | | | | direct inclusion edge from System to Support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85086 91177308-0d34-0410-b5e6-96231b3b80d8
* Make getPointerTo return a const PointerType* rather thanDuncan Sands2009-10-07
| | | | | | | an unqualified PointerType* because it seems more correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83454 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce and use convenience methods for getting pointer typesDuncan Sands2009-10-06
| | | | | | | | where the element is of a basic builtin type. For example, to get an i8* use getInt8PtrTy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83379 91177308-0d34-0410-b5e6-96231b3b80d8
* add more type predicates.Chris Lattner2009-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83296 91177308-0d34-0410-b5e6-96231b3b80d8
* add some helper functions.Chris Lattner2009-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83293 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the minor mess I caused with removing iterator.h. I shall take care ↵Gabor Greif2009-08-27
| | | | | | of 80-col violations and the FIXME later. (Thanks goodness that I live in another continent, so the monkeypox did not strike me :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80224 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the std::ostream version of module and type printing.Chris Lattner2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79823 91177308-0d34-0410-b5e6-96231b3b80d8