summaryrefslogtreecommitdiff
path: root/lib/Support/FoldingSet.cpp
Commit message (Collapse)AuthorAge
* Make the host endianness check an integer constant expression.Rafael Espindola2013-04-15
| | | | | | | | | | | | | | | I will remove the isBigEndianHost function once I update clang. The ifdef logic is designed to * not use configure/cmake to avoid breaking -arch i686 -arch ppc. * default to little endian * be as small as possible It looks like sys/endian.h is the preferred header on most modern BSD systems, but it is better to change this in a followup patch as machine/endian.h is available on FreeBSD, OpenBSD, NetBSD and OS X. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179527 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix whitespace. No functionality change.Nick Lewycky2012-12-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171051 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-03
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
* move irrelevant attribution.Chris Lattner2012-11-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168182 91177308-0d34-0410-b5e6-96231b3b80d8
* Add operator< for FoldingSetNodeID.Ted Kremenek2012-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163454 91177308-0d34-0410-b5e6-96231b3b80d8
* FoldingSet: Push the hash through FoldingSetTraits::Equals, so clients can ↵Benjamin Kramer2012-04-11
| | | | | | use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154496 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert commit 152300 (ddunbar) since it still seems to be breakingDuncan Sands2012-03-08
| | | | | | | | | | buildbots. Original commit message: [ADT] Change the trivial FoldingSetNodeID::Add* methods to be inline, reapplied with a fix for the longstanding over-read of 32-bit pointer values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152304 91177308-0d34-0410-b5e6-96231b3b80d8
* [ADT] Change the trivial FoldingSetNodeID::Add* methods to be inline, reappliedDaniel Dunbar2012-03-08
| | | | | | with a fix for the longstanding over-read of 32-bit pointer values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152300 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r152288, "[ADT] Change the trivial FoldingSetNodeID::Add* methods to beDaniel Dunbar2012-03-08
| | | | | | inline.", which is breaking the bots in a way I don't understand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152295 91177308-0d34-0410-b5e6-96231b3b80d8
* [ADT] Change the trivial FoldingSetNodeID::Add* methods to be inline.Daniel Dunbar2012-03-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152288 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch FoldingSet over to the new hashing infrastructure. We might wantChandler Carruth2012-03-01
| | | | | | | | to do more invasive refactoring here to get FoldingSet to use size_t or even hash_code directly, but for now this is a good first step to remove Yet Another Hashing Algorithm from LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151859 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify & microoptimize code. No intended functionality change.Benjamin Kramer2011-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135364 91177308-0d34-0410-b5e6-96231b3b80d8
* singed int causes signed extension, which contradicts the intention to pick upZhongxing Xu2011-06-03
| | | | | | | integers with high 32 bits being zero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132538 91177308-0d34-0410-b5e6-96231b3b80d8
* allow adding a FoldingSetNodeID to a FastFoldingSetNode, resolving PR9499,Chris Lattner2011-04-25
| | | | | | | patch by Johannes Schaub! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130151 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* Aligned and unaligned copies of the same stringDale Johannesen2010-11-19
| | | | | | | | | were not hashing to the same value. Analysis and patch by Frits van Bommel! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119770 91177308-0d34-0410-b5e6-96231b3b80d8
* Use Bits.data() instead of &Bits[0].Dan Gohman2010-08-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111993 91177308-0d34-0410-b5e6-96231b3b80d8
* Add hooks to FoldingSetTrait to allow specializations to provideDan Gohman2010-08-16
| | | | | | | | | implementations of equality comparison and hash computation. This can be used to optimize node lookup by avoiding creating lots of temporary ID values just for hashing and comparison purposes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111130 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverse the order of GetNodeProfile's arguments, for consistencyDan Gohman2010-08-16
| | | | | | | with FoldingSetTrait::Profile. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111127 91177308-0d34-0410-b5e6-96231b3b80d8
* Use calloc instead of new/memset, it is more efficient when the set is very ↵Benjamin Kramer2010-06-19
| | | | | | large. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106390 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the ability to "intern" FoldingSetNodeID data into aDan Gohman2010-03-18
| | | | | | | | | | | | | BumpPtrAllocator-allocated region to allow it to be stored in a more compact form and to avoid the need for a non-trivial destructor call. Use this new mechanism in ScalarEvolution instead of FastFoldingSetNode to avoid leaking memory in the case where a FoldingSetNodeID uses heap storage, and to reduce overall memory usage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98829 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch FoldingSet::AddString to StringRef based API.Daniel Dunbar2009-09-22
| | | | | | - This also fixes a dereference of std::string::end, which makes MSVC unhappy and was causing all the static analyzer clang tests to fail. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82517 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-14
| | | | | | | | | | 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-11
| | | | | | | | | | 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
* Add an API for strings with possible NULLs in the middle. Refactor the otherNick Lewycky2009-02-07
| | | | | | | two AddString methods to use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64005 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not use host floating point types when emittingDale Johannesen2009-01-21
| | | | | | | | | | | ASCII IR; loading and storing these can change the bits of NaNs on some hosts. Remove or add warnings at a few other places using host floating point; this is a bad thing to do in general. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62712 91177308-0d34-0410-b5e6-96231b3b80d8
* Overload AddInteger on int/long/long long instead of on int/int64_t,Dan Gohman2008-11-03
| | | | | | | | to avoid overload ambiguities. This fixes build errors introduced by r58623. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58632 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a clear() method to FoldingSet.Dan Gohman2008-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55210 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid repeatedly reallocating the FoldingSetNodeID when searchingDan Gohman2008-08-12
| | | | | | | through multiple nodes in a bucket. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54687 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a version of AddString that takes a const char* so we can avoid extraneousOwen Anderson2008-07-01
| | | | | | | conversions to std::string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52995 91177308-0d34-0410-b5e6-96231b3b80d8
* Consistently set "Buckets[NumBuckets] = reinterpret_cast<void*>(-1)" ↵Ted Kremenek2008-06-17
| | | | | | throughout FoldingSet.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52425 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix more -Wshorten-64-to-32 warnings.Evan Cheng2008-05-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50659 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-20
| | | | | | annoying warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47367 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed bug in FoldingSetIteratorImpl where we did not correctly check ifTed Kremenek2008-02-15
| | | | | | | | we had reached the "fake bucket" after the last bucket, allowing the iterator in some cases to run off the end of the hashtable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47178 91177308-0d34-0410-b5e6-96231b3b80d8
* Added "Profile" method to APFloat for use with FoldingSet.Ted Kremenek2008-02-11
| | | | | | | | | | | Added member template "Add" to FoldingSetNodeID that allows "adding" arbitrary objects to a profile via dispatch to FoldingSetTrait<T>::Profile(). Removed FoldingSetNodeID::AddAPFloat and FoldingSetNodeID::APInt, as their functionality is now replaced using the above mentioned member template. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46957 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to FoldingSet for hashing APInt objects.Dan Gohman2008-02-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46833 91177308-0d34-0410-b5e6-96231b3b80d8
* Added "bucket_iterators" to FoldingSet. Bucket iterators allow iterationTed Kremenek2008-02-04
| | | | | | | over all the nodes in a particular bucket. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46716 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed 80 col. violation.Ted Kremenek2008-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46709 91177308-0d34-0410-b5e6-96231b3b80d8
* Made 'FoldingSetNodeID' a proper class instead of a nested class inTed Kremenek2008-01-19
| | | | | | | | | | | 'FoldingSetNodeImpl' (previously 'FoldingSetNodeID' was a typedef of 'FoldingSetNodeImpl::NodeID'). Why? Clients can now easily forward declare 'FoldingSetNodeID' without having to include FoldingSet.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46187 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* Change a #include into a forward declarationChris Lattner2007-10-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42781 91177308-0d34-0410-b5e6-96231b3b80d8
* Add initial iterator support for folding set.Chris Lattner2007-10-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42589 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify implementation of the FoldingSet circular list, a necessary stepChris Lattner2007-10-03
| | | | | | | to giving it iterators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42586 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a gcc warning: comparison between signed and unsigned integer expressionsChris Lattner2007-09-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41972 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the assumption that FP's are either float orDale Johannesen2007-09-14
| | | | | | | | | | | | | | | double from some of the many places in the optimizers it appears, and do something reasonable with x86 long double. Make APInt::dump() public, remove newline, use it to dump ConstantSDNode's. Allow APFloats in FoldingSet. Expand X86 backend handling of long doubles (conversions to/from int, mostly). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41967 91177308-0d34-0410-b5e6-96231b3b80d8
* And an FoldingSetImpl::NodeID::AddInteger overload for int64_t, to avoidDan Gohman2007-09-14
| | | | | | | ambiguity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41960 91177308-0d34-0410-b5e6-96231b3b80d8
* remove folding set debug outputChris Lattner2007-02-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34549 91177308-0d34-0410-b5e6-96231b3b80d8
* Encode small integers more densely in foldingset, avoiding overflowing the ↵Chris Lattner2007-02-04
| | | | | | SmallVector as often. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33864 91177308-0d34-0410-b5e6-96231b3b80d8
* improve comments, add an assertionChris Lattner2007-02-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33750 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some debug output.Reid Spencer2007-01-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33718 91177308-0d34-0410-b5e6-96231b3b80d8