[llvm-commits] [llvm] r99642 - /llvm/trunk/docs/ProgrammersManual.html

Dan Gohman gohman at apple.com
Fri Mar 26 12:39:05 PDT 2010


Author: djg
Date: Fri Mar 26 14:39:05 2010
New Revision: 99642

URL: http://llvm.org/viewvc/llvm-project?rev=99642&view=rev
Log:
Tell "the rest of the story" about LLVM's iterators' implicit conversions.

Modified:
    llvm/trunk/docs/ProgrammersManual.html

Modified: llvm/trunk/docs/ProgrammersManual.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ProgrammersManual.html?rev=99642&r1=99641&r2=99642&view=diff
==============================================================================
--- llvm/trunk/docs/ProgrammersManual.html (original)
+++ llvm/trunk/docs/ProgrammersManual.html Fri Mar 26 14:39:05 2010
@@ -1843,6 +1843,21 @@
 </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<llvm::Instruction *, 16>(B->begin(), B->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>
 
 <!--_______________________________________________________________________-->





More information about the llvm-commits mailing list