summaryrefslogtreecommitdiffstats
path: root/llvm/docs/ProgrammersManual.html
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-03-26 19:39:05 +0000
committerDan Gohman <gohman@apple.com>2010-03-26 19:39:05 +0000
commit37027c30ec526afe3bb571df6f8701bf0d322f22 (patch)
tree7a77746265e7dd88146e7bf02302aa3d73837f0e /llvm/docs/ProgrammersManual.html
parentb9e176b0ec84199a5e8e43c06c8c96ae80e5f7c2 (diff)
downloadbcm5719-llvm-37027c30ec526afe3bb571df6f8701bf0d322f22.tar.gz
bcm5719-llvm-37027c30ec526afe3bb571df6f8701bf0d322f22.zip
Tell "the rest of the story" about LLVM's iterators' implicit conversions.
llvm-svn: 99642
Diffstat (limited to 'llvm/docs/ProgrammersManual.html')
-rw-r--r--llvm/docs/ProgrammersManual.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/docs/ProgrammersManual.html b/llvm/docs/ProgrammersManual.html
index a2d32d4e985..d1865f13a79 100644
--- a/llvm/docs/ProgrammersManual.html
+++ b/llvm/docs/ProgrammersManual.html
@@ -1843,6 +1843,21 @@ void printNextInstruction(Instruction* inst) {
</pre>
</div>
+<p>Unfortunately, these implicit conversions come at a cost; they prevent
+these iterators from conforming to standard iterator conventions, and thus
+from being usable with standard algorithms and containers. For example, it
+prevents the following code, where <tt>B</tt> is a <tt>BasicBlock</tt>,
+from compiling:</p>
+
+<div class="doc_code">
+<pre>
+ llvm::SmallVector&lt;llvm::Instruction *, 16&gt;(B-&gt;begin(), B-&gt;end());
+</pre>
+</div>
+
+<p>Because of this, these implicit conversions may be removed some day,
+and <tt>operator*</tt> changed to return a pointer instead of a reference.
+
</div>
<!--_______________________________________________________________________-->
OpenPOWER on IntegriCloud