From 853daf48486ccde48819e72bc83bd2ba7490b020 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Fri, 26 Mar 2010 19:40:38 +0000 Subject: [PATCH] some more tweaks llvm-svn: 99643 --- llvm/docs/ProgrammersManual.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/llvm/docs/ProgrammersManual.html b/llvm/docs/ProgrammersManual.html index d1865f13a799..f5c08786c44e 100644 --- a/llvm/docs/ProgrammersManual.html +++ b/llvm/docs/ProgrammersManual.html @@ -1977,9 +1977,9 @@ for (Value::use_iterator i = F->use_begin(), e = F->use_end(); i != e; ++i -Note that dereferencing a Value::use_iterator is not a very cheap +

Note that dereferencing a Value::use_iterator is not a very cheap operation. Instead of performing *i above several times, consider -doing it only once in the loop body and reusing its result. +doing it only once in the loop body and reusing its result.

Alternatively, it's common to have an instance of the User Class and need to know what @@ -2001,12 +2001,13 @@ for (User::op_iterator i = pi->op_begin(), e = pi->op_end(); i != e; ++i)

Declaring objects as const is an important tool of enforcing -mutation free algorithms (such as analyses etc.). For this purpose above +mutation free algorithms (such as analyses, etc.). For this purpose above iterators come in constant flavors as Value::const_use_iterator and Value::const_op_iterator. They automatically arise when calling use/op_begin() on const Value*s or const User*s respectively. Upon dereferencing, they return -const Use*s. Otherwise the above patterns remain unchanged. +const Use*s. Otherwise the above patterns remain unchanged.

+