X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FProgrammersManual.html;h=e8d81a25061daa2db8d873767113226f2c1b5b2e;hb=09aa3f0ef35d9241c92439d74b8d5e9a81d814c2;hp=46fd33f40d552827589b83ebfbc05c70a1539053;hpb=e2c3a49c8029ebd9ef530101cc24c66562e3dff5;p=oota-llvm.git diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html index 46fd33f40d5..e8d81a25061 100644 --- a/docs/ProgrammersManual.html +++ b/docs/ProgrammersManual.html @@ -269,9 +269,9 @@ can get, so it will not be discussed in this document.

    -
  1. Dinkumware C++ Library -reference - an excellent reference for the STL and other parts of the -standard C++ library.
  2. +
  3. Dinkumware +C++ Library reference - an excellent reference for the STL and other parts +of the standard C++ library.
  4. C++ In a Nutshell - This is an O'Reilly book in the making. It has a decent Standard Library @@ -309,8 +309,6 @@ to write maintainable code more than where to put your curly braces.

      -
    1. CVS -Branch and Tag Primer
    2. Using static and shared libraries across platforms
    @@ -457,8 +455,8 @@ StringMap class which is used extensively in LLVM and Clang.

    may have embedded null characters. Therefore, they cannot simply take 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 StringRef or a const Twine& for +passing strings efficiently.

    @@ -477,19 +475,17 @@ on std:string, but does not require heap allocation.

    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(StringRef Key);
    +

    and clients can call it using any one of:

    -
    -
    +
       Map.find("foo");                 // Lookup "foo"
       Map.find(std::string("bar"));    // Lookup "bar"
       Map.find(StringRef("\0baz", 4)); // Lookup "\0baz"
     
    -

    Similarly, APIs which need to return a string may return a StringRef instance, which can be used directly or converted to an std::string @@ -499,7 +495,8 @@ 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 (unless you know that the external storage will not be freed).

    +class (unless you know that the external storage will not be freed). StringRef is +small and pervasive enough in LLVM that it should always be passed by value.

    @@ -1437,7 +1434,7 @@ to the key string for a value.

    The StringMap is very fast for several reasons: quadratic probing is very cache efficient for lookups, the hash value of strings in buckets is not -recomputed when lookup up an element, StringMap rarely has to touch the +recomputed when looking up an element, StringMap rarely has to touch the memory for unrelated objects when looking up a value (even when hash collisions happen), hash table growth does not recompute the hash values for strings already in the table, and each pair in the map is store in a single allocation