summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/FoldingSet.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make the host endianness check an integer constant expression.Rafael Espindola2013-04-151-2/+2
| | | | | | | | | | | | | | | 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. llvm-svn: 179527
* Fix whitespace. No functionality change.Nick Lewycky2012-12-251-2/+2
| | | | llvm-svn: 171051
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-1/+1
| | | | | | | | | | | | | | | | | 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. =] llvm-svn: 169131
* move irrelevant attribution.Chris Lattner2012-11-161-3/+1
| | | | llvm-svn: 168182
* Add operator< for FoldingSetNodeID.Ted Kremenek2012-09-081-0/+18
| | | | llvm-svn: 163454
* FoldingSet: Push the hash through FoldingSetTraits::Equals, so clients can ↵Benjamin Kramer2012-04-111-3/+3
| | | | | | use it. llvm-svn: 154496
* Revert commit 152300 (ddunbar) since it still seems to be breakingDuncan Sands2012-03-081-1/+43
| | | | | | | | | 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. llvm-svn: 152304
* [ADT] Change the trivial FoldingSetNodeID::Add* methods to be inline, reappliedDaniel Dunbar2012-03-081-43/+1
| | | | | | with a fix for the longstanding over-read of 32-bit pointer values. llvm-svn: 152300
* Revert r152288, "[ADT] Change the trivial FoldingSetNodeID::Add* methods to beDaniel Dunbar2012-03-081-1/+43
| | | | | | inline.", which is breaking the bots in a way I don't understand. llvm-svn: 152295
* [ADT] Change the trivial FoldingSetNodeID::Add* methods to be inline.Daniel Dunbar2012-03-081-43/+1
| | | | llvm-svn: 152288
* Switch FoldingSet over to the new hashing infrastructure. We might wantChandler Carruth2012-03-011-18/+2
| | | | | | | | 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. llvm-svn: 151859
* Simplify & microoptimize code. No intended functionality change.Benjamin Kramer2011-07-181-4/+2
| | | | llvm-svn: 135364
* singed int causes signed extension, which contradicts the intention to pick upZhongxing Xu2011-06-031-1/+1
| | | | | | integers with high 32 bits being zero. llvm-svn: 132538
* allow adding a FoldingSetNodeID to a FastFoldingSetNode, resolving PR9499,Chris Lattner2011-04-251-0/+5
| | | | | | patch by Johannes Schaub! llvm-svn: 130151
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120298
* Aligned and unaligned copies of the same stringDale Johannesen2010-11-191-7/+22
| | | | | | | were not hashing to the same value. Analysis and patch by Frits van Bommel! llvm-svn: 119770
* Use Bits.data() instead of &Bits[0].Dan Gohman2010-08-241-3/+3
| | | | llvm-svn: 111993
* Add hooks to FoldingSetTrait to allow specializations to provideDan Gohman2010-08-161-35/+52
| | | | | | | | 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. llvm-svn: 111130
* Reverse the order of GetNodeProfile's arguments, for consistencyDan Gohman2010-08-161-4/+4
| | | | | | with FoldingSetTrait::Profile. llvm-svn: 111127
* Use calloc instead of new/memset, it is more efficient when the set is very ↵Benjamin Kramer2010-06-191-6/+14
| | | | | | large. llvm-svn: 106390
* Add the ability to "intern" FoldingSetNodeID data into aDan Gohman2010-03-181-0/+10
| | | | | | | | | | | | 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. llvm-svn: 98829
* Switch FoldingSet::AddString to StringRef based API.Daniel Dunbar2009-09-221-11/+3
| | | | | | - This also fixes a dereference of std::string::end, which makes MSVC unhappy and was causing all the static analyzer clang tests to fail. llvm-svn: 82517
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-1/+1
| | | | | | | | | 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-1/+2
| | | | | | | | | 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
* Add an API for strings with possible NULLs in the middle. Refactor the otherNick Lewycky2009-02-071-37/+8
| | | | | | two AddString methods to use it. llvm-svn: 64005
* Do not use host floating point types when emittingDale Johannesen2009-01-211-6/+0
| | | | | | | | | 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. llvm-svn: 62712
* Overload AddInteger on int/long/long long instead of on int/int64_t,Dan Gohman2008-11-031-6/+16
| | | | | | | to avoid overload ambiguities. This fixes build errors introduced by r58623. llvm-svn: 58632
* Add a clear() method to FoldingSet.Dan Gohman2008-08-231-12/+13
| | | | llvm-svn: 55210
* Avoid repeatedly reallocating the FoldingSetNodeID when searchingDan Gohman2008-08-121-2/+4
| | | | | | through multiple nodes in a bucket. llvm-svn: 54687
* Add a version of AddString that takes a const char* so we can avoid extraneousOwen Anderson2008-07-011-0/+38
| | | | | | conversions to std::string. llvm-svn: 52995
* Consistently set "Buckets[NumBuckets] = reinterpret_cast<void*>(-1)" ↵Ted Kremenek2008-06-171-1/+1
| | | | | | throughout FoldingSet.cpp. llvm-svn: 52425
* Fix more -Wshorten-64-to-32 warnings.Evan Cheng2008-05-051-2/+2
| | | | llvm-svn: 50659
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-201-0/+1
| | | | | | annoying warnings. llvm-svn: 47367
* Fixed bug in FoldingSetIteratorImpl where we did not correctly check ifTed Kremenek2008-02-151-2/+4
| | | | | | | we had reached the "fake bucket" after the last bucket, allowing the iterator in some cases to run off the end of the hashtable. llvm-svn: 47178
* Added "Profile" method to APFloat for use with FoldingSet.Ted Kremenek2008-02-111-11/+0
| | | | | | | | | | 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. llvm-svn: 46957
* Add support to FoldingSet for hashing APInt objects.Dan Gohman2008-02-061-0/+4
| | | | llvm-svn: 46833
* Added "bucket_iterators" to FoldingSet. Bucket iterators allow iterationTed Kremenek2008-02-041-1/+7
| | | | | | over all the nodes in a particular bucket. llvm-svn: 46716
* Fixed 80 col. violation.Ted Kremenek2008-02-041-2/+4
| | | | llvm-svn: 46709
* Made 'FoldingSetNodeID' a proper class instead of a nested class inTed Kremenek2008-01-191-19/+19
| | | | | | | | | | 'FoldingSetNodeImpl' (previously 'FoldingSetNodeID' was a typedef of 'FoldingSetNodeImpl::NodeID'). Why? Clients can now easily forward declare 'FoldingSetNodeID' without having to include FoldingSet.h. llvm-svn: 46187
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Change a #include into a forward declarationChris Lattner2007-10-091-0/+1
| | | | llvm-svn: 42781
* Add initial iterator support for folding set.Chris Lattner2007-10-031-0/+32
| | | | llvm-svn: 42589
* Simplify implementation of the FoldingSet circular list, a necessary stepChris Lattner2007-10-031-11/+20
| | | | | | to giving it iterators. llvm-svn: 42586
* fix a gcc warning: comparison between signed and unsigned integer expressionsChris Lattner2007-09-141-1/+1
| | | | llvm-svn: 41972
* Remove the assumption that FP's are either float orDale Johannesen2007-09-141-0/+6
| | | | | | | | | | | | | 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). llvm-svn: 41967
* And an FoldingSetImpl::NodeID::AddInteger overload for int64_t, to avoidDan Gohman2007-09-141-0/+3
| | | | | | ambiguity. llvm-svn: 41960
* remove folding set debug outputChris Lattner2007-02-241-4/+0
| | | | llvm-svn: 34549
* Encode small integers more densely in foldingset, avoiding overflowing the ↵Chris Lattner2007-02-041-1/+4
| | | | | | SmallVector as often. llvm-svn: 33864
* improve comments, add an assertionChris Lattner2007-02-011-3/+6
| | | | llvm-svn: 33750
* Add some debug output.Reid Spencer2007-01-311-0/+4
| | | | llvm-svn: 33718
OpenPOWER on IntegriCloud