1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

42 Commits

Author SHA1 Message Date
Benjamin Kramer
fba17fe3ca Add warn_unused_result to empty() on various containers.
empty() doesn't actually empty out the container, making this a common typo.

llvm-svn: 190708
2013-09-13 17:33:24 +00:00
Rafael Espindola
8a0ed6dcd6 Cleanup the simplify_type implementation.
As far as simplify_type is concerned, there are 3 kinds of smart pointers:

* const correct: A 'const MyPtr<int> &' produces a 'const int*'. A
'MyPtr<int> &' produces a 'int *'.
* always const: Even a 'MyPtr<int> &' produces a 'const int*'.
* no const: Even a 'const MyPtr<int> &' produces a 'int*'.

This patch then does the following:

* Removes the unused specializations. Since they are unused, it is hard
to know which kind should be implemented.
* Make sure we don't drop const.
* Fix the default forwarding so that const correct pointer only need
one specialization.
* Simplifies the existing specializations.

llvm-svn: 178147
2013-03-27 16:43:11 +00:00
David Blaikie
a1251c8987 Use LLVM_DELETED_FUNCTION rather than '// do not implement' comments.
Also removes some redundant DNI comments on function declarations already
using the macro.

llvm-svn: 175466
2013-02-18 23:11:17 +00:00
Jakob Stoklund Olesen
499d789d2b Add an iplist::clearAndLeakNodesUnsafely() function.
The iplist::clear() function can be quite expensive because it traverses
the entire list, calling deleteNode() and removeNodeFromList() on each
element. If node destruction and deallocation can be handled some other
way, clearAndLeakNodesUnsafely() can be used to jettison all nodes
without bringing them into cache.

The function name is meant to be ominous.

llvm-svn: 171540
2013-01-04 22:35:42 +00:00
Jakob Stoklund Olesen
223ce5e130 Add an assertion for a likely ilist::splice() contract violation.
The single-element ilist::splice() function supports a noop move:

  List.splice(I, List, I);

The corresponding std::list function doesn't allow that, so add a unit
test to document that behavior.

This also means that

  List.splice(I, List, F);

is somewhat surprisingly not equivalent to

  List.splice(I, List, F, next(F));

This patch adds an assertion to catch the illegal case I == F above.
Alternatively, we could make I == F a legal noop, but that would make
ilist differ even more from std::list.

llvm-svn: 170443
2012-12-18 19:28:37 +00:00
Craig Topper
f2e8b27fbc Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION.
llvm-svn: 164014
2012-09-17 06:31:17 +00:00
Francois Pichet
632c8aec93 Fixes the MSVC build.
Commit r152704 exposed a latent MSVC limitation (aka bug). 
Both ilist and and iplist contains the same function:
  template<class InIt> void insert(iterator where, InIt first, InIt last) {
    for (; first != last; ++first) insert(where, *first);
  }

Also ilist inherits from iplist and ilist contains a "using iplist<NodeTy>::insert".
MSVC doesn't know which one to pick and complain with an error.

I think it is safe to delete ilist::insert since it is redundant anyway.

llvm-svn: 152746
2012-03-14 22:36:10 +00:00
Chris Lattner
0304b82f80 Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Nick Lewycky
c85935836b Add missing standard headers. Patch by Joerg Sonnenberger!
llvm-svn: 122193
2010-12-19 20:43:38 +00:00
Dan Gohman
5110488830 Delete an unused declaration.
llvm-svn: 112424
2010-08-29 14:48:15 +00:00
Duncan Sands
78593d094f Add includes to get ptrdiff_t. This is needed by gcc-4.6 which has
done some more header trimming, resulting in cstdef being included
by less header files.

llvm-svn: 105786
2010-06-10 10:13:58 +00:00
John McCall
9ebba8d98e Names from dependent base classes are not found by unqualified lookup.
llvm-svn: 91407
2009-12-15 03:10:26 +00:00
Duncan Sands
750b1f5de2 Public and private corrections, warned about by icc (#304).
Patch by Erick Tryzelaar.

llvm-svn: 81107
2009-09-06 08:55:57 +00:00
Gabor Greif
0d4f085232 eliminate all 80-col violations that I have introduced in my recent checkins (and some others more)
llvm-svn: 80304
2009-08-27 23:44:33 +00:00
Gabor Greif
cc8681cea3 Clean up the minor mess I caused with removing iterator.h. I shall take care of 80-col violations and the FIXME later. (Thanks goodness that I live in another continent, so the monkeypox did not strike me :-)
llvm-svn: 80224
2009-08-27 06:41:46 +00:00
Gabor Greif
830005b778 Remove all the LLVM_COMPACTIFY_SENTINELS-related macro magic as discussed with Chris on IRC. Anybody wanting to debug sentinel dereferencing problems must revert this patch and perform the indicated modifications.
llvm-svn: 80128
2009-08-26 19:16:32 +00:00
Gabor Greif
76dcbf3018 re-committing yesterday's r79938.
This time there is no additional include of llvm/Config/config.h
at all. Instead I use a hard-coded preprecessor symbol:
LLVM_COMPACTIFY_SENTINELS

(should this work on the self-hosting buildbot, then
 cleanups come next)

llvm-svn: 80035
2009-08-25 21:25:22 +00:00
Bill Wendling
bc8a0cd205 --- Reverse-merging r79938 into '.':
U    include/llvm/BasicBlock.h
U    include/llvm/ADT/ilist_node.h
U    include/llvm/ADT/ilist.h
U    include/llvm/CodeGen/SelectionDAG.h
U    include/llvm/CodeGen/MachineFunction.h
U    include/llvm/CodeGen/MachineBasicBlock.h
U    include/llvm/Function.h

Revert r79938. It was causing self-hosting build failures.

llvm-svn: 79960
2009-08-25 00:05:04 +00:00
Gabor Greif
fbe4ca0d36 Resubmit an earlier patch of mine:
reduce the size of relevant "ghostly" sentinels
by a pointer.

This attempt now makes the compactification dependent
on the configure variable LLVM_COMPACT_SENTINELS
and should not cause any bootstrap failures for
llvm-gcc any more.

Please note that this is not yet the final version,
and (as settled with Chris) I shall take out the
autofoo/cmake portions in the next days.

This will also lose the assertability on sentinel
dereferencing and operator++, but that seems
an acceptable price to pay for the simplified
build logic.

llvm-svn: 79938
2009-08-24 21:34:17 +00:00
Gabor Greif
5ce04c066b catch a typo and simplify call syntax
llvm-svn: 78804
2009-08-12 09:05:11 +00:00
Torok Edwin
a2f0fd169e fix build on VC++2k8.
llvm-svn: 72736
2009-06-02 20:32:59 +00:00
Chris Lattner
8d5d3eaf95 fix a broken assertion in ilist_iterator, which caused it to crash in the
bad case instead of actually assert.  Bug pointed out by Jakob Stoklund 
Olesen!

llvm-svn: 68785
2009-04-10 15:47:17 +00:00
Gabor Greif
9a8e64c76f Give sentinel traits the right to determine the policy where the sentinel is kept.
This should result in less indirect memory accesses, less dead writes and tighter code.

llvm-svn: 66061
2009-03-04 20:36:44 +00:00
Gabor Greif
63c1d08d66 drop support for GCC 2.x as it is hopelessly broken anyway
llvm-svn: 65864
2009-03-02 19:49:29 +00:00
Gabor Greif
5d9be2cffd make traits more flexible by splitting out node-related fragment
llvm-svn: 65690
2009-02-28 10:17:32 +00:00
Misha Brukman
4637ef9b4b Removed trailing whitespace.
llvm-svn: 65197
2009-02-20 22:54:36 +00:00
Misha Brukman
380e3db1b4 Fixed lint errors:
* Alphabetized #includes
* Removed trailing whitespace
* Wrapped or shortened lines over 80 chars

llvm-svn: 65181
2009-02-20 22:20:18 +00:00
Steve Naroff
375325e8c1 Add explicit this-> (to make the VS compiler happy).
llvm-svn: 62731
2009-01-21 23:49:23 +00:00
Douglas Gregor
0a0af6b767 Fix ilist two-phase name lookup
llvm-svn: 62724
2009-01-21 22:38:44 +00:00
Chris Lattner
70d79bbe85 add a new insertAfter method, patch by Tom Jablin!
llvm-svn: 62158
2009-01-13 07:43:51 +00:00
Misha Brukman
c6d4c08346 * Fixed spelling of "sentinel"
* Removed trailing whitespace

llvm-svn: 61907
2009-01-08 02:21:23 +00:00
Dan Gohman
8271066844 Tidy up #includes, deleting a bunch of unnecessary #includes.
llvm-svn: 61715
2009-01-05 17:59:02 +00:00
Dan Gohman
97be71789f Add several more unimplemented operator overloads to ilist_iterator
to help catch errors.

llvm-svn: 61622
2009-01-04 03:22:42 +00:00
Cedric Venet
b260c282bc Add explicit this-> for some member function in templated base class.
These call are probably dependent but VS with /Za don't seems to think so. We need to help him.

llvm-svn: 60978
2008-12-13 10:55:13 +00:00
Bill Wendling
5aaf075b29 Removed unused parameters.
llvm-svn: 54262
2008-08-01 05:50:13 +00:00
Dan Gohman
9653b21dc2 Fold the useful features of alist and alist_node into ilist, and
a new ilist_node class, and remove them. Unlike alist_node,
ilist_node doesn't attempt to manage storage itself, so it avoids
the associated problems, including being opaque in gdb.

Adjust the Recycler class so that it doesn't depend on alist_node.
Also, change it to use explicit Size and Align parameters, allowing
it to work when the largest-sized node doesn't have the greatest
alignment requirement.

Change MachineInstr's MachineMemOperand list from a pool-backed
alist to a std::list for now.

llvm-svn: 54146
2008-07-28 21:51:04 +00:00
Nick Lewycky
0dae6f90bb operator[] is not defined for list::iterator. Overload it in ilist::iterator
to prevent silly things from happening accidentally. PR2171

llvm-svn: 53507
2008-07-12 07:00:52 +00:00
Ted Kremenek
9bd15119cd Make typedefs in ilist public (Visual C++ errors out when they are private).
llvm-svn: 53431
2008-07-10 22:58:10 +00:00
Dan Gohman
60e964b34c Add some basic Pool-allocation infrastructure. This adds a Recycler class,
for handling bookkeeping for deleted objects, as well as the alist class
template, for keeping lists of objects allocated from Recyclers, and some
related utilities.

llvm-svn: 53210
2008-07-07 22:58:06 +00:00
Dan Gohman
1834981eb0 Make ilist noncopyable too.
llvm-svn: 53190
2008-07-07 18:43:32 +00:00
Anton Korobeynikov
c128302249 Update guards
llvm-svn: 51692
2008-05-29 18:17:53 +00:00
Anton Korobeynikov
f77142326f For PR1338: rename include/llvm/ADT/ilist and friends to end with ".h"
llvm-svn: 51687
2008-05-29 17:41:17 +00:00