1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

57 Commits

Author SHA1 Message Date
Benjamin Kramer
216200bec5 Enable pod-like optimizations for pred and succ iterators.
llvm-svn: 182257
2013-05-20 13:12:58 +00:00
Howard Hinnant
c683c9244e Seciton 24.2.2 of the C++ standard, [iterator.iterators], Table 106
requires that the return type of *r for all iterators r be reference,
where reference is defined in [iterator.requirements.general]/p11 as
iterator_traits<X>::reference, and X is the type of r.

But in CFG.h, the dereference operator of PredIterator and SuccIterator
return pointer, not reference.

Furthermore the nested type reference is value_type&, which is not the
type returned from operator*().

This patch simply makes the iterator::reference type value_type*, which
is what the operator*() returns, and then re-lables the return type as
reference.

From a functionality point of view, the only difference is that the
nested reference type is now value_type* instead of value_type&.

llvm-svn: 178240
2013-03-28 15:47:50 +00:00
Chandler Carruth
4c1f3c24db Move all of the header files which are involved in modelling the LLVM IR
into their new header subdirectory: include/llvm/IR. This matches the
directory structure of lib, and begins to correct a long standing point
of file layout clutter in LLVM.

There are still more header files to move here, but I wanted to handle
them in separate commits to make tracking what files make sense at each
layer easier.

The only really questionable files here are the target intrinsic
tablegen files. But that's a battle I'd rather not fight today.

I've updated both CMake and Makefile build systems (I think, and my
tests think, but I may have missed something).

I've also re-sorted the includes throughout the project. I'll be
committing updates to Clang, DragonEgg, and Polly momentarily.

llvm-svn: 171366
2013-01-02 11:36:10 +00:00
Dan Gohman
71b80f9e8c Calls and invokes with the new clang.arc.no_objc_arc_exceptions
metadata may still unwind, but only in ways that the ARC
optimizer doesn't need to consider. This permits more
aggressive optimization.

llvm-svn: 150829
2012-02-17 18:59:53 +00:00
Anna Zaks
431b43fdbe Change the Dominators recalculate() function to only rely on GraphTraits
This is a patch by Guoping Long!

As part of utilizing LLVM Dominator computation in Clang, made two changes to LLVM dominators tree implementation:

 - (1) Change the recalculate() template function to only rely on GraphTraits.
 - (2) Add a size() method to GraphTraits template class to query the number of nodes in the graph.

llvm-svn: 145837
2011-12-05 19:17:04 +00:00
Tobias Grosser
85fed4b998 SuccIterator on bbs without terminator insts
Remove the assert that triggers if SuccIterator is constructed for a basic block
without a terminator instruction. Instead of triggering an assert a succ_end()
iterator is returned. This models a basic block with zero successors and allows
us to use F->viewCFG() on incompletely constructed functions.

llvm-svn: 134398
2011-07-04 23:09:02 +00:00
Jay Foad
75b709336d Reinstate r133513 (reverted in r133700) with an additional fix for a
-Wshorten-64-to-32 warning in Instructions.h.

llvm-svn: 133708
2011-06-23 09:09:15 +00:00
Eric Christopher
d38d7f3300 Revert r133513:
"Reinstate r133435 and r133449 (reverted in r133499) now that the clang
self-hosted build failure has been fixed (r133512)."

Due to some additional warnings.

llvm-svn: 133700
2011-06-23 06:24:52 +00:00
Jay Foad
2691fd9891 Reinstate r133435 and r133449 (reverted in r133499) now that the clang
self-hosted build failure has been fixed (r133512).

llvm-svn: 133513
2011-06-21 10:33:19 +00:00
Chad Rosier
16a86e04cf Revert r133435 and r133449 to appease buildbots.
llvm-svn: 133499
2011-06-21 02:09:03 +00:00
Jay Foad
c465a95fb4 Change how PHINodes store their operands.
Change PHINodes to store simple pointers to their incoming basic blocks,
instead of full-blown Uses.

Note that this loses an optimization in SplitCriticalEdge(), because we
can no longer walk the use list of a BasicBlock to find phi nodes. See
the comment I removed starting "However, the foreach loop is slow for
blocks with lots of predecessors".

Extend replaceAllUsesWith() on a BasicBlock to also update any phi
nodes in the block's successors. This mimics what would have happened
when PHINodes were proper Users of their incoming blocks. (Note that
this only works if OldBB->replaceAllUsesWith(NewBB) is called when
OldBB still has a terminator instruction, so it still has some
successors.)

llvm-svn: 133435
2011-06-20 14:38:01 +00:00
Dan Gohman
b62daa9ec3 Make pred_iterator DefaultConstructible, and add an accessor to
retrieve the underlying getOperandNo() value.

llvm-svn: 126804
2011-03-02 00:11:28 +00:00
Gabor Greif
2a21837ee1 remove unneeded parens
llvm-svn: 107881
2010-07-08 16:52:57 +00:00
Dan Gohman
d044ebe427 Fix whitespace, comments.
llvm-svn: 101247
2010-04-14 15:59:02 +00:00
Dan Gohman
b1dc3b2278 Add explicit keywords.
llvm-svn: 101246
2010-04-14 15:50:02 +00:00
Dan Gohman
17f6c8fd41 Use C++, not C++-standard-library-internals-ese.
llvm-svn: 101245
2010-04-14 15:41:50 +00:00
Dan Gohman
ff3522de68 Make SuccIterator's private parts private too.
llvm-svn: 101244
2010-04-14 15:38:15 +00:00
Dan Gohman
c9fee63fce Make helper utility members private.
llvm-svn: 101243
2010-04-14 15:33:04 +00:00
Gabor Greif
c637593cda rename pred_const_iterator to const_pred_iterator for consistency's sake
llvm-svn: 99567
2010-03-25 23:25:28 +00:00
Gabor Greif
df5013e4d8 rename use_const_iterator to const_use_iterator for consistency's sake
llvm-svn: 99564
2010-03-25 23:06:16 +00:00
Benjamin Kramer
92e94ed8c6 Revive dead assert.
llvm-svn: 93638
2010-01-16 16:14:55 +00:00
Tobias Grosser
fc9e55b439 Add getSource() to SuccIterator
Get the source BB of an iterator.

llvm-svn: 93364
2010-01-13 22:21:43 +00:00
Tobias Grosser
44e38a98c5 Extend SuccIterator
Implement most of the missing methods to make SuccIterator random access.
operator[] is still missing.

llvm-svn: 93363
2010-01-13 22:21:28 +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
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
Nick Lewycky
1f831c0f57 Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123.

llvm-svn: 50265
2008-04-25 16:53:59 +00:00
Nick Lewycky
97179cb16f Whoops! Undo r50087, unbreak the build.
llvm-svn: 50088
2008-04-22 05:20:06 +00:00
Nick Lewycky
e708ae5ffd Reverse r47989. Part of removing 'unwinds to' support.
llvm-svn: 50087
2008-04-22 05:16:51 +00:00
Scott Michel
4b37c88f48 Workaround for PR2207, in which pred_iterator assert gets triggered due to a
wee problem in Xcode 2.[45]/gcc 4.0.1.

llvm-svn: 49831
2008-04-16 23:46:39 +00:00
Nick Lewycky
5f274047bd Treat BBs that use BBs as proper predecessors and successors in the CFG.
llvm-svn: 47989
2008-03-06 06:54:53 +00:00
Chris Lattner
e0b1ee937a Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)

llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Chris Lattner
ba2ff1f992 Add a new use_iterator::atEnd() method, which allows us to shrink
pred_iterator down to a single ivar.

llvm-svn: 42859
2007-10-11 04:18:11 +00:00
Misha Brukman
8018cc9e05 Remove trailing whitespace
llvm-svn: 21411
2005-04-21 20:48:15 +00:00
Chris Lattner
fdbedbbb45 Switch from using an ilist for uses to using a custom doubly linked list.
This list does not provide the ability to go backwards in the list (its
more of an unordered collection, stored in the shape of a list).

This change means that use iterators are now only forward iterators, not
bidirectional.

This improves the memory usage of use lists from '5 + 4*#use' per value to
'1 + 4*#use'.  While it would be better to reduce the multiplied factor,
I'm not smart enough to do so.  This list also has slightly more efficient
operators for manipulating list nodes (a few less loads/stores), due to not
needing to be able to iterate backwards through the list.

This change reduces the memory footprint required to hold 176.gcc from
66.025M -> 57.687M, a 14% reduction.  It also speeds up the compiler,
7.73% in the case of bytecode loading alone (release build loading 176.gcc).

llvm-svn: 19956
2005-02-01 01:22:06 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Chris Lattner
068c3a1858 Starting an identifier with an _ is not legal C/C++ code.
llvm-svn: 13620
2004-05-21 18:37:13 +00:00
Chris Lattner
939685e14b Move the GraphTraits for MachineBasicBlocks to the MachineBasicBlock file.
llvm-svn: 13299
2004-05-01 21:05:34 +00:00
Brian Gaeke
af5e2f1ea5 Add machine-CFG graph traits specializations.
llvm-svn: 13288
2004-04-29 17:43:55 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Chris Lattner
88e0e2ab86 No really, I'm not on crack
llvm-svn: 9855
2003-11-10 04:23:52 +00:00
Chris Lattner
79ba83de00 Helper method
llvm-svn: 9854
2003-11-10 04:16:50 +00:00
John Criswell
16c6cda9d5 Added LLVM copyright header (for lack of a better term).
llvm-svn: 9304
2003-10-20 20:19:47 +00:00
Chris Lattner
4e4c763dfc Standardize header file comments
llvm-svn: 8782
2003-09-30 18:37:50 +00:00
Chris Lattner
d4de2760aa Rename Function::getEntryNode -> getEntryBlock
llvm-svn: 8625
2003-09-20 14:39:18 +00:00
Chris Lattner
6c12776232 Remove a ton of extraneous #includes
llvm-svn: 6842
2003-06-22 03:08:05 +00:00
John Criswell
4781723de6 Included assert.h so that the code compiles under newer versions of GCC.
llvm-svn: 6682
2003-06-11 14:01:36 +00:00
Chris Lattner
97c9c55218 Revert last checkin. Note that PHI nodes can use basic blocks also!
llvm-svn: 5956
2003-04-26 17:38:26 +00:00
Chris Lattner
e833466012 Remove long-dead obsolete cruft
llvm-svn: 5955
2003-04-25 23:39:08 +00:00
Chris Lattner
0df2058775 Expose API to graph library to allow iteration over all nodes, even unreachable ones
llvm-svn: 4111
2002-10-10 22:31:31 +00:00