aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2007-11-06 09:36:34 +0000
committerBill Wendling <isanbard@gmail.com>2007-11-06 09:36:34 +0000
commit4f6766d41e867948357e95168c40f20465ee27c6 (patch)
tree0890efa8e348e122f19ed7c60e0922da903b4854
parent8fc9a1022108e1afa8077e3e0a7b8a70eb3c3bc3 (diff)
downloadexternal_llvm-4f6766d41e867948357e95168c40f20465ee27c6.zip
external_llvm-4f6766d41e867948357e95168c40f20465ee27c6.tar.gz
external_llvm-4f6766d41e867948357e95168c40f20465ee27c6.tar.bz2
Clarify some of the iostreams stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43766 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--docs/CodingStandards.html26
1 files changed, 13 insertions, 13 deletions
diff --git a/docs/CodingStandards.html b/docs/CodingStandards.html
index 6cfe542..2121714 100644
--- a/docs/CodingStandards.html
+++ b/docs/CodingStandards.html
@@ -505,14 +505,14 @@ library. There are two problems with this:</p>
<ol>
<li>The time to run the static c'tors impacts startup time of
- applications&mdash;a critical time for gui apps.</li>
+ applications&mdash;a critical time for GUI apps.</li>
<li>The static c'tors cause the app to pull many extra pages of memory off the
- disk: both the code for the static c'tors in each .o file and the small
- amount of data that gets touched. In addition, touched/dirty pages put
- more pressure on the VM system on low-memory machines.</li>
+ disk: both the code for the static c'tors in each <tt>.o</tt> file and the
+ small amount of data that gets touched. In addition, touched/dirty pages
+ put more pressure on the VM system on low-memory machines.</li>
</ol>
-<div style="align: center">
+<div align="center">
<table>
<tbody>
<tr>
@@ -527,7 +527,7 @@ library. There are two problems with this:</p>
<td align="left"><pre>DEBUG(std::cerr &lt;&lt; ...);
DEBUG(dump(std::cerr));</pre></td>
<td align="left"><pre>DOUT &lt;&lt; ...;
-dump(DOUT);</pre></td>
+DEBUG(dump(DOUT));</pre></td>
</tr>
<tr>
<td align="left"><pre>std::cerr &lt;&lt; "Hello world\n";</pre></td>
@@ -557,17 +557,17 @@ dump(DOUT);</pre></td>
<td align="left"><pre>void print(std::ostream &amp;Out);
// ...
print(std::cerr);</pre></td>
- <td align="left"><pre>void print(std::ostream &amp;Out);
-void print(std::ostream *Out) { if (Out) print(*Out) }
+ <td align="left"><pre>void print(llvm::OStream Out);<sup>1</sup>
// ...
print(llvm::cerr);</pre>
+</td> </tbody> </table>
+</div>
+
<div class="doc_text">
-<i>N.B.</i> The second <tt>print</tt> method is called by the <tt>print</tt>
-expression. It prevents the execution of the first <tt>print</tt> method if the
-stream is <tt>cnull</tt>.</div></td>
- </tbody>
-</table>
+<p><sup>1</sup><tt>llvm::OStream</tt> is a light-weight class so it should never
+be passed by reference. This is important because in some configurations,
+<tt>DOUT</tt> is an rvalue.</p>
</div>
</div>