aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/TargetData.cpp
Commit message (Collapse)AuthorAgeFilesLines
* remove unions from LLVM IR. They are severely buggy and notChris Lattner2010-08-281-25/+0
| | | | | | | being actively maintained, improved, or extended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112356 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use unsigned char for alignments in TargetData. There aren'tDan Gohman2010-08-111-15/+15
| | | | | | | | | that many of these things, so the memory savings isn't significant, and there are now situations where there can be alignments greater than 128. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110836 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-2/+2
| | | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
* Do GEP offset calculations with unsigned math rather than signed mathDan Gohman2010-07-281-1/+1
| | | | | | | to avoid undefined behavior on overflow, noticed by John Regehr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109594 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson2010-07-211-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102206 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101662 91177308-0d34-0410-b5e6-96231b3b80d8
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100709 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100172 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100161 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply r98656 unmodified, which exposed the asmprinter not Chris Lattner2010-03-161-0/+25
| | | | | | | handling constant unions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98680 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r98656, its breaking all over the place.Daniel Dunbar2010-03-161-25/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98662 91177308-0d34-0410-b5e6-96231b3b80d8
* improve support for uniontype and ConstantUnion, patch by Tim Northover!Chris Lattner2010-03-161-0/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98656 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97137 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97064 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94468 91177308-0d34-0410-b5e6-96231b3b80d8
* finish cleaning up StructLayoutMap.Chris Lattner2009-12-171-21/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91612 91177308-0d34-0410-b5e6-96231b3b80d8
* Calling InvalidateEntry during the refinement was breaking the bootstrap.Bill Wendling2009-12-051-2/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90656 91177308-0d34-0410-b5e6-96231b3b80d8
* Final cleanups:Bill Wendling2009-12-051-14/+2
| | | | | | | | - Privatize a typedef. - Call the InvalidateEntry when refining a type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90655 91177308-0d34-0410-b5e6-96231b3b80d8
* Inline methods which are called only once.Bill Wendling2009-12-051-15/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90640 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor some code. No functionality change.Bill Wendling2009-12-051-9/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90639 91177308-0d34-0410-b5e6-96231b3b80d8
* Some code cleanup. No functionality change.Bill Wendling2009-12-041-15/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90588 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r90371. It was causing build failures.Bill Wendling2009-12-031-23/+42
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90383 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90371 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some dead std::ostream using code.Chris Lattner2009-12-031-9/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90366 91177308-0d34-0410-b5e6-96231b3b80d8
* improve portability to avoid conflicting with std::next in c++'0x.Chris Lattner2009-12-031-0/+1
| | | | | | | Patch by Howard Hinnant! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90365 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90362 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89176 91177308-0d34-0410-b5e6-96231b3b80d8
* Make TargetData::getStringRepresentation spit out native integer types,Chris Lattner2009-11-081-0/+7
| | | | | | | this gives llvm-gcc generated modules the right data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86435 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86370 91177308-0d34-0410-b5e6-96231b3b80d8
* more cleanup.Chris Lattner2009-11-071-4/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86369 91177308-0d34-0410-b5e6-96231b3b80d8
* rewrite TargetData to use StringRef/raw_ostream instead of thrashing ↵Chris Lattner2009-11-071-39/+59
| | | | | | std::strings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86366 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79663 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-revert r79555. Apparently it's not just buildbot weirdness.Owen Anderson2009-08-201-35/+52
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79578 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r79555 for testing. Daniel's trying to work out some buildbot ↵Owen Anderson2009-08-201-52/+35
| | | | | | weirdnesss. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79572 91177308-0d34-0410-b5e6-96231b3b80d8
* --- 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79568 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the StructType->StructLayout table private to TargetData, allowing us ↵Owen Anderson2009-08-201-52/+35
| | | | | | to avoid locking on it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79555 91177308-0d34-0410-b5e6-96231b3b80d8
* Update and fix some comments.Dan Gohman2009-08-201-7/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79532 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
* 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"). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
* Have scoped mutexes take referenes instead of pointers.Owen Anderson2009-07-071-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74931 91177308-0d34-0410-b5e6-96231b3b80d8
* Guard the layout info object.Owen Anderson2009-06-231-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73928 91177308-0d34-0410-b5e6-96231b3b80d8
* Change TargetData::getIntPtrType() to return an IntegerType instead ofJay Foad2009-05-111-1/+1
| | | | | | just a Type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71426 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71349 91177308-0d34-0410-b5e6-96231b3b80d8
* Use LLVM type names instead of C type names in comments, to beDan Gohman2009-04-011-5/+5
| | | | | | | less ambiguous and less C-specific. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68219 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete trailing whitespace.Dan Gohman2009-02-161-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64694 91177308-0d34-0410-b5e6-96231b3b80d8