From c00114f52c39f0e048f6b9bd0fff90ec54290295 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 25 Jul 2009 07:16:59 +0000 Subject: minor tweaks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77053 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ProgrammersManual.html | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'docs/ProgrammersManual.html') diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html index 1931a68..e3d4e95 100644 --- a/docs/ProgrammersManual.html +++ b/docs/ProgrammersManual.html @@ -440,16 +440,16 @@ and Twine classes)

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.

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 const char *, and taking a const std::string& requires +a const char *, and taking a const std::string& requires clients to perform a heap allocation which is usually unnecessary. Instead, -many LLVM APIs use a const StringRef& or a const Twine& for -passing strings efficiently.

+many LLVM APIs use a const StringRef& or a const +Twine& for passing strings efficiently.

@@ -464,11 +464,12 @@ passing strings efficiently.

(a character array and a length) and supports the common operations available on std:string, but does not require heap allocation.

-It can be implicitly constructed using either a C style null-terminated string -or an std::string, or explicitly with a character pointer and length. +

It can be implicitly constructed using a C style null-terminated string, +an std::string, or explicitly with a character pointer and length. For example, the StringRef find function is declared as:

+
- iterator find(const StringRef &Key); + iterator find(const StringRef &Key);

and clients can call it using any one of:

@@ -489,7 +490,7 @@ for more information.

You should rarely use the StringRef 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).

+class (unless you know that the external storage will not be freed).

-- cgit v1.1