aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/TargetData.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Simplify getIntPtrType, allowing it to work for arbitrary pointer sizes.Dan Gohman2007-10-081-6/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42751 91177308-0d34-0410-b5e6-96231b3b80d8
* Add getABITypeSize, getABITypeSizeInBitsDale Johannesen2007-10-011-1/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42488 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't add a default STACK_ALIGN (use the generic ABI alignment)Rafael Espindola2007-09-211-1/+0
| | | | | | | Implement calls to functions with byval arguments on X86 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42192 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge DenseMapKeyInfo & DenseMapValueInfo into DenseMapInfoChris Lattner2007-09-171-2/+6
| | | | | | | | Add a new DenseMapInfo::isEqual method to allow clients to redefine the equality predicate used when probing the hash table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42042 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for having different alignment for objects on call frames.Rafael Espindola2007-09-071-5/+20
| | | | | | | | The x86-64 ABI states that objects passed on the stack have 8 byte alignment. Implement that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41768 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix minor doxygen nits.Reid Spencer2007-08-051-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40854 91177308-0d34-0410-b5e6-96231b3b80d8
* long double patch 2 of N. Handle it in TargetData.Dale Johannesen2007-08-031-0/+12
| | | | | | | | (I've tried to get the info right for all targets, but I'm not expert on all of them - check yours.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40792 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop 'const'Devang Patel2007-05-031-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-021-1/+1
| | | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix build error.Lauro Ramos Venancio2007-05-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36648 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-011-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
* Support alignment queries for degenerate (length 1) vectors.Christopher Lamb2007-04-221-2/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36352 91177308-0d34-0410-b5e6-96231b3b80d8
* When the number of elements is zero, don't malloc 32GB on 64-bit systems.Jeff Cohen2007-04-091-1/+1
| | | | | | | | | | | Fixes unexpected failures on FreeBSD/amd64 of: CFrontend/2005-09-24-BitFieldCrash.c: CFrontend/2007-02-04-EmptyStruct.c: CFrontend/2007-03-26-ZeroWidthBitfield.c: CodeGen/Generic/2005-10-18-ZeroSizeStackObject.ll: git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35828 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak VC++ build.Jeff Cohen2007-03-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34917 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap a long line.Reid Spencer2007-03-011-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34799 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify some code by moving variable declarations into the only block thatReid Spencer2007-02-191-12/+6
| | | | | | | uses them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34432 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement support for non-standard integer bit widths of any size. TheReid Spencer2007-02-191-10/+33
| | | | | | | | | | | | | | rules alignment is to pick the alignment that corresponds to the smallest specified alignment that is larger than the bit width of the type or the largest specified integer alignment if none are larger than the bitwidth of the type. For the byte size, the size returned is the next larger multiple of the alignment for that type (using the above rule). This patch also changes bit widths from "short" to "uint32_t" to ensure there are enough bits to specify any bit width that LLVM can handle (currently 2^23); 16-bits isn't enough. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34431 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not dereference invalid ranges. Generalize targetdata alignment model.Chris Lattner2007-02-171-59/+49
| | | | | | | This fixes the UnitTests/Vector/sumarray-dbl regressions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34358 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix CodeGen/PowerPC/2007-02-16-AlignPacked.llChris Lattner2007-02-161-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34356 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unnecessary predicate.Reid Spencer2007-02-161-1/+1
| | | | | | | Patch by Scott Michel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34354 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify some code, ensure that packed structures get abi alignment of 1.Chris Lattner2007-02-161-18/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34352 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1195:Reid Spencer2007-02-151-4/+4
| | | | | | | PACKED_ALIGN -> VECTOR_ALIGN git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34330 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1202:Reid Spencer2007-02-151-1/+2
| | | | | | | Make sure we found an existing Alignment before overwriting it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34308 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1195:Reid Spencer2007-02-151-3/+3
| | | | | | | | Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34293 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed packed structure breakage from earlier TargetData patch; appliedReid Spencer2007-02-151-75/+31
| | | | | | | | | Chris Lattner's code style suggestions. Patch by Scott Michel! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34292 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize TargetData strings, to support more interesting forms of data.Chris Lattner2007-02-141-214/+307
| | | | | | | Patch by Scott Michel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34266 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch LayoutInfo to be a DenseMap instead of an std::map. This speeds upChris Lattner2007-02-101-13/+31
| | | | | | | -load-vn -gcse by 2.3%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34160 91177308-0d34-0410-b5e6-96231b3b80d8
* add a typedefChris Lattner2007-02-101-9/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34159 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the std::vector from StructLayout, allocating the elements immediatelyChris Lattner2007-02-101-43/+57
| | | | | | | | after the StructLayout object in memory. This marginally improves locality, speeding up -load-vn -gcse by ~0.8%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34158 91177308-0d34-0410-b5e6-96231b3b80d8
* encapsulate the rest of the StructLayout members.Chris Lattner2007-02-101-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34157 91177308-0d34-0410-b5e6-96231b3b80d8
* Privatize StructLayout::MemberOffsets, adding an accessorChris Lattner2007-02-101-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34156 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ManagedStatic to manage LayoutInfo, instead of rolling our own.Chris Lattner2007-02-101-27/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34154 91177308-0d34-0410-b5e6-96231b3b80d8
* Change TargetData::getIndexedOffset interface to not require indicesChris Lattner2007-02-101-8/+8
| | | | | | | in a vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34153 91177308-0d34-0410-b5e6-96231b3b80d8
* Although targets are not required to support integers > 64bits, TargetDataReid Spencer2007-02-051-2/+4
| | | | | | | | | | | | must in order for backends that do want to support large integer types to be able to function. Consequently, don't assert if the bitwidth > 64 bits when computing the size and alignment. Instead, compute the size by rounding up to the next even number of bytes for the size. Compute the alignment as the same as the LongABIAlignment. These provide reasonable defaults that the target can override. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33943 91177308-0d34-0410-b5e6-96231b3b80d8
* Dead comment.Evan Cheng2007-01-311-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33719 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR761:Reid Spencer2007-01-261-21/+3
| | | | | | | | The Module::setEndianness and Module::setPointerSize methods have been removed. Instead you can get/set the DataLayout. Adjust thise accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33530 91177308-0d34-0410-b5e6-96231b3b80d8
* Renamed getTypeAlignmentShift() to getPreferredTypeAlignmentShift().Evan Cheng2007-01-241-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33482 91177308-0d34-0410-b5e6-96231b3b80d8
* - getTypeAlignmentShift() should be returning preferred alignment, not ABIEvan Cheng2007-01-221-3/+1
| | | | | | | | alignment. - getPreferredAlignmentLog(): remove Double special case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33445 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a getTypeSizeInBits method. This helps in transforms that wantReid Spencer2007-01-201-0/+10
| | | | | | | to ensure the bit size of a type is identical before proceeding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33413 91177308-0d34-0410-b5e6-96231b3b80d8
* TargetData assumes (and some regression tests depend on it) that the size ofOwen Anderson2007-01-201-4/+11
| | | | | | | an unspecified datatype in the datalayout is capped by the size of a pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33411 91177308-0d34-0410-b5e6-96231b3b80d8
* trivial cleanupChris Lattner2007-01-201-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33410 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach TargetData to handle 'preferred' alignment for each target, and useChris Lattner2007-01-201-57/+186
| | | | | | | these alignment amounts to align scalars when we can. Patch by Scott Michel! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33409 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1064:Reid Spencer2007-01-121-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename BoolTy as Int1Ty. Patch by Sheng Zhou.Reid Spencer2007-01-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR950:Reid Spencer2006-12-311-12/+8
| | | | | | | | | | | | | | | | | | | Three changes: 1. Convert signed integer types to signless versions. 2. Implement the @sext and @zext parameter attributes. Previously the type of an function parameter was used to determine whether it should be sign extended or zero extended before the call. This information is now communicated via the function type's parameter attributes. 3. The interface to LowerCallTo had to be changed in order to accommodate the parameter attribute information. Although it would have been convenient to pass in the FunctionType itself, there isn't always one present in the caller. Consequently, a signedness indication for the result type and for each parameter was provided for in the interface to this method. All implementations were changed to make the adjustment necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32788 91177308-0d34-0410-b5e6-96231b3b80d8
* Packed StructuresAndrew Lenharth2006-12-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32361 91177308-0d34-0410-b5e6-96231b3b80d8
* Move getPreferredAlignmentLog from AsmPrinter to TargetDataDevang Patel2006-10-241-0/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31171 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR950:Reid Spencer2006-10-201-2/+2
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't pass target name into TargetData anymore, it is never used or needed.Chris Lattner2006-06-161-1/+1
| | | | | | | | Remove explicit casts to std::string now that there is no overload resolution issues in the TargetData ctors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28830 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove ctor with each piece specifyable (which causes overload ambiguities),Chris Lattner2006-06-161-32/+1
| | | | | | | add a new init method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28828 91177308-0d34-0410-b5e6-96231b3b80d8