From 4f6766d41e867948357e95168c40f20465ee27c6 Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Tue, 6 Nov 2007 09:36:34 +0000
Subject: [PATCH] Clarify some of the iostreams stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43766 91177308-0d34-0410-b5e6-96231b3b80d8
---
docs/CodingStandards.html | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/docs/CodingStandards.html b/docs/CodingStandards.html
index 6cfe5428356..2121714db65 100644
--- a/docs/CodingStandards.html
+++ b/docs/CodingStandards.html
@@ -505,14 +505,14 @@ library. There are two problems with this:
- The time to run the static c'tors impacts startup time of
- applications—a critical time for gui apps.
+ applications—a critical time for GUI apps.
- 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.
+ 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.
-
+
@@ -527,7 +527,7 @@ library. There are two problems with this:
DEBUG(std::cerr << ...);
DEBUG(dump(std::cerr)); |
DOUT << ...;
-dump(DOUT); |
+DEBUG(dump(DOUT));
std::cerr << "Hello world\n"; |
@@ -557,17 +557,17 @@ dump(DOUT);
void print(std::ostream &Out);
// ...
print(std::cerr); |
- void print(std::ostream &Out);
-void print(std::ostream *Out) { if (Out) print(*Out) }
+ void print(llvm::OStream Out);1
// ...
print(llvm::cerr);
+ | |
+
+
-N.B. The second print method is called by the print
-expression. It prevents the execution of the first print method if the
-stream is cnull.
-
-
+
1llvm::OStream is a light-weight class so it should never
+be passed by reference. This is important because in some configurations,
+DOUT is an rvalue.