[llvm-commits] [llvm] r77053 - /llvm/trunk/docs/ProgrammersManual.html
Chris Lattner
sabre at nondot.org
Sat Jul 25 00:16:59 PDT 2009
Author: lattner
Date: Sat Jul 25 02:16:59 2009
New Revision: 77053
URL: http://llvm.org/viewvc/llvm-project?rev=77053&view=rev
Log:
minor tweaks.
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=77053&r1=77052&r2=77053&view=diff
==============================================================================
--- llvm/trunk/docs/ProgrammersManual.html (original)
+++ llvm/trunk/docs/ProgrammersManual.html Sat Jul 25 02:16:59 2009
@@ -440,16 +440,16 @@
<div class="doc_text">
<p>Although LLVM generally does not do much string manipulation, we do have
-several important APIs which take string. Several important examples are the
+several important APIs which take strings. Two important examples are the
Value class -- which has names for instructions, functions, etc. -- and the
StringMap class which is used extensively in LLVM and Clang.</p>
<p>These are generic classes, and they need to be able to accept strings which
may have embedded null characters. Therefore, they cannot simply take
-a <tt>const char *</tt>, and taking a <tt>const std::string&</tt> requires
+a <tt>const char *</tt>, and taking a <tt>const std::string&</tt> requires
clients to perform a heap allocation which is usually unnecessary. Instead,
-many LLVM APIs use a <tt>const StringRef&</tt> or a <tt>const Twine&</tt> for
-passing strings efficiently.</p>
+many LLVM APIs use a <tt>const StringRef&</tt> or a <tt>const
+Twine&</tt> for passing strings efficiently.</p>
</div>
@@ -464,11 +464,12 @@
(a character array and a length) and supports the common operations available
on <tt>std:string</tt>, but does not require heap allocation.</p>
-It can be implicitly constructed using either a C style null-terminated string
-or an <tt>std::string</tt>, or explicitly with a character pointer and length.
+<p>It can be implicitly constructed using a C style null-terminated string,
+an <tt>std::string</tt>, or explicitly with a character pointer and length.
For example, the <tt>StringRef</tt> find function is declared as:</p>
+
<div class="doc_code">
- iterator find(const StringRef &Key);
+ iterator find(const StringRef &Key);
</div>
<p>and clients can call it using any one of:</p>
@@ -489,7 +490,7 @@
<p>You should rarely use the <tt>StringRef</tt> class directly, because it contains
pointers to external memory it is not generally safe to store an instance of the
-class (since the external storage may be freed).</p>
+class (unless you know that the external storage will not be freed).</p>
</div>
More information about the llvm-commits
mailing list