summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetData.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change TargetData's algorithm for computing defualt vector typeDan Gohman2010-04-231-16/+11
| | | | | | | alignment to match what's used in clang and GCC for __alignof, rather than trying to guess what Legalize is going to be doing. llvm-svn: 102206
* fix PR6332, allowing an index of zero into a zero sized array Chris Lattner2010-04-171-2/+2
| | | | | | even if the element of the array has no size. llvm-svn: 101662
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-071-1/+1
| | | | llvm-svn: 100709
* Revert the recent alignment changes. They're broken for -Os because,Dan Gohman2010-04-021-1/+1
| | | | | | | in particular, they end up aligning strings at 16-byte boundaries, and there's no way for GlobalOpt to check OptForSize. llvm-svn: 100172
* Change variables which are exactly 16 bytes to be 16-byte-aligned too.Dan Gohman2010-04-021-1/+1
| | | | | | This fixes test/Transforms/GlobalOpt/gv-align.ll. llvm-svn: 100161
* reapply r98656 unmodified, which exposed the asmprinter not Chris Lattner2010-03-161-0/+25
| | | | | | handling constant unions. llvm-svn: 98680
* Revert r98656, its breaking all over the place.Daniel Dunbar2010-03-161-25/+0
| | | | llvm-svn: 98662
* improve support for uniontype and ConstantUnion, patch by Tim Northover!Chris Lattner2010-03-161-0/+25
| | | | llvm-svn: 98656
* Revert r97064. Duncan pointed out that bitcasts are defined inDan Gohman2010-02-251-42/+1
| | | | | | | | terms of store and load, which means bitcasting between scalar integer and vector has endian-specific results, which undermines this whole approach. llvm-svn: 97137
* Make getTypeSizeInBits work correctly for array types; it should returnDan Gohman2010-02-241-1/+42
| | | | | | | | | | | | | | | the number of value bits, not the number of bits of allocation for in-memory storage. Make getTypeStoreSize and getTypeAllocSize work consistently for arrays and vectors. Fix several places in CodeGen which compute offsets into in-memory vectors to use TargetData information. This fixes PR1784. llvm-svn: 97064
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-1/+1
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* add a method to get the alignment of an integer type even Chris Lattner2010-01-251-0/+7
| | | | | | | when we don't have one laying around. Useful if you don't have an llvmcontext handy. llvm-svn: 94468
* finish cleaning up StructLayoutMap.Chris Lattner2009-12-171-21/+17
| | | | llvm-svn: 91612
* Calling InvalidateEntry during the refinement was breaking the bootstrap.Bill Wendling2009-12-051-2/+12
| | | | llvm-svn: 90656
* Final cleanups:Bill Wendling2009-12-051-14/+2
| | | | | | | - Privatize a typedef. - Call the InvalidateEntry when refining a type. llvm-svn: 90655
* Inline methods which are called only once.Bill Wendling2009-12-051-15/+3
| | | | llvm-svn: 90640
* Refactor some code. No functionality change.Bill Wendling2009-12-051-9/+13
| | | | llvm-svn: 90639
* Some code cleanup. No functionality change.Bill Wendling2009-12-041-15/+10
| | | | llvm-svn: 90588
* Revert r90371. It was causing build failures.Bill Wendling2009-12-031-23/+42
| | | | llvm-svn: 90383
* Further improvements: refactoring code that does the same thing into oneBill Wendling2009-12-031-42/+23
| | | | | | | function, converting "dyn_cast" to "cast", asserting the correct things, and other general cleanups. llvm-svn: 90371
* remove some dead std::ostream using code.Chris Lattner2009-12-031-9/+0
| | | | llvm-svn: 90366
* improve portability to avoid conflicting with std::next in c++'0x.Chris Lattner2009-12-031-0/+1
| | | | | | Patch by Howard Hinnant! llvm-svn: 90365
* This initial code is meant to convert TargetData to use an AbstractTypesUser soBill Wendling2009-12-031-59/+38
| | | | | | | | | that it doesn't have dangling pointers when abstract types are resolved. This modifies it somewhat to address comments: making the "StructLayoutMap" an anonymous structure, calling "removeAbstractTypeUser" when appropriate, and adding asserts where helpful. llvm-svn: 90362
* The llvm-gcc front-end and the pass manager use two separate TargetData objects.Bill Wendling2009-11-181-24/+116
| | | | | | | | | | | | | | | | | | This is probably not confined to *just* these two things. Anyway, the llvm-gcc front-end may look up the structure layout information for an abstract type. That information will be stored into a table with the FE's TD. Instruction combine can come along and also ask for information on that abstract type, but for a separate TD (the one associated with the pass manager). After the type is refined, the old structure layout information in the pass manager's TD file is out of date. If a new type is allocated in the same space as the old-unrefined type, then the structure type information in the pass manager's TD file will be wrong, but won't know it. Fix this by making the TD's structure type information an abstract type user. llvm-svn: 89176
* Make TargetData::getStringRepresentation spit out native integer types,Chris Lattner2009-11-081-0/+7
| | | | | | this gives llvm-gcc generated modules the right data. llvm-svn: 86435
* add the ability for TargetData to return information about legal integerChris Lattner2009-11-071-39/+12
| | | | | | | | | | | datatypes on a given CPU. This is intended to allow instcombine and other transformations to avoid converting big sequences of operations to an inconvenient width, and will help clean up after SRoA. See also "Adding legal integer sizes to TargetData" on Feb 1, 2009 on llvmdev, and PR3451. Comments welcome. llvm-svn: 86370
* more cleanup.Chris Lattner2009-11-071-4/+14
| | | | llvm-svn: 86369
* rewrite TargetData to use StringRef/raw_ostream instead of thrashing ↵Chris Lattner2009-11-071-39/+59
| | | | | | std::strings. llvm-svn: 86366
* Try again at privatizing the layout info map, with a rewritten patch.Owen Anderson2009-08-211-47/+17
| | | | | | This preserves the existing behavior much more closely than my previous attempt. llvm-svn: 79663
* Re-revert r79555. Apparently it's not just buildbot weirdness.Owen Anderson2009-08-201-35/+52
| | | | llvm-svn: 79578
* Reapply r79555 for testing. Daniel's trying to work out some buildbot ↵Owen Anderson2009-08-201-52/+35
| | | | | | weirdnesss. llvm-svn: 79572
* --- Reverse-merging r79555 into '.':Bill Wendling2009-08-201-35/+52
| | | | | | | | | U include/llvm/Target/TargetData.h U lib/Target/TargetData.cpp Temporarily revert 79555. It was causing hangs and test failures. llvm-svn: 79568
* Make the StructType->StructLayout table private to TargetData, allowing us ↵Owen Anderson2009-08-201-52/+35
| | | | | | to avoid locking on it. llvm-svn: 79555
* Update and fix some comments.Dan Gohman2009-08-201-7/+7
| | | | llvm-svn: 79532
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-3/+4
| | | | llvm-svn: 78948
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-2/+2
| | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). llvm-svn: 75640
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-111-2/+3
| | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379
* Have scoped mutexes take referenes instead of pointers.Owen Anderson2009-07-071-3/+3
| | | | llvm-svn: 74931
* Guard the layout info object.Owen Anderson2009-06-231-0/+5
| | | | llvm-svn: 73928
* Change TargetData::getIntPtrType() to return an IntegerType instead ofJay Foad2009-05-111-1/+1
| | | | | | just a Type. llvm-svn: 71426
* Rename PaddedSize to AllocSize, in the hope that thisDuncan Sands2009-05-091-3/+3
| | | | | | | will make it more obvious what it represents, and stop it being confused with the StoreSize. llvm-svn: 71349
* Use LLVM type names instead of C type names in comments, to beDan Gohman2009-04-011-5/+5
| | | | | | less ambiguous and less C-specific. llvm-svn: 68219
* Delete trailing whitespace.Dan Gohman2009-02-161-5/+5
| | | | llvm-svn: 64694
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-121-3/+3
| | | | | | suggested by Chris. llvm-svn: 62099
* Handle a compiler warning.Duncan Sands2008-12-091-1/+1
| | | | llvm-svn: 60755
* consistencyChris Lattner2008-12-081-2/+2
| | | | llvm-svn: 60694
* introduce a new RoundUpAlignment helper function, use it to Chris Lattner2008-12-081-32/+29
| | | | | | | remove some more 64-bit divs and rems from the StructLayout ctor. llvm-svn: 60692
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Change packed struct layout so that field sizesDuncan Sands2008-06-041-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | are the same as in unpacked structs, only field positions differ. This only matters for structs containing x86 long double or an apint; it may cause backwards compatibility problems if someone has bitcode containing a packed struct with a field of one of those types. The issue is that only 10 bytes are needed to hold an x86 long double: the store size is 10 bytes, but the ABI size is 12 or 16 bytes (linux/ darwin) which comes from rounding the store size up by the alignment. Because it seemed silly not to pack an x86 long double into 10 bytes in a packed struct, this is what was done. I now think this was a mistake. Reserving the ABI size for an x86 long double field even in a packed struct makes things more uniform: the ABI size is now always used when reserving space for a type. This means that developers are less likely to make mistakes. It also makes life easier for the CBE which otherwise could not represent all LLVM packed structs (PR2402). Front-end people might need to adjust the way they create LLVM structs - see following change to llvm-gcc. llvm-svn: 51928
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-6/+9
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
OpenPOWER on IntegriCloud