summaryrefslogtreecommitdiff
path: root/include/llvm/Type.h
Commit message (Collapse)AuthorAge
* 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
* Actually privatize a IntegerTypes, and fix a few bugs exposed by this.Owen Anderson2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78955 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an LLVMContext to Type, hardwired to the global context until Type ↵Owen Anderson2009-07-15
| | | | | | uniquing is moved on the contexts themselves. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75853 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the C bindings to keep the LLVMTypeKind up to date between the C/C++Chris Lattner2009-07-15
| | | | | | | stuff. Patch by Zoltan Varga! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75842 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo that Edwin spotted.Dan Gohman2009-07-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75661 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a comment clarifying the role of getPrimitiveTypeSizeInBits.Dan Gohman2009-07-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75659 91177308-0d34-0410-b5e6-96231b3b80d8
* There are five floating point types.Nick Lewycky2009-07-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74806 91177308-0d34-0410-b5e6-96231b3b80d8
* There are *four* lights!Nick Lewycky2009-07-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74804 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert my last series of commits related to Timer and 64-bit atomics. Not ↵Owen Anderson2009-06-23
| | | | | | | | | all the targets we care about are capable of supporting it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73993 91177308-0d34-0410-b5e6-96231b3b80d8
* Atomic ops that do arithmetic use signed arithmetic.Owen Anderson2009-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73980 91177308-0d34-0410-b5e6-96231b3b80d8
* Label the existing atomic functions as 32-bit specific, and add a 64-bit one ↵Owen Anderson2009-06-23
| | | | | | | | | that will be useful in the near future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73971 91177308-0d34-0410-b5e6-96231b3b80d8
* Use atomic increment/decrement for reference counting of Type's.Owen Anderson2009-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73588 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an atomic increment and decrement implementation, which will be used forOwen Anderson2009-06-17
| | | | | | | thread-safe reference counting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73587 91177308-0d34-0410-b5e6-96231b3b80d8
* Support vector casts in more places, fixing a variety of assertionDan Gohman2009-06-15
| | | | | | | | | | | | | | | | failures. To support this, add some utility functions to Type to help support vector/scalar-independent code. Change ConstantInt::get and ConstantFP::get to support vector types, and add an overload to ConstantInt::get that uses a static IntegerType type, for convenience. Introduce a new getConstant method for ScalarEvolution, to simplify common use cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73431 91177308-0d34-0410-b5e6-96231b3b80d8
* Create FunctionType::isValidArgumentType to go along with isValidReturnType.Nick Lewycky2009-06-07
| | | | | | | | | | | | | | | | Also create isValidElementType for ArrayType, PointerType, StructType and VectorType. Make LLParser use them. This closes up some holes like an assertion failure on: %x = type {label} but largely doesn't change any semantics. The only thing we accept now which we didn't before is vectors of opaque type such as "<4 x opaque>". The opaque can be resolved to an int or float when linking. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73016 91177308-0d34-0410-b5e6-96231b3b80d8
* Give embedded metadata its own type instead of relying on EmptyStructTy.Nick Lewycky2009-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72610 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new Type::getPointerTo method, which is shorthand forChris Lattner2009-04-10
| | | | | | | llvm::PointerType::get(). Patch by Anders Johnsen! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68772 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for embedded metadata to LLVM. This introduces two new types ofNick Lewycky2009-04-04
| | | | | | | | | Constant, MDString and MDNode which can only be used by globals with a name that starts with "llvm." or as arguments to a function with the same naming restriction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68420 91177308-0d34-0410-b5e6-96231b3b80d8
* delete a bunch of duplicated type printing logic, using the type printingChris Lattner2009-02-28
| | | | | | | stuff in AsmWriter.cpp for Type::getDescription(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65734 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new form of Type::dump that takes a module for type names,Chris Lattner2008-10-01
| | | | | | | | | patch provided by Tomas Lindquist Olsen! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56929 91177308-0d34-0410-b5e6-96231b3b80d8
* remove dead method.Chris Lattner2008-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55266 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the asmprinter (.ll) and all the stuff it requires over toChris Lattner2008-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | use raw_ostream instead of std::ostream. Among other goodness, this speeds up llvm-dis of kc++ with a release build from 0.85s to 0.49s (88% faster). Other interesting changes: 1) This makes Value::print be non-virtual. 2) AP[S]Int and ConstantRange can no longer print to ostream directly, use raw_ostream instead. 3) This fixes a bug in raw_os_ostream where it didn't flush itself when destroyed. 4) This adds a new SDNode::print method, instead of only allowing "dump". A lot of APIs have both std::ostream and raw_ostream versions, it would be useful to go through and systematically anihilate the std::ostream versions. This passes dejagnu, but there may be minor fallout, plz let me know if so and I'll fix it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55263 91177308-0d34-0410-b5e6-96231b3b80d8
* Inline the fastpath of PATypeHolder::get(). This is a small speedup in Chris Lattner2008-08-15
| | | | | | | instcombine among other things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54814 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an isAggregateType predicate.Dan Gohman2008-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51794 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1338: rename include/llvm/ADT/ilist and friends to end with ".h"Anton Korobeynikov2008-05-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51687 91177308-0d34-0410-b5e6-96231b3b80d8
* It turns out there are only 3 non-first-class type kinds left now, soDan Gohman2008-05-23
| | | | | | | it's simpler for isFirstClassType to use a negative test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51511 91177308-0d34-0410-b5e6-96231b3b80d8
* Make structs and arrays first-class types, and add assemblyDan Gohman2008-05-23
| | | | | | | | | | and bitcode support for the extractvalue and insertvalue instructions and constant expressions. Note that this does not yet include CodeGen support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51468 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a Type::isSingleValueType method. This will be used by codeDan Gohman2008-05-21
| | | | | | | | | | that currently uses Type::isFirstClassType and depends on it returning false for struct or array types. This commit doesn't change the behavior of Type::isFirstClassType. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51396 91177308-0d34-0410-b5e6-96231b3b80d8
* add a helper method.Chris Lattner2008-05-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51274 91177308-0d34-0410-b5e6-96231b3b80d8