[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.132 - 1.133 --- Log message: Modify deleting global variable with an even easier way. --- Diffs of the changes: (+5 -8) ProgrammersManual.html | 13 + 1 files changed, 5 insertions(+), 8 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.132 llvm/docs/ProgrammersManual.html:1.133 --- llvm/docs/ProgrammersManual.html:1.132 Wed Jun 20 13:33:15 2007 +++ llvm/docs/ProgrammersManual.htmlWed Jun 20 15:46:37 2007 @@ -1886,19 +1886,16 @@ div class=doc_text -pDeleting a global variable from a module is similar to deleting an -instruction. First, you must have a pointer to the global variable that you wish - to delete. Second, you must have a pointer to the module the global variable - belongs to. You use the pointer to the module to get its list of global - variables and then use the erase function to remove your global variable. +pDeleting a global variable from a module is just as easy as deleting an +Instruction. First, you must have a pointer to the global variable that you wish + to delete. You use this pointer to erase it from its parent, the module. For example:/p div class=doc_code pre a href=#GlobalVariableGlobalVariable/a *GV = .. ; -a href=#ModuleModule/a *M = GV-gt;getParent(); -M-gt;getGlobaleList().erase(GV); +GV-gt;eraseFromParent(); /pre /div @@ -3086,7 +3083,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/06/20 18:33:15 $ + Last modified: $Date: 2007/06/20 20:46:37 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.129 - 1.130 --- Log message: Stop using the foo HTML tag :) --- Diffs of the changes: (+3 -3) ProgrammersManual.html |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.129 llvm/docs/ProgrammersManual.html:1.130 --- llvm/docs/ProgrammersManual.html:1.129 Thu Mar 1 19:31:31 2007 +++ llvm/docs/ProgrammersManual.htmlWed Mar 28 13:27:57 2007 @@ -803,7 +803,7 @@ div class=doc_code pre for ( ... ) { - std::vectorfoo V; + std::vectorlt;foogt; V; use V; } /pre @@ -813,7 +813,7 @@ div class=doc_code pre -std::vectorfoo V; +std::vectorlt;foogt; V; for ( ... ) { use V; V.clear(); @@ -3060,7 +3060,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/03/02 01:31:31 $ + Last modified: $Date: 2007/03/28 18:27:57 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.127 - 1.128 --- Log message: Clarify the use of getValue/getSExtValue/getZExtValue and add the new APInt constructor. --- Diffs of the changes: (+15 -5) ProgrammersManual.html | 20 +++- 1 files changed, 15 insertions(+), 5 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.127 llvm/docs/ProgrammersManual.html:1.128 --- llvm/docs/ProgrammersManual.html:1.127 Thu Feb 15 22:37:31 2007 +++ llvm/docs/ProgrammersManual.htmlThu Mar 1 15:05:33 2007 @@ -2621,10 +2621,20 @@ liConstantInt : This subclass of Constant represents an integer constant of any width. ul - littint64_t getSExtValue() const/tt: Returns the underlying value of - this constant as a sign extended signed integer value./li - littuint64_t getZExtValue() const/tt: Returns the underlying value - of this constant as a zero extended unsigned integer value./li + littconst APIntamp; getValue() const/tt: Returns the underlying + value of this constant, an APInt value./li + littint64_t getSExtValue() const/tt: Converts the underlying APInt + value to an int64_t via sign extension. If the value (not the bit width) + of the APInt is too large to fit in an int64_t, an assertion will result. + For this reason, use of this method is discouraged./li + littuint64_t getZExtValue() const/tt: Converts the underlying APInt + value to a uint64_t via zero extension. IF the value (not the bit width) + of the APInt is too large to fit in a uint64_t, an assertion will result. + For this reason, use of this method is discourage./li + littstatic ConstantInt* get(const APIntamp; Val)/tt: Returns the + ConstantInt object that represents the value provided by ttVal/tt. + The type is implied as the IntegerType that corresponds to the bit width + of ttVal/tt./li littstatic ConstantInt* get(const Type *Ty, uint64_t Val)/tt: Returns the ConstantInt object that represents the value provided by ttVal/tt for integer type ttTy/tt./li @@ -3050,7 +3060,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/02/16 04:37:31 $ + Last modified: $Date: 2007/03/01 21:05:33 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.128 - 1.129 --- Log message: Fix a typo. --- Diffs of the changes: (+2 -2) ProgrammersManual.html |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.128 llvm/docs/ProgrammersManual.html:1.129 --- llvm/docs/ProgrammersManual.html:1.128 Thu Mar 1 15:05:33 2007 +++ llvm/docs/ProgrammersManual.htmlThu Mar 1 19:31:31 2007 @@ -2630,7 +2630,7 @@ littuint64_t getZExtValue() const/tt: Converts the underlying APInt value to a uint64_t via zero extension. IF the value (not the bit width) of the APInt is too large to fit in a uint64_t, an assertion will result. - For this reason, use of this method is discourage./li + For this reason, use of this method is discouraged./li littstatic ConstantInt* get(const APIntamp; Val)/tt: Returns the ConstantInt object that represents the value provided by ttVal/tt. The type is implied as the IntegerType that corresponds to the bit width @@ -3060,7 +3060,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/03/01 21:05:33 $ + Last modified: $Date: 2007/03/02 01:31:31 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.123 - 1.124 --- Log message: Change a reference to gccas to a reference to opt. --- Diffs of the changes: (+2 -2) ProgrammersManual.html |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.123 llvm/docs/ProgrammersManual.html:1.124 --- llvm/docs/ProgrammersManual.html:1.123 Thu Feb 8 13:14:21 2007 +++ llvm/docs/ProgrammersManual.htmlFri Feb 9 10:00:28 2007 @@ -575,7 +575,7 @@ /pre /div - p When running ttgccas/tt on a C file from the SPEC benchmark + p When running ttopt/tt on a C file from the SPEC benchmark suite, it gives a report that looks like this:/p div class=doc_code @@ -3177,7 +3177,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/02/08 19:14:21 $ + Last modified: $Date: 2007/02/09 16:00:28 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.122 - 1.123 --- Log message: update this. --- Diffs of the changes: (+10 -11) ProgrammersManual.html | 21 ++--- 1 files changed, 10 insertions(+), 11 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.122 llvm/docs/ProgrammersManual.html:1.123 --- llvm/docs/ProgrammersManual.html:1.122 Wed Feb 7 00:24:17 2007 +++ llvm/docs/ProgrammersManual.htmlThu Feb 8 13:14:21 2007 @@ -71,7 +71,7 @@ lia href=#ds_mapMap-Like Containers (std::map, DenseMap, etc)/a ul lia href=#dss_sortedvectormapA sorted 'vector'/a/li - lia href=#dss_cstringmapllvm/ADT/CStringMap.h/a/li + lia href=#dss_stringmapllvm/ADT/StringMap.h/a/li lia href=#dss_indexedmapllvm/ADT/IndexedMap.h/a/li lia href=#dss_densemapllvm/ADT/DenseMap.h/a/li lia href=#dss_maplt;mapgt;/a/li @@ -1152,7 +1152,7 @@ !-- ___ -- div class=doc_subsubsection - a name=dss_cstringmapllvm/ADT/CStringMap.h/a + a name=dss_stringmapllvm/ADT/StringMap.h/a /div div class=doc_text @@ -1160,12 +1160,11 @@ p Strings are commonly used as keys in maps, and they are difficult to support efficiently: they are variable length, inefficient to hash and compare when -long, expensive to copy, etc. CStringMap is a specialized container designed to -cope with these issues. It supports mapping an arbitrary range of bytes that -does not have an embedded nul character in it (C strings) to an arbitrary -other object./p +long, expensive to copy, etc. StringMap is a specialized container designed to +cope with these issues. It supports mapping an arbitrary range of bytes to an +arbitrary other object./p -pThe CStringMap implementation uses a quadratically-probed hash table, where +pThe StringMap implementation uses a quadratically-probed hash table, where the buckets store a pointer to the heap allocated entries (and some other stuff). The entries in the map must be heap allocated because the strings are variable length. The string data (key) and the element object (value) are @@ -1173,15 +1172,15 @@ object. This container guarantees the tt(char*)(amp;Value+1)/tt points to the key string for a value./p -pThe CStringMap is very fast for several reasons: quadratic probing is very +pThe 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, CStringMap rarely has to touch the +recomputed when lookup 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 (the string data is stored in the same allocation as the Value of a pair)./p -pCStringMap also provides query methods that take byte ranges, so it only ever +pStringMap also provides query methods that take byte ranges, so it only ever copies a string if a value is inserted into the table./p /div @@ -3178,7 +3177,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/02/07 06:24:17 $ + Last modified: $Date: 2007/02/08 19:14:21 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.121 - 1.122 --- Log message: remove some obsolete SymbolTable methods. These docs need to be updated now that PR411: http://llvm.org/PR411 landed --- Diffs of the changes: (+1 -20) ProgrammersManual.html | 21 + 1 files changed, 1 insertion(+), 20 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.121 llvm/docs/ProgrammersManual.html:1.122 --- llvm/docs/ProgrammersManual.html:1.121 Mon Feb 5 00:30:51 2007 +++ llvm/docs/ProgrammersManual.htmlWed Feb 7 00:24:17 2007 @@ -2122,11 +2122,6 @@ have both a name and a type which are extracted and used to place the value in the correct type plane under the value's name./dd - dtttvoid insert(const std::stringamp; Name, Value *Val)/tt:/dt - dd Inserts a constant or type into the symbol table with the specified - name. There can be a many to one mapping between names and constants - or types./dd - dtttvoid remove(Value* Val)/tt:/dt dd This method removes a named value from the symbol table. The type and name of the Value are extracted from \p N and used to @@ -2134,20 +2129,6 @@ not in the symbol table, this method silently ignores the request./dd - dtttValue* remove(const std::stringamp; Name, Value *Val)/tt:/dt - dd Remove a constant or type with the specified name from the - symbol table./dd - - dtttValue *remove(const value_iteratoramp; It)/tt:/dt - dd Removes a specific value from the symbol table. - Returns the removed value./dd - - dtttbool strip()/tt:/dt - dd This method will strip the symbol table of its names leaving - the type and values. /dd - - dtttvoid clear()/tt:/dt - ddEmpty the symbol table completely./dd /dl h3Iteration/h3 @@ -3197,7 +3178,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/02/05 06:30:51 $ + Last modified: $Date: 2007/02/07 06:24:17 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.110 - 1.111 --- Log message: close run-away tag --- Diffs of the changes: (+2 -2) ProgrammersManual.html |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.110 llvm/docs/ProgrammersManual.html:1.111 --- llvm/docs/ProgrammersManual.html:1.110 Sat Feb 3 01:59:07 2007 +++ llvm/docs/ProgrammersManual.htmlSat Feb 3 01:59:51 2007 @@ -904,7 +904,7 @@ div class=doc_text pIf you have a set-like datastructure that is usually small and whose elements -are reasonably small, a ttSmallSetlt;Type, Ngt; is a good choice. This set +are reasonably small, a ttSmallSetlt;Type, Ngt;/tt is a good choice. This set has space for N elements in place (thus, if the set is dynamically smaller than N, no malloc traffic is required) and access them with a simple linear search. When the set grows beyond 'N', it allocates a more expensive representation that @@ -2989,7 +2989,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/02/03 07:59:07 $ + Last modified: $Date: 2007/02/03 07:59:51 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.111 - 1.112 --- Log message: improve grammar --- Diffs of the changes: (+13 -10) ProgrammersManual.html | 23 +-- 1 files changed, 13 insertions(+), 10 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.111 llvm/docs/ProgrammersManual.html:1.112 --- llvm/docs/ProgrammersManual.html:1.111 Sat Feb 3 01:59:51 2007 +++ llvm/docs/ProgrammersManual.htmlSat Feb 3 02:10:45 2007 @@ -884,15 +884,18 @@ div class=doc_text -pIf you intend to insert a lot of elements, then do a lot of queries, one -great approach is to use a vector (or other sequential container), and then use +pIf you intend to insert a lot of elements, then do a lot of queries, a +great approach is to use a vector (or other sequential container) with std::sort+std::unique to remove duplicates. This approach works really well if -your usage pattern has these two distinct phases (insert then query), and, -coupled with a good choice of a href=#ds_sequentialsequential container/a -can provide the several nice properties: the result data is contiguous in memory -(good for cache locality), has few allocations, is easy to address (iterators in -the final vector are just indices or pointers), and can be efficiently queried -with a standard binary search./p +your usage pattern has these two distinct phases (insert then query), and can be +coupled with a good choice of a href=#ds_sequentialsequential container/a. +/p + +p +This combination provides the several nice properties: the result data is +contiguous in memory (good for cache locality), has few allocations, is easy to +address (iterators in the final vector are just indices or pointers), and can be +efficiently queried with a standard binary or radix search./p /div @@ -983,7 +986,7 @@ div class=doc_text pstd::set is a reasonable all-around set class, which is good at many things -but great at nothing. std::set use a allocates memory for every single element +but great at nothing. std::set allocates memory for each element inserted (thus it is very malloc intensive) and typically stores three pointers with every element (thus adding a large amount of per-element space overhead). It offers guaranteed log(n) performance, which is not particularly fast. @@ -2989,7 +2992,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/02/03 07:59:51 $ + Last modified: $Date: 2007/02/03 08:10:45 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.112 - 1.113 --- Log message: improve grammar --- Diffs of the changes: (+25 -22) ProgrammersManual.html | 47 +-- 1 files changed, 25 insertions(+), 22 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.112 llvm/docs/ProgrammersManual.html:1.113 --- llvm/docs/ProgrammersManual.html:1.112 Sat Feb 3 02:10:45 2007 +++ llvm/docs/ProgrammersManual.htmlSat Feb 3 02:20:15 2007 @@ -909,10 +909,10 @@ pIf you have a set-like datastructure that is usually small and whose elements are reasonably small, a ttSmallSetlt;Type, Ngt;/tt is a good choice. This set has space for N elements in place (thus, if the set is dynamically smaller than -N, no malloc traffic is required) and access them with a simple linear search. -When the set grows beyond 'N', it allocates a more expensive representation that +N, no malloc traffic is required) and accesses them with a simple linear search. +When the set grows beyond 'N' elements, it allocates a more expensive representation that guarantees efficient access (for most types, it falls back to std::set, but for -pointers it uses something far better, see a +pointers it uses something far better, a href=#dss_smallptrsetSmallPtrSet/a)./p pThe magic of this class is that it handles small sets extremely efficiently, @@ -931,7 +931,7 @@ pSmallPtrSet has all the advantages of SmallSet (and a SmallSet of pointers is transparently implemented with a SmallPtrSet), but also suports iterators. If -more than 'N' allocations are performed, a single quadratically +more than 'N' insertions are performed, a single quadratically probed hash table is allocated and grows as needed, providing extremely efficient access (constant time insertion/deleting/queries with low constant factors) and is very stingy with malloc traffic./p @@ -953,21 +953,22 @@ FoldingSet is an aggregate class that is really good at uniquing expensive-to-create or polymorphic objects. It is a combination of a chained hash table with intrusive links (uniqued objects are required to inherit from -FoldingSetNode) that uses SmallVector as part of its ID process./p +FoldingSetNode) that uses a href=#dss_smallvectorSmallVector/a as part of +its ID process./p -pConsider a case where you want to implement a getorcreate_foo method for +pConsider a case where you want to implement a getOrCreateFoo method for a complex object (for example, a node in the code generator). The client has a description of *what* it wants to generate (it knows the opcode and all the operands), but we don't want to 'new' a node, then try inserting it into a set -only to find out it already exists (at which point we would have to delete it -and return the node that already exists). +only to find out it already exists, at which point we would have to delete it +and return the node that already exists. /p pTo support this style of client, FoldingSet perform a query with a FoldingSetNodeID (which wraps SmallVector) that can be used to describe the element that we want to query for. The query either returns the element matching the ID or it returns an opaque ID that indicates where insertion should -take place./p +take place. Construction of the ID usually does not require heap traffic./p pBecause FoldingSet uses intrusive links, it can support polymorphic objects in the set (for example, you can have SDNode instances mixed with LoadSDNodes). @@ -985,14 +986,15 @@ div class=doc_text -pstd::set is a reasonable all-around set class, which is good at many things -but great at nothing. std::set allocates memory for each element +pttstd::set/t is a reasonable all-around set class, which is good at many +things but great at nothing. std::set allocates memory for each element inserted (thus it is very malloc intensive) and typically stores three pointers -with every element (thus adding a large amount of per-element space overhead). -It offers guaranteed log(n) performance, which is not particularly fast. -/p +per element in the set (thus adding a large amount of per-element space +overhead). It offers guaranteed log(n) performance, which is not particularly +fast, particularly if the elements of the set are expensive to compare (e.g. +strings)./p -pThe advantages of std::set is that its iterators are stable (deleting or +pThe advantages of std::set are that its iterators are stable (deleting or inserting an element from the set does not affect iterators or pointers to other elements) and that iteration over the set is guaranteed to be in sorted order. If the elements in the set are large, then the relative overhead of the pointers @@ -1044,16 +1046,17 @@ hash_set like containers (whether from C++TR1 or from the SGI library)./p pstd::multiset is useful if you're not interested in elimination of -duplicates, but has all the drawbacks
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.113 - 1.114 --- Log message: describe map-like containers --- Diffs of the changes: (+177 -16) ProgrammersManual.html | 193 - 1 files changed, 177 insertions(+), 16 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.113 llvm/docs/ProgrammersManual.html:1.114 --- llvm/docs/ProgrammersManual.html:1.113 Sat Feb 3 02:20:15 2007 +++ llvm/docs/ProgrammersManual.htmlSat Feb 3 13:49:31 2007 @@ -55,6 +55,7 @@ lia href=#dss_dequelt;dequegt;/a/li lia href=#dss_listlt;listgt;/a/li lia href=#dss_ilistllvm/ADT/ilist/a/li + lia href=#dss_otherOther Sequential Container Options/a/li /ul/li lia href=#ds_setSet-Like Containers (std::set, SmallSet, SetVector, etc)/a ul @@ -64,7 +65,8 @@ lia href=#dss_FoldingSetllvm/ADT/FoldingSet.h/a/li lia href=#dss_setlt;setgt;/a/li lia href=#dss_setvectorllvm/ADT/SetVector.h/a/li - lia href=#dss_othersetOther Options/a/li + lia href=#dss_uniquevectorllvm/ADT/UniqueVector.h/a/li + lia href=#dss_othersetOther Set-Like ContainerOptions/a/li /ul/li lia href=#ds_mapMap-Like Containers (std::map, DenseMap, etc)/a/li /ul @@ -850,7 +852,7 @@ !-- ___ -- div class=doc_subsubsection - a name=dss_otherOther options/a + a name=dss_otherOther Sequential Container options/a /div div class=doc_text @@ -986,13 +988,14 @@ div class=doc_text -pttstd::set/t is a reasonable all-around set class, which is good at many -things but great at nothing. std::set allocates memory for each element +pttstd::set/tt is a reasonable all-around set class, which is decent at +many things but great at nothing. std::set allocates memory for each element inserted (thus it is very malloc intensive) and typically stores three pointers per element in the set (thus adding a large amount of per-element space overhead). It offers guaranteed log(n) performance, which is not particularly -fast, particularly if the elements of the set are expensive to compare (e.g. -strings)./p +fast from a complexity standpoint (particularly if the elements of the set are +expensive to compare, like strings), and has extremely high constant factors for +lookup, insertion and removal./p pThe advantages of std::set are that its iterators are stable (deleting or inserting an element from the set does not affect iterators or pointers to other @@ -1036,14 +1039,34 @@ !-- ___ -- div class=doc_subsubsection - a name=dss_othersetOther Options/a + a name=dss_uniquevectorllvm/ADT/UniqueVector.h/a +/div + +div class=doc_text + +p +UniqueVector is similar to a href=#dss_setvectorSetVector/a, but it +retains a unique ID for each element inserted into the set. It internally +contains a map and a vector, and it assigns a unique ID for each value inserted +into the set./p + +pUniqueVector is very expensive: its cost is the sum of the cost of +maintaining both the map and vector, it has high complexity, high constant +factors, and produces a lot of malloc traffic. It should be avoided./p + +/div + + +!-- ___ -- +div class=doc_subsubsection + a name=dss_othersetOther Set-Like Container Options/a /div div class=doc_text p The STL provides several other options, such as std::multiset and the various -hash_set like containers (whether from C++TR1 or from the SGI library)./p +hash_set like containers (whether from C++ TR1 or from the SGI library)./p pstd::multiset is useful if you're not interested in elimination of duplicates, but has all the drawbacks of std::set. A sorted vector (where you @@ -1066,13 +1089,151 @@ /div div class=doc_text -sorted vector -std::map -DenseMap -UniqueVector -IndexedMap -hash_map -CStringMap +Map-like containers are useful when you want to associate data to a key. As +usual, there are a lot of different ways to do this. :) +/div + +!-- ___ -- +div class=doc_subsubsection + a name=dss_sortedvectormapA sorted 'vector'/a +/div + +div class=doc_text + +p +If your usage pattern follows a strict insert-then-query approach, you can +trivially use the same approach as a href=#dss_sortedvectorsetsorted vectors +for set-like containers/a. The only difference is that your query function +(which uses std::lower_bound to get efficient log(n) lookup) should only compare +the key, not both the key and value. This yields the same advantages as sorted +vectors for sets. +/p +/div + +!-- ___ -- +div class=doc_subsubsection + a name=dss_cstringmapllvm/ADT/CStringMap.h/a +/div + +div
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.114 - 1.115 --- Log message: Add TOC --- Diffs of the changes: (+10 -2) ProgrammersManual.html | 12 ++-- 1 files changed, 10 insertions(+), 2 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.114 llvm/docs/ProgrammersManual.html:1.115 --- llvm/docs/ProgrammersManual.html:1.114 Sat Feb 3 13:49:31 2007 +++ llvm/docs/ProgrammersManual.htmlSat Feb 3 13:51:56 2007 @@ -68,7 +68,15 @@ lia href=#dss_uniquevectorllvm/ADT/UniqueVector.h/a/li lia href=#dss_othersetOther Set-Like ContainerOptions/a/li /ul/li -lia href=#ds_mapMap-Like Containers (std::map, DenseMap, etc)/a/li +lia href=#ds_mapMap-Like Containers (std::map, DenseMap, etc)/a +ul + lia href=#dss_sortedvectormapA sorted 'vector'/a/li + lia href=#dss_cstringmapllvm/ADT/CStringMap.h/a/li + lia href=#dss_indexedmapllvm/ADT/IndexedMap.h/a/li + lia href=#dss_densemapllvm/ADT/DenseMap.h/a/li + lia href=#dss_maplt;mapgt;/a/li + lia href=#dss_othermapOther Map-Like Container Options/a/li +/ul/li /ul /li lia href=#commonHelpful Hints for Common Operations/a @@ -3156,7 +3164,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/02/03 19:49:31 $ + Last modified: $Date: 2007/02/03 19:51:56 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.115 - 1.116 --- Log message: Serious cleanups. Make the TOC match the text for the class hierarchy, move the sections of the class-h around in the right order, make it actually reflect the classes in LLVM today. --- Diffs of the changes: (+248 -251) ProgrammersManual.html | 499 - 1 files changed, 248 insertions(+), 251 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.115 llvm/docs/ProgrammersManual.html:1.116 --- llvm/docs/ProgrammersManual.html:1.115 Sat Feb 3 13:51:56 2007 +++ llvm/docs/ProgrammersManual.htmlSat Feb 3 14:02:25 2007 @@ -135,31 +135,27 @@ lia href=#coreclassesThe Core LLVM Class Hierarchy Reference/a ul lia href=#TypeThe ttType/tt class/a /li + lia href=#ModuleThe ttModule/tt class/a/li lia href=#ValueThe ttValue/tt class/a + ul +lia href=#UserThe ttUser/tt class/a ul - lia href=#UserThe ttUser/tt class/a + lia href=#InstructionThe ttInstruction/tt class/a/li + lia href=#ConstantThe ttConstant/tt class/a + ul +lia href=#GlobalValueThe ttGlobalValue/tt class/a ul - lia href=#InstructionThe ttInstruction/tt class/a -ul - lia href=#GetElementPtrInstThe ttGetElementPtrInst/tt class/a/li -/ul - /li - lia href=#ModuleThe ttModule/tt class/a/li - lia href=#ConstantThe ttConstant/tt class/a - ul - lia href=#GlobalValueThe ttGlobalValue/tt class/a -ul - lia href=#BasicBlockThe ttBasicBlock/ttclass/a/li - lia href=#FunctionThe ttFunction/tt class/a/li - lia href=#GlobalVariableThe ttGlobalVariable/tt class/a/li -/ul - /li -/ul - /li - /ul - /li - lia href=#ArgumentThe ttArgument/tt class/a/li + lia href=#FunctionThe ttFunction/tt class/a/li + lia href=#GlobalVariableThe ttGlobalVariable/tt class/a/li +/ul +/li + /ul + /li /ul +/li +lia href=#BasicBlockThe ttBasicBlock/tt class/a/li +lia href=#ArgumentThe ttArgument/tt class/a/li + /ul /li /ul /li @@ -2334,12 +2330,141 @@ /dl /div + + +!-- === -- +div class=doc_subsection + a name=ModuleThe ttModule/tt class/a +/div + +div class=doc_text + +ptt#include a +href=/doxygen/Module_8h-source.htmlllvm/Module.h/a/ttbr doxygen info: +a href=/doxygen/classllvm_1_1Module.htmlModule Class/a/p + +pThe ttModule/tt class represents the top level structure present in LLVM +programs. An LLVM module is effectively either a translation unit of the +original program or a combination of several translation units merged by the +linker. The ttModule/tt class keeps track of a list of a +href=#FunctionttFunction/tt/as, a list of a +href=#GlobalVariablettGlobalVariable/tt/as, and a a +href=#SymbolTablettSymbolTable/tt/a. Additionally, it contains a few +helpful member functions that try to make common operations easy./p + +/div + +!-- ___ -- +div class=doc_subsubsection + a name=m_ModuleImportant Public Members of the ttModule/tt class/a +/div + +div class=doc_text + +ul + littModule::Module(std::string name = )/tt/li +/ul + +pConstructing a a href=#ModuleModule/a is easy. You can optionally +provide a name for it (probably based on the name of the translation unit)./p + +ul + littModule::iterator/tt - Typedef for function list iteratorbr +ttModule::const_iterator/tt - Typedef for const_iterator.br + +ttbegin()/tt, ttend()/tt +ttsize()/tt, ttempty()/tt + +pThese are forwarding methods that make it easy to access the contents of +a ttModule/tt object's a href=#FunctionttFunction/tt/a +list./p/li + + littModule::FunctionListType amp;getFunctionList()/tt + +p Returns the list of a href=#FunctionttFunction/tt/as. This is +necessary to use when you need to update the list or perform a complex +action that doesn't have a forwarding method./p + +p!-- Global Variable --/p/li +/ul + +hr + +ul + littModule::global_iterator/tt - Typedef for global variable list iteratorbr + +ttModule::const_global_iterator/tt - Typedef for const_iterator.br + +ttglobal_begin()/tt, ttglobal_end()/tt +ttglobal_size()/tt, ttglobal_empty()/tt + +p These are forwarding methods that make it easy to access the contents of +a ttModule/tt object's a +href=#GlobalVariablettGlobalVariable/tt/a list./p/li + + littModule::GlobalListType amp;getGlobalList()/tt + +pReturns the
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.116 - 1.117 --- Log message: fix grammar --- Diffs of the changes: (+4 -4) ProgrammersManual.html |8 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.116 llvm/docs/ProgrammersManual.html:1.117 --- llvm/docs/ProgrammersManual.html:1.116 Sat Feb 3 14:02:25 2007 +++ llvm/docs/ProgrammersManual.htmlSat Feb 3 14:17:53 2007 @@ -1187,11 +1187,11 @@ There are several aspects of DenseMap that you should be aware of, however. The iterators in a densemap are invalidated whenever an insertion occurs, unlike map. Also, because DenseMap allocates space for a large number of key/value -pairs (it starts with 64 by default) if you have large keys or values, it can -waste a lot of space. Finally, you must implement a partial specialization of +pairs (it starts with 64 by default), it will waste a lot of space if your keys +or values are large. Finally, you must implement a partial specialization of DenseMapKeyInfo for the key that you want, if it isn't already supported. This is required to tell DenseMap about two special marker values (which can never be -inserted into the map)./p +inserted into the map) that it needs internally./p /div @@ -3161,7 +3161,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/02/03 20:02:25 $ + Last modified: $Date: 2007/02/03 20:17:53 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.117 - 1.118 --- Log message: Fix some spellos. --- Diffs of the changes: (+20 -20) ProgrammersManual.html | 40 1 files changed, 20 insertions(+), 20 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.117 llvm/docs/ProgrammersManual.html:1.118 --- llvm/docs/ProgrammersManual.html:1.117 Sat Feb 3 14:17:53 2007 +++ llvm/docs/ProgrammersManual.htmlSat Feb 3 15:06:43 2007 @@ -645,14 +645,14 @@ toolkit, and make sure 'dot' and 'gv' are in your path. If you are running on Mac OS/X, download and install the Mac OS/X a href=http://www.pixelglow.com/graphviz/;Graphviz program/a, and add -tt/Applications/Graphviz.app/Contents/MacOS//tt (or whereever you install +tt/Applications/Graphviz.app/Contents/MacOS//tt (or wherever you install it) to your path. Once in your system and path are set up, rerun the LLVM configure script and rebuild LLVM to enable this functionality./p pttSelectionDAG/tt has been extended to make it easier to locate iinteresting/i nodes in large complex graphs. From gdb, if you ttcall DAG.setGraphColor(inode/i, icolor/i)/tt, then the -next ttcall DAG.viewGraph()/tt would hilight the node in the +next ttcall DAG.viewGraph()/tt would highlight the node in the specified color (choices of colors can be found at a href=http://www.graphviz.org/doc/info/colors.html;colors/a.) More complex node attributes can be provided with ttcall @@ -671,8 +671,8 @@ div class=doc_text -pLLVM has a plethora of datastructures in the ttllvm/ADT//tt directory, - and we commonly use STL datastructures. This section describes the tradeoffs +pLLVM has a plethora of data structures in the ttllvm/ADT//tt directory, + and we commonly use STL data structures. This section describes the trade-offs you should consider when you pick one./p p @@ -682,7 +682,7 @@ access the container. Based on that, you should use:/p ul -lia a href=#ds_mapmap-like/a container if you need efficient lookup +lia a href=#ds_mapmap-like/a container if you need efficient look-up of an value based on another value. Map-like containers also support efficient queries for containment (whether a key is in the map). Map-like containers generally do not support efficient reverse mapping (values to @@ -701,15 +701,15 @@ lia a href=#ds_sequentialsequential/a container provides the most efficient way to add elements and keeps track of the order they are added to the collection. They permit duplicates and support efficient -iteration, but do not support efficient lookup based on a key. +iteration, but do not support efficient look-up based on a key. /li /ul p -Once the proper catagory of container is determined, you can fine tune the +Once the proper category of container is determined, you can fine tune the memory use, constant factors, and cache behaviors of access by intelligently -picking a member of the catagory. Note that constant factors and cache behavior +picking a member of the category. Note that constant factors and cache behavior can be a big deal. If you have a vector that usually only contains a few elements (but could contain many), for example, it's much better to use a href=#dss_smallvectorSmallVector/a than a href=#dss_vectorvector/a @@ -751,7 +751,7 @@ consider a a href=#dss_smallvectorSmallVector/a). The cost of a heap allocated array is the cost of the new/delete (aka malloc/free). Also note that if you are allocating an array of a type with a constructor, the constructor and -destructors will be run for every element in the array (resizable vectors only +destructors will be run for every element in the array (re-sizable vectors only construct those elements actually used)./p /div @@ -912,7 +912,7 @@ div class=doc_text -pIf you have a set-like datastructure that is usually small and whose elements +pIf you have a set-like data structure that is usually small and whose elements are reasonably small, a ttSmallSetlt;Type, Ngt;/tt is a good choice. This set has space for N elements in place (thus, if the set is dynamically smaller than N, no malloc traffic is required) and accesses them with a simple linear search. @@ -936,7 +936,7 @@ div class=doc_text pSmallPtrSet has all the advantages of SmallSet (and a SmallSet of pointers is -transparently implemented with a SmallPtrSet), but also suports iterators. If +transparently implemented with a SmallPtrSet), but also supports iterators. If more than 'N' insertions are performed, a single quadratically probed hash table is allocated and grows as needed, providing extremely efficient access (constant time insertion/deleting/queries with low constant @@ -1126,7 +1126,7 @@ efficiently: they are variable length, inefficient to hash and compare when long, expensive to copy, etc. CStringMap is a specialized
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.118 - 1.119 --- Log message: null - pointer, nul - character :) --- Diffs of the changes: (+2 -2) ProgrammersManual.html |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.118 llvm/docs/ProgrammersManual.html:1.119 --- llvm/docs/ProgrammersManual.html:1.118 Sat Feb 3 15:06:43 2007 +++ llvm/docs/ProgrammersManual.htmlSat Feb 3 16:04:27 2007 @@ -1126,7 +1126,7 @@ efficiently: they are variable length, inefficient to hash and compare when long, expensive to copy, etc. CStringMap is a specialized container designed to cope with these issues. It supports mapping an arbitrary range of bytes that -does not have an embedded null character in it (C strings) to an arbitrary +does not have an embedded nul character in it (C strings) to an arbitrary other object./p pThe CStringMap implementation uses a quadratically-probed hash table, where @@ -3161,7 +3161,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/02/03 21:06:43 $ + Last modified: $Date: 2007/02/03 22:04:27 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/docs/ProgrammersManual.html
On Sat, 2007-02-03 at 16:04 -0600, Chris Lattner wrote: Changes in directory llvm/docs: ProgrammersManual.html updated: 1.118 - 1.119 --- Log message: null - pointer, nul - character :) nul is not a word, null is :) --- Diffs of the changes: (+2 -2) ProgrammersManual.html |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.118 llvm/docs/ProgrammersManual.html:1.119 --- llvm/docs/ProgrammersManual.html:1.118Sat Feb 3 15:06:43 2007 +++ llvm/docs/ProgrammersManual.html Sat Feb 3 16:04:27 2007 @@ -1126,7 +1126,7 @@ efficiently: they are variable length, inefficient to hash and compare when long, expensive to copy, etc. CStringMap is a specialized container designed to cope with these issues. It supports mapping an arbitrary range of bytes that -does not have an embedded null character in it (C strings) to an arbitrary +does not have an embedded nul character in it (C strings) to an arbitrary other object./p pThe CStringMap implementation uses a quadratically-probed hash table, where @@ -3161,7 +3161,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/02/03 21:06:43 $ + Last modified: $Date: 2007/02/03 22:04:27 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/docs/ProgrammersManual.html
On Sat, 3 Feb 2007, Reid Spencer wrote: ProgrammersManual.html updated: 1.118 - 1.119 --- Log message: null - pointer, nul - character :) nul is not a word, null is :) man ascii. 'bel' is not a word either :) --- Diffs of the changes: (+2 -2) ProgrammersManual.html |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.118 llvm/docs/ProgrammersManual.html:1.119 --- llvm/docs/ProgrammersManual.html:1.118 Sat Feb 3 15:06:43 2007 +++ llvm/docs/ProgrammersManual.html Sat Feb 3 16:04:27 2007 @@ -1126,7 +1126,7 @@ efficiently: they are variable length, inefficient to hash and compare when long, expensive to copy, etc. CStringMap is a specialized container designed to cope with these issues. It supports mapping an arbitrary range of bytes that -does not have an embedded null character in it (C strings) to an arbitrary +does not have an embedded nul character in it (C strings) to an arbitrary other object./p pThe CStringMap implementation uses a quadratically-probed hash table, where @@ -3161,7 +3161,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/02/03 21:06:43 $ + Last modified: $Date: 2007/02/03 22:04:27 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -Chris -- http://nondot.org/sabre/ http://llvm.org/ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/docs/ProgrammersManual.html
On Sat, 2007-02-03 at 14:25 -0800, Chris Lattner wrote: On Sat, 3 Feb 2007, Reid Spencer wrote: ProgrammersManual.html updated: 1.118 - 1.119 --- Log message: null - pointer, nul - character :) nul is not a word, null is :) man ascii. 'bel' is not a word either :) http://dictionary.reference.com/search?q=nul :) --- Diffs of the changes: (+2 -2) ProgrammersManual.html |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.118 llvm/docs/ProgrammersManual.html:1.119 --- llvm/docs/ProgrammersManual.html:1.118 Sat Feb 3 15:06:43 2007 +++ llvm/docs/ProgrammersManual.html Sat Feb 3 16:04:27 2007 @@ -1126,7 +1126,7 @@ efficiently: they are variable length, inefficient to hash and compare when long, expensive to copy, etc. CStringMap is a specialized container designed to cope with these issues. It supports mapping an arbitrary range of bytes that -does not have an embedded null character in it (C strings) to an arbitrary +does not have an embedded nul character in it (C strings) to an arbitrary other object./p pThe CStringMap implementation uses a quadratically-probed hash table, where @@ -3161,7 +3161,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/02/03 21:06:43 $ + Last modified: $Date: 2007/02/03 22:04:27 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/docs/ProgrammersManual.html
On Feb 3, 2007, at 2:17 PM, Reid Spencer wrote: On Sat, 2007-02-03 at 14:25 -0800, Chris Lattner wrote: On Sat, 3 Feb 2007, Reid Spencer wrote: ProgrammersManual.html updated: 1.118 - 1.119 --- Log message: null - pointer, nul - character :) nul is not a word, null is :) man ascii. 'bel' is not a word either :) http://dictionary.reference.com/search?q=nul :) http://www.acronymfinder.com/af-query.asp?Acronym=NULp=dict ! :) -Chris --- Diffs of the changes: (+2 -2) ProgrammersManual.html |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.118 llvm/docs/ ProgrammersManual.html:1.119 --- llvm/docs/ProgrammersManual.html:1.118 Sat Feb 3 15:06:43 2007 +++ llvm/docs/ProgrammersManual.html Sat Feb 3 16:04:27 2007 @@ -1126,7 +1126,7 @@ efficiently: they are variable length, inefficient to hash and compare when long, expensive to copy, etc. CStringMap is a specialized container designed to cope with these issues. It supports mapping an arbitrary range of bytes that -does not have an embedded null character in it (C strings) to an arbitrary +does not have an embedded nul character in it (C strings) to an arbitrary other object./p pThe CStringMap implementation uses a quadratically-probed hash table, where @@ -3161,7 +3161,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/ abr - Last modified: $Date: 2007/02/03 21:06:43 $ + Last modified: $Date: 2007/02/03 22:04:27 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/docs/ProgrammersManual.html
On Sat, 2007-02-03 at 14:22 -0800, Chris Lattner wrote: On Feb 3, 2007, at 2:17 PM, Reid Spencer wrote: On Sat, 2007-02-03 at 14:25 -0800, Chris Lattner wrote: On Sat, 3 Feb 2007, Reid Spencer wrote: ProgrammersManual.html updated: 1.118 - 1.119 --- Log message: null - pointer, nul - character :) nul is not a word, null is :) man ascii. 'bel' is not a word either :) http://dictionary.reference.com/search?q=nul :) http://www.acronymfinder.com/af-query.asp?Acronym=NULp=dict ! :) Sheesh .. you win .. bastardize the language all you want :) -Chris --- Diffs of the changes: (+2 -2) ProgrammersManual.html |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.118 llvm/docs/ ProgrammersManual.html:1.119 --- llvm/docs/ProgrammersManual.html:1.118 Sat Feb 3 15:06:43 2007 +++ llvm/docs/ProgrammersManual.html Sat Feb 3 16:04:27 2007 @@ -1126,7 +1126,7 @@ efficiently: they are variable length, inefficient to hash and compare when long, expensive to copy, etc. CStringMap is a specialized container designed to cope with these issues. It supports mapping an arbitrary range of bytes that -does not have an embedded null character in it (C strings) to an arbitrary +does not have an embedded nul character in it (C strings) to an arbitrary other object./p pThe CStringMap implementation uses a quadratically-probed hash table, where @@ -3161,7 +3161,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/ abr - Last modified: $Date: 2007/02/03 21:06:43 $ + Last modified: $Date: 2007/02/03 22:04:27 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.119 - 1.120 --- Log message: describe SmallSetVector --- Diffs of the changes: (+14 -5) ProgrammersManual.html | 19 ++- 1 files changed, 14 insertions(+), 5 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.119 llvm/docs/ProgrammersManual.html:1.120 --- llvm/docs/ProgrammersManual.html:1.119 Sat Feb 3 16:04:27 2007 +++ llvm/docs/ProgrammersManual.htmlSat Feb 3 18:00:26 2007 @@ -1016,8 +1016,9 @@ /div div class=doc_text -pLLVM's SetVectorlt;Typegt; is actually a combination of a set along with -a a href=#ds_sequentialSequential Container/a. The important property +pLLVM's SetVectorlt;Typegt; is an adapter class that combines your choice of +a set-like container along with a a href=#ds_sequentialSequential +Container/a. The important property that this provides is efficient insertion with uniquing (duplicate elements are ignored) with iteration support. It implements this by inserting elements into both a set-like container and the sequential container, using the set-like @@ -1028,7 +1029,7 @@ iteration is guaranteed to match the order of insertion into the SetVector. This property is really important for things like sets of pointers. Because pointer values are non-deterministic (e.g. vary across runs of the program on -different machines), iterating over the pointers in a std::set or other set will +different machines), iterating over the pointers in the set will not be in a well-defined order./p p @@ -1036,9 +1037,17 @@ set and has the sum of constant factors from the set-like container and the sequential container that it uses. Use it *only* if you need to iterate over the elements in a deterministic order. SetVector is also expensive to delete -elements out of (linear time). +elements out of (linear time), unless you use it's pop_back method, which is +faster. /p +pSetVector is an adapter class that defaults to using std::vector and std::set +for the underlying containers, so it is quite expensive. However, +ttllvm/ADT/SetVector.h/tt also provides a SmallSetVector class, which +defaults to using a SmallVector and SmallSet of a specified size. If you use +this, and if your sets are dynamically smaller than N, you will save a lot of +heap traffic./p + /div !-- ___ -- @@ -3161,7 +3170,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/02/03 22:04:27 $ + Last modified: $Date: 2007/02/04 00:00:26 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.106 - 1.107 --- Log message: Add some notes about choice of container. --- Diffs of the changes: (+240 -1) ProgrammersManual.html | 241 - 1 files changed, 240 insertions(+), 1 deletion(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.106 llvm/docs/ProgrammersManual.html:1.107 --- llvm/docs/ProgrammersManual.html:1.106 Sun Jan 14 19:55:32 2007 +++ llvm/docs/ProgrammersManual.htmlFri Feb 2 21:04:03 2007 @@ -44,6 +44,20 @@ lia href=#ViewGraphViewing graphs while debugging code/a/li /ul /li + lia href=#datastructurePicking the Right Data Structure for a Task/a +ul +lia href=#ds_sequentialSequential Containers (std::vector, std::list, etc)/aul +lia href=#dss_fixedarraysFixed Size Arrays/a/li +lia href=#dss_heaparraysHeap Allocated Arrays/a/li +lia href=#dss_smallvectorllvm/ADT/SmallVector.h/a/li +lia href=#dss_vectorlt;vectorgt;/a/li +lia href=#dss_ilistllvm/ADT/ilist/a/li +lia href=#dss_listlt;listgt;/a/li +/ul/li +lia href=#ds_setSet-Like Containers (std::set, SmallSet, SetVector, etc)/a/li +lia href=#ds_mapMap-Like Containers (std::map, DenseMap, etc)/a/li +/ul + /li lia href=#commonHelpful Hints for Common Operations/a ul lia href=#inspectionBasic Inspection and Traversal Routines/a @@ -632,6 +646,231 @@ /div +!-- *** -- +div class=doc_section + a name=datastructurePicking the Right Data Structure for a Task/a +/div +!-- *** -- + +div class=doc_text + +pLLVM has a plethora of datastructures in the ttllvm/ADT//tt directory, + and we commonly use STL datastructures. This section describes the tradeoffs + you should consider when you pick one./p + +p +The first step is a choose your own adventure: do you want a sequential +container, a set-like container, or a map-like container? The most important +thing when choosing a container is the algorithmic properties of how you plan to +access the container. Based on that, you should use:/p + +ul +lia a href=#ds_mapmap-like/a container if you need efficient lookup +of an value based on another value. Map-like containers also support +efficient queries for containment (whether a key is in the map). Map-like +containers generally do not support efficient reverse mapping (values to +keys). If you need that, use two maps. Some map-like containers also +support efficient iteration through the keys in sorted order. Map-like +containers are the most expensive sort, only use them if you need one of +these capabilities./li + +lia a href=#ds_setset-like/a container if you need to put a bunch of +stuff into a container that automatically eliminates duplicates. Some +set-like containers support efficient iteration through the elements in +sorted order. Set-like containers are more expensive than sequential +containers. +/li + +lia a href=#ds_sequentialsequential/a container provides +the most efficient way to add elements and keeps track of the order they are +added to the collection. They permit duplicates and support efficient +iteration, but do not support efficient lookup based on a key. +/li + +/ul + +p +Once the proper catagory of container is determined, you can fine tune the +memory use, constant factors, and cache behaviors of access by intelligently +picking a member of the catagory. Note that constant factors and cache behavior +can be a big deal. If you have a vector that usually only contains a few +elements (but could contain many), for example, it's much better to use +a href=#dss_smallvectorSmallVector/a than a href=#dss_vectorvector/a +. Doing so avoids (relatively) expensive malloc/free calls, which dwarf the +cost of adding the elements to the container. /p + +/div + +!-- === -- +div class=doc_subsection + a name=ds_sequentialSequential Containers (std::vector, std::list, etc)/a +/div + +div class=doc_text +There are a variety of sequential containers available for you, based on your +needs. Pick the first in this section that will do what you want. +/div + +!-- ___ -- +div class=doc_subsubsection + a name=dss_fixedarraysFixed Size Arrays/a +/div + +div class=doc_text +pFixed size arrays are very simple and very fast. They are good if you know +exactly how many elements you have, or you have a (low) upper bound on how many +you have./p +/div + +!-- ___ -- +div class=doc_subsubsection + a name=dss_heaparraysHeap Allocated Arrays/a +/div + +div class=doc_text +pHeap allocated arrays
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.107 - 1.108 --- Log message: fix validation problems --- Diffs of the changes: (+3 -3) ProgrammersManual.html |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.107 llvm/docs/ProgrammersManual.html:1.108 --- llvm/docs/ProgrammersManual.html:1.107 Fri Feb 2 21:04:03 2007 +++ llvm/docs/ProgrammersManual.htmlFri Feb 2 21:05:57 2007 @@ -637,7 +637,7 @@ ttcall DAG.setGraphColor(inode/i, icolor/i)/tt, then the next ttcall DAG.viewGraph()/tt would hilight the node in the specified color (choices of colors can be found at a -href=http://www.graphviz.org/doc/info/colors.html;Colorsa.) More +href=http://www.graphviz.org/doc/info/colors.html;colors/a.) More complex node attributes can be provided with ttcall DAG.setGraphAttrs(inode/i, iattributes/i)/tt (choices can be found at a href=http://www.graphviz.org/doc/info/attrs.html;Graph @@ -1928,7 +1928,7 @@ /ul /dd dtttPointerType/tt/dt - ddSubclass of SequentialType for pointer types./li + ddSubclass of SequentialType for pointer types./dd dtttPackedType/tt/dt ddSubclass of SequentialType for packed (vector) types. A packed type is similar to an ArrayType but is distinguished because it is @@ -2796,7 +2796,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/02/03 03:04:03 $ + Last modified: $Date: 2007/02/03 03:05:57 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.108 - 1.109 --- Log message: fix validation issues --- Diffs of the changes: (+2 -7) ProgrammersManual.html |9 ++--- 1 files changed, 2 insertions(+), 7 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.108 llvm/docs/ProgrammersManual.html:1.109 --- llvm/docs/ProgrammersManual.html:1.108 Fri Feb 2 21:05:57 2007 +++ llvm/docs/ProgrammersManual.htmlFri Feb 2 21:06:52 2007 @@ -1573,7 +1573,7 @@ This code shows the basic approach used to build recursive types: build a non-recursive type using 'opaque', then use type unification to close the cycle. The type unification step is performed by the tta -ref=#refineAbstractTypeTorefineAbstractTypeTo/a/tt method, which is +href=#refineAbstractTypeTorefineAbstractTypeTo/a/tt method, which is described next. After that, we describe the a href=#PATypeHolderPATypeHolder class/a. /p @@ -2750,11 +2750,6 @@ this constant. /li /ul /li -ul - littbool getValue() const/tt: Returns the underlying value of this - constant. /li -/ul - /li liConstantArray : This represents a constant array. ul littconst std::vectorlt;Usegt; amp;getValues() const/tt: Returns @@ -2796,7 +2791,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/02/03 03:05:57 $ + Last modified: $Date: 2007/02/03 03:06:52 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.109 - 1.110 --- Log message: fill in the section on Set-like containers. --- Diffs of the changes: (+218 -20) ProgrammersManual.html | 238 - 1 files changed, 218 insertions(+), 20 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.109 llvm/docs/ProgrammersManual.html:1.110 --- llvm/docs/ProgrammersManual.html:1.109 Fri Feb 2 21:06:52 2007 +++ llvm/docs/ProgrammersManual.htmlSat Feb 3 01:59:07 2007 @@ -46,17 +46,28 @@ /li lia href=#datastructurePicking the Right Data Structure for a Task/a ul -lia href=#ds_sequentialSequential Containers (std::vector, std::list, etc)/aul -lia href=#dss_fixedarraysFixed Size Arrays/a/li -lia href=#dss_heaparraysHeap Allocated Arrays/a/li -lia href=#dss_smallvectorllvm/ADT/SmallVector.h/a/li -lia href=#dss_vectorlt;vectorgt;/a/li -lia href=#dss_ilistllvm/ADT/ilist/a/li -lia href=#dss_listlt;listgt;/a/li +lia href=#ds_sequentialSequential Containers (std::vector, std::list, etc)/a +ul + lia href=#dss_fixedarraysFixed Size Arrays/a/li + lia href=#dss_heaparraysHeap Allocated Arrays/a/li + lia href=#dss_smallvectorllvm/ADT/SmallVector.h/a/li + lia href=#dss_vectorlt;vectorgt;/a/li + lia href=#dss_dequelt;dequegt;/a/li + lia href=#dss_listlt;listgt;/a/li + lia href=#dss_ilistllvm/ADT/ilist/a/li +/ul/li +lia href=#ds_setSet-Like Containers (std::set, SmallSet, SetVector, etc)/a +ul + lia href=#dss_sortedvectorsetA sorted 'vector'/a/li + lia href=#dss_smallsetllvm/ADT/SmallSet.h/a/li + lia href=#dss_smallptrsetllvm/ADT/SmallPtrSet.h/a/li + lia href=#dss_FoldingSetllvm/ADT/FoldingSet.h/a/li + lia href=#dss_setlt;setgt;/a/li + lia href=#dss_setvectorllvm/ADT/SetVector.h/a/li + lia href=#dss_othersetOther Options/a/li /ul/li -lia href=#ds_setSet-Like Containers (std::set, SmallSet, SetVector, etc)/a/li lia href=#ds_mapMap-Like Containers (std::map, DenseMap, etc)/a/li -/ul + /ul /li lia href=#commonHelpful Hints for Common Operations/a ul @@ -784,6 +795,22 @@ !-- ___ -- div class=doc_subsubsection + a name=dss_dequelt;dequegt;/a +/div + +div class=doc_text +pstd::deque is, in some senses, a generalized version of std::vector. Like +std::vector, it provides constant time random access and other similar +properties, but it also provides efficient access to the front of the list. It +does not guarantee continuity of elements within memory./p + +pIn exchange for this extra flexibility, std::deque has significantly higher +constant factor costs than std::vector. If possible, use std::vector or +something cheaper./p +/div + +!-- ___ -- +div class=doc_subsubsection a name=dss_listlt;listgt;/a /div @@ -827,9 +854,7 @@ /div div class=doc_text -pOther STL containers are available, such as std::deque (which has similar -characteristics to std::vector, but has higher constant factors and provides -efficient push_front/pop_front methods) and std::string./p +pOther STL containers are available, such as std::string./p pThere are also various STL adapter classes such as std::queue, std::priority_queue, std::stack, etc. These provide simplified access to an @@ -845,18 +870,190 @@ div class=doc_text +pSet-like containers are useful when you need to canonicalize multiple values +into a single representation. There are several different choices for how to do +this, providing various trade-offs./p + +/div + + +!-- ___ -- +div class=doc_subsubsection + a name=dss_sortedvectorsetA sorted 'vector'/a +/div + +div class=doc_text + +pIf you intend to insert a lot of elements, then do a lot of queries, one +great approach is to use a vector (or other sequential container), and then use +std::sort+std::unique to remove duplicates. This approach works really well if +your usage pattern has these two distinct phases (insert then query), and, +coupled with a good choice of a href=#ds_sequentialsequential container/a +can provide the several nice properties: the result data is contiguous in memory +(good for cache locality), has few allocations, is easy to address (iterators in +the final vector are just indices or pointers), and can be efficiently queried +with a standard binary search./p + +/div + +!-- ___ -- +div class=doc_subsubsection + a name=dss_smallsetllvm/ADT/SmallSet.h/a +/div + +div class=doc_text + +pIf you have a set-like datastructure that is usually small and whose elements +are reasonably small, a ttSmallSetlt;Type, Ngt; is a good choice. This set
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.105 - 1.106 --- Log message: Change to match API changes. --- Diffs of the changes: (+2 -6) ProgrammersManual.html |8 ++-- 1 files changed, 2 insertions(+), 6 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.105 llvm/docs/ProgrammersManual.html:1.106 --- llvm/docs/ProgrammersManual.html:1.105 Fri Jan 12 11:26:25 2007 +++ llvm/docs/ProgrammersManual.htmlSun Jan 14 19:55:32 2007 @@ -1642,11 +1642,7 @@ div class=doc_text ul - littbool isInteger() const/tt: Returns true for any integer type except - a one-bit integer (i1). /li - - littbool isIntegral() const/tt: Returns true for any integer type - including a one-bit integer./li + littbool isInteger() const/tt: Returns true for any integer type./li littbool isFloatingPoint()/tt: Return true if this is one of the two floating point types./li @@ -2561,7 +2557,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/01/12 17:26:25 $ + Last modified: $Date: 2007/01/15 01:55:32 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.103 - 1.104 --- Log message: Update documentation for arbitrary precision integers: 1. int - i32 2. Describe the IntegerType class. 3. Correct the description of Type and its primitive type subclasses. 4. Document OpaqueType and PackedType a little better. --- Diffs of the changes: (+58 -28) ProgrammersManual.html | 86 + 1 files changed, 58 insertions(+), 28 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.103 llvm/docs/ProgrammersManual.html:1.104 --- llvm/docs/ProgrammersManual.html:1.103 Thu Jan 11 21:36:33 2007 +++ llvm/docs/ProgrammersManual.htmlFri Jan 12 11:11:23 2007 @@ -521,7 +521,7 @@ pThe ttSTATISTIC/tt macro defines a static variable, whose name is specified by the first argument. The pass name is taken from the DEBUG_TYPE macro, and the description is taken from the second argument. The variable -defined (NumXForms in this case) acts like an unsigned int./p/li +defined (NumXForms in this case) acts like an unsigned integer./p/li lipWhenever you make a transformation, bump the counter:/p @@ -1278,8 +1278,8 @@ For our purposes below, we need three concepts. First, an Opaque Type is exactly as defined in the a href=LangRef.html#t_opaquelanguage reference/a. Second an Abstract Type is any type which includes an -opaque type as part of its type graph (for example tt{ opaque, int }/tt). -Third, a concrete type is a type that is not an abstract type (e.g. tt{ int, +opaque type as part of its type graph (for example tt{ opaque, i32 }/tt). +Third, a concrete type is a type that is not an abstract type (e.g. tt{ i32, float }/tt). /p @@ -1300,7 +1300,7 @@ div class=doc_code pre -%mylist = type { %mylist*, int } +%mylist = type { %mylist*, i32 } /pre /div @@ -1317,7 +1317,7 @@ Elts.push_back(Type::IntTy); StructType *NewSTy = StructType::get(Elts); -// iAt this point, NewSTy = { opaque*, int }. Tell VMCore that/i +// iAt this point, NewSTy = { opaque*, i32 }. Tell VMCore that/i // ithe struct and the opaque type are actually the same./i castlt;OpaqueTypegt;(StructTy.get())-gt;a href=#refineAbstractTypeTorefineAbstractTypeTo/a(NewSTy); @@ -1357,7 +1357,7 @@ p In the example above, the OpaqueType object is definitely deleted. -Additionally, if there is an { \2*, int} type already created in the system, +Additionally, if there is an { \2*, i32} type already created in the system, the pointer and struct type created are balso/b deleted. Obviously whenever a type is deleted, any Type* pointers in the program are invalidated. As such, it is safest to avoid having iany/i Type* pointers to abstract types @@ -1411,8 +1411,8 @@ allows it to get callbacks when certain types are resolved. To register to get callbacks for a particular type, the DerivedType::{add/remove}AbstractTypeUser methods can be called on a type. Note that these methods only work for i -abstract/i types. Concrete types (those that do not include an opaque objects -somewhere) can never be refined. + abstract/i types. Concrete types (those that do not include any opaque +objects) can never be refined. /p /div @@ -1647,7 +1647,7 @@ div class=doc_code pre -%bfoo/b = add int 1, 2 +%bfoo/b = add i32 1, 2 /pre /div @@ -1988,11 +1988,11 @@ when using the ttGetElementPtrInst/tt instruction because this pointer must be dereferenced first. For example, if you have a ttGlobalVariable/tt (a subclass of ttGlobalValue)/tt that is an array of 24 ints, type tt[24 x -int]/tt, then the ttGlobalVariable/tt is a pointer to that array. Although +i32]/tt, then the ttGlobalVariable/tt is a pointer to that array. Although the address of the first element of this array and the value of the ttGlobalVariable/tt are the same, they have different types. The -ttGlobalVariable/tt's type is tt[24 x int]/tt. The first element's type -is ttint./tt Because of this, accessing a global value requires you to +ttGlobalVariable/tt's type is tt[24 x i32]/tt. The first element's type +is tti32./tt Because of this, accessing a global value requires you to dereference the pointer with ttGetElementPtrInst/tt first, then its elements can be accessed. This is explained in the a href=LangRef.html#globalvarsLLVM Language Reference Manual/a./p @@ -2429,15 +2429,19 @@ div class=doc_text -pType as noted earlier is also a subclass of a Value class. Any primitive -type (like int, short etc) in LLVM is an instance of Type Class. All other -types are instances of subclasses of type like FunctionType, ArrayType -etc. DerivedType is the interface for all such dervied types including -FunctionType, ArrayType, PointerType, StructType. Types can have names. They can -be recursive (StructType). There exists exactly one instance of any type -structure at a time. This allows using pointer equality of Type *s
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.104 - 1.105 --- Log message: Make a couple organizational changes. Type no longer derives from Value (hasn't for ages) so move it up one level in the table of contents. Type needs to be understood before Value so move it before Value. Make the descriptions of types stand out a little more. Add references to the doxygen for the Type class. --- Diffs of the changes: (+118 -109) ProgrammersManual.html | 227 + 1 files changed, 118 insertions(+), 109 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.104 llvm/docs/ProgrammersManual.html:1.105 --- llvm/docs/ProgrammersManual.html:1.104 Fri Jan 12 11:11:23 2007 +++ llvm/docs/ProgrammersManual.htmlFri Jan 12 11:26:25 2007 @@ -99,6 +99,7 @@ lia href=#coreclassesThe Core LLVM Class Hierarchy Reference/a ul + lia href=#TypeThe ttType/tt class/a /li lia href=#ValueThe ttValue/tt class/a ul lia href=#UserThe ttUser/tt class/a @@ -122,7 +123,6 @@ /li /ul /li - lia href=#TypeThe ttType/tt class/a /li lia href=#ArgumentThe ttArgument/tt class/a/li /ul /li @@ -1602,6 +1602,8 @@ !-- *** -- div class=doc_text +ptt#include a href=/doxygen/Type_8h-source.htmlllvm/Type.h/a/tt +brdoxygen info: a href=/doxygen/classllvm_1_1Type.htmlType Class/a/p pThe Core LLVM classes are the primary means of representing the program being inspected or transformed. The core LLVM classes are defined in @@ -1612,6 +1614,120 @@ !-- === -- div class=doc_subsection + a name=TypeThe ttType/tt class and Derived Types/a +/div + +div class=doc_text + + pttType/tt is a superclass of all type classes. Every ttValue/tt has + a ttType/tt. ttType/tt cannot be instantiated directly but only + through its subclasses. Certain primitive types (ttVoidType/tt, + ttLabelType/tt, ttFloatType/tt and ttDoubleType/tt) have hidden + subclasses. They are hidden because they offer no useful functionality beyond + what the ttType/tt class offers except to distinguish themselves from + other subclasses of ttType/tt./p + pAll other types are subclasses of ttDerivedType/tt. Types can be + named, but this is not a requirement. There exists exactly + one instance of a given shape at any one time. This allows type equality to + be performed with address equality of the Type Instance. That is, given two + ttType*/tt values, the types are identical if the pointers are identical. + /p +/div + +!-- ___ -- +div class=doc_subsubsection + a name=m_ValueImportant Public Methods/a +/div + +div class=doc_text + +ul + littbool isInteger() const/tt: Returns true for any integer type except + a one-bit integer (i1). /li + + littbool isIntegral() const/tt: Returns true for any integer type + including a one-bit integer./li + + littbool isFloatingPoint()/tt: Return true if this is one of the two + floating point types./li + + littbool isAbstract()/tt: Return true if the type is abstract (contains + an OpaqueType anywhere in its definition)./li + + littbool isSized()/tt: Return true if the type has known size. Things + that don't have a size are abstract types, labels and void./li + +/ul +/div + +!-- ___ -- +div class=doc_subsubsection + a name=m_ValueImportant Derived Types/a +/div +div class=doc_text +dl + dtttIntegerType/tt/dt + ddSubclass of DerivedType that represents integer types of any bit width. + Any bit width between ttIntegerType::MIN_INT_BITS/tt (1) and + ttIntegerType::MAX_INT_BITS/tt (~8 million) can be represented. + ul +littstatic const IntegerType* get(unsigned NumBits)/tt: get an integer +type of a specific bit width./li +littunsigned getBitWidth() const/tt: Get the bit width of an integer +type./li + /ul + /dd + dtttSequentialType/tt/dt + ddThis is subclassed by ArrayType and PointerType +ul + littconst Type * getElementType() const/tt: Returns the type of each + of the elements in the sequential type. /li +/ul + /dd + dtttArrayType/tt/dt + ddThis is a subclass of SequentialType and defines the interface for array + types. +ul + littunsigned getNumElements() const/tt: Returns the number of + elements in the array. /li +/ul + /dd + dtttPointerType/tt/dt + ddSubclass of SequentialType for pointer types./li + dtttPackedType/tt/dt + ddSubclass of SequentialType for packed (vector) types. A + packed type is similar to an ArrayType but is distinguished because it is + a first class type wherease ArrayType is not. Packed types are used for
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.102 - 1.103 --- Log message: Update for changes in the IR. The ConstantIntegral, ConstantBool, and ConstantInt classes were merged into just ConstantInt. --- Diffs of the changes: (+7 -4) ProgrammersManual.html | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.102 llvm/docs/ProgrammersManual.html:1.103 --- llvm/docs/ProgrammersManual.html:1.102 Sat Jan 6 18:41:39 2007 +++ llvm/docs/ProgrammersManual.htmlThu Jan 11 21:36:33 2007 @@ -2365,7 +2365,7 @@ div class=doc_text pConstant represents a base class for different types of constants. It -is subclassed by ConstantBool, ConstantInt, ConstantArray etc for representing +is subclassed by ConstantInt, ConstantArray, etc. for representing the various types of Constants./p /div @@ -2381,12 +2381,16 @@ div class=doc_subsubsectionImportant Subclasses of Constant /div div class=doc_text ul - liConstantInt : This subclass of Constant represents an integer constant. + liConstantInt : This subclass of Constant represents an integer constant of + any width, including boolean (1 bit integer). ul littint64_t getSExtValue() const/tt: Returns the underlying value of this constant as a sign extended signed integer value./li littuint64_t getZExtValue() const/tt: Returns the underlying value of this constant as a zero extended unsigned integer value./li + littstatic ConstantInt* get(const Type *Ty, uint64_t Val)/tt: + Returns the ConstantInt object that represents the value provided by + ttVal/tt for integer type ttTy/tt./li /ul /li liConstantFP : This class represents a floating point constant. @@ -2395,7 +2399,6 @@ this constant. /li /ul /li - liConstantBool : This represents a boolean constant. ul littbool getValue() const/tt: Returns the underlying value of this constant. /li @@ -2519,7 +2522,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/01/07 00:41:39 $ + Last modified: $Date: 2007/01/12 03:36:33 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.101 - 1.102 --- Log message: Update the documentation for SymbolTable class. --- Diffs of the changes: (+13 -63) ProgrammersManual.html | 76 - 1 files changed, 13 insertions(+), 63 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.101 llvm/docs/ProgrammersManual.html:1.102 --- llvm/docs/ProgrammersManual.html:1.101 Thu Jan 4 16:01:45 2007 +++ llvm/docs/ProgrammersManual.htmlSat Jan 6 18:41:39 2007 @@ -1426,14 +1426,14 @@ pThis class provides a symbol table that the a href=#FunctionttFunction/tt/a and a href=#Module ttModule/tt/a classes use for naming definitions. The symbol table can -provide a name for any a href=#ValuettValue/tt/a or a -href=#TypettType/tt/a. ttSymbolTable/tt is an abstract data -type. It hides the data it contains and provides access to it through a -controlled interface./p - -pNote that the symbol table class is should not be directly accessed by most -clients. It should only be used when iteration over the symbol table names -themselves are required, which is very special purpose. Note that not all LLVM +provide a name for any a href=#ValuettValue/tt/a. +ttSymbolTable/tt is an abstract data type. It hides the data it contains +and provides access to it through a controlled interface./p + +pNote that the ttSymbolTable/tt class should not be directly accessed +by most clients. It should only be used when iteration over the symbol table +names themselves are required, which is very special purpose. Note that not +all LLVM a href=#ValueValue/as have names, and those without names (i.e. they have an empty name) do not exist in the symbol table. /p @@ -1442,9 +1442,8 @@ structure of the information it holds. The class contains two ttstd::map/tt objects. The first, ttpmap/tt, is a map of ttType*/tt to maps of name (ttstd::string/tt) to ttValue*/tt. -The second, tttmap/tt, is a map of names to ttType*/tt. Thus, Values -are stored in two-dimensions and accessed by ttType/tt and name. Types, -however, are stored in a single dimension and accessed only by name./p +Thus, Values are stored in two-dimensions and accessed by ttType/tt and +name./p pThe interface of this class provides three basic types of operations: ol @@ -1456,7 +1455,7 @@ a href=#SymbolTable_insertttinsert/tt/a./li liemIterators/em. Iterators allow the user to traverse the content of the symbol table in well defined ways, such as the method - a href=#SymbolTable_type_begintttype_begin/tt/a./li + a href=#SymbolTable_plane_beginttplane_begin/tt/a./li /ol h3Accessors/h3 @@ -1467,15 +1466,6 @@ ttTy/tt parameter for a ttValue/tt with the provided ttname/tt. If a suitable ttValue/tt is not found, null is returned./dd - dtttType* lookupType( const std::stringamp; name) const/tt:/dt - ddThe ttlookupType/tt method searches through the types for a - ttType/tt with the provided ttname/tt. If a suitable ttType/tt - is not found, null is returned./dd - - dtttbool hasTypes() const/tt:/dt - ddThis function returns true if an entry has been made into the type - map./dd - dtttbool isEmpty() const/tt:/dt ddThis function returns true if both the value and types maps are empty/dd @@ -1493,12 +1483,6 @@ name. There can be a many to one mapping between names and constants or types./dd - dtttvoid insert(const std::stringamp; Name, Type *Typ)/tt:/dt - dd Inserts a type into the symbol table with the specified name. There - can be a many-to-one mapping between names and types. This method - allows a type with an existing entry in the symbol table to get - a new name./dd - dtttvoid remove(Value* Val)/tt:/dt dd This method removes a named value from the symbol table. The type and name of the Value are extracted from \p N and used to @@ -1506,21 +1490,11 @@ not in the symbol table, this method silently ignores the request./dd - dtttvoid remove(Type* Typ)/tt:/dt - dd This method removes a named type from the symbol table. The - name of the type is extracted from \P T and used to look up - the Type in the type map. If the Type is not in the symbol - table, this method silently ignores the request./dd - dtttValue* remove(const std::stringamp; Name, Value *Val)/tt:/dt dd Remove a constant or type with the specified name from the symbol table./dd - dtttType* remove(const std::stringamp; Name, Type* T)/tt:/dt - dd Remove a type with the specified name from the symbol table. - Returns the removed Type./dd - - dtttValue *value_remove(const value_iteratoramp; It)/tt:/dt + dtttValue *remove(const value_iteratoramp; It)/tt:/dt dd Removes a specific value from the symbol table. Returns the removed value./dd @@ -1551,16 +1525,6 @@ /tt/pre/td /tr tr -td align=leftAll name/Type Pairs/tdtdTI/td -td align=leftprett -for
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.100 - 1.101 --- Log message: Fix broken links, reported by Baptiste Lepilleur --- Diffs of the changes: (+4 -4) ProgrammersManual.html |8 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.100 llvm/docs/ProgrammersManual.html:1.101 --- llvm/docs/ProgrammersManual.html:1.100 Tue Dec 19 22:23:36 2006 +++ llvm/docs/ProgrammersManual.htmlThu Jan 4 16:01:45 2007 @@ -944,7 +944,7 @@ div class=doc_text pFrequently, we might have an instance of the a -href=/doxygen/structllvm_1_1Value.htmlValue Class/a and we want to +href=/doxygen/classllvm_1_1Value.htmlValue Class/a and we want to determine which ttUser/tts use the ttValue/tt. The list of all ttUser/tts of a particular ttValue/tt is called a idef-use/i chain. For example, let's say we have a ttFunction*/tt named ttF/tt to a @@ -1225,7 +1225,7 @@ pYou can use ttValue::replaceAllUsesWith/tt and ttUser::replaceUsesOfWith/tt to change more than one use at a time. See the -doxygen documentation for the a href=/doxygen/structllvm_1_1Value.htmlValue Class/a +doxygen documentation for the a href=/doxygen/classllvm_1_1Value.htmlValue Class/a and a href=/doxygen/classllvm_1_1User.htmlUser Class/a, respectively, for more information./p @@ -1669,7 +1669,7 @@ ptt#include a href=/doxygen/Value_8h-source.htmlllvm/Value.h/a/tt br -doxygen info: a href=/doxygen/structllvm_1_1Value.htmlValue Class/a/p +doxygen info: a href=/doxygen/classllvm_1_1Value.htmlValue Class/a/p pThe ttValue/tt class is the most important class in the LLVM Source base. It represents a typed value that may be used (among other things) as an @@ -2569,7 +2569,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2006/12/20 04:23:36 $ + Last modified: $Date: 2007/01/04 22:01:45 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.96 - 1.97 --- Log message: Make changes for removal of SETCC instruction to unify with LangRef.html. --- Diffs of the changes: (+26 -3) ProgrammersManual.html | 29 ++--- 1 files changed, 26 insertions(+), 3 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.96 llvm/docs/ProgrammersManual.html:1.97 --- llvm/docs/ProgrammersManual.html:1.96 Thu Dec 7 14:04:41 2006 +++ llvm/docs/ProgrammersManual.htmlTue Dec 19 13:47:19 2006 @@ -1851,10 +1851,10 @@ the ttInstruction/tt class is the ttllvm/Instruction.def/tt file. This file contains some meta-data about the various different types of instructions in LLVM. It describes the enum values that are used as opcodes (for example -ttInstruction::Add/tt and ttInstruction::SetLE/tt), as well as the +ttInstruction::Add/tt and ttInstruction::ICmp/tt), as well as the concrete sub-classes of ttInstruction/tt that implement the instruction (for example tta href=#BinaryOperatorBinaryOperator/a/tt and tta -href=#SetCondInstSetCondInst/a/tt). Unfortunately, the use of macros in +href=#CmpInstCmpInst/a/tt). Unfortunately, the use of macros in this file confuses doxygen, so these enum values don't show up correctly in the a href=/doxygen/classllvm_1_1Instruction.htmldoxygen output/a./p @@ -1862,6 +1862,29 @@ !-- ___ -- div class=doc_subsubsection + a name=s_InstructionImportant Subclasses of the ttInstruction/tt + class/a +/div +div class=doc_text + ul +litta name=BinaryOperatorBinaryOperator/a/tt +pThis subclasses represents all two operand instructions whose operands +must be the same type, except for the comparison instructions./p/li +litta name=CastInstCastInst/a/tt +pThis subclass is the parent of the 12 casting instructions. It provides +common operations on cast instructions./p +litta name=CmpInstCmpInst/a/tt +pThis subclass respresents the two comparison instructions, +a href=LangRef.html#i_icmpICmpInst/a (integer opreands), and +a href=LangRef.html#i_fcmpFCmpInst/a (floating point operands)./p +litta name=TerminatorInstTerminatorInst/a/tt +pThis subclass is the parent of all terminator instructions (those which +can terminate a block)./p + /ul + /div + +!-- ___ -- +div class=doc_subsubsection a name=m_InstructionImportant Public Members of the ttInstruction/tt class/a /div @@ -2554,7 +2577,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2006/12/07 20:04:41 $ + Last modified: $Date: 2006/12/19 19:47:19 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.97 - 1.98 --- Log message: update to reflect changes in statistic class. --- Diffs of the changes: (+11 -9) ProgrammersManual.html | 20 +++- 1 files changed, 11 insertions(+), 9 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.97 llvm/docs/ProgrammersManual.html:1.98 --- llvm/docs/ProgrammersManual.html:1.97 Tue Dec 19 13:47:19 2006 +++ llvm/docs/ProgrammersManual.htmlTue Dec 19 15:46:21 2006 @@ -35,7 +35,7 @@ and the tt-debug-only/tt option/a /li /ul /li - lia href=#StatisticThe ttStatistic/tt template amp; tt-stats/tt + lia href=#StatisticThe ttStatistic/tt class amp; tt-stats/tt option/a/li !-- liThe ttInstVisitor/tt template @@ -485,7 +485,7 @@ !-- === -- div class=doc_subsection - a name=StatisticThe ttStatistic/tt template amp; tt-stats/tt + a name=StatisticThe ttStatistic/tt class amp; tt-stats/tt option/a /div @@ -493,7 +493,7 @@ pThe tta href=/doxygen/Statistic_8h-source.htmlllvm/ADT/Statistic.h/a/tt file -provides a template named ttStatistic/tt that is used as a unified way to +provides a class named ttStatistic/tt that is used as a unified way to keep track of what the LLVM compiler is doing and how effective various optimizations are. It is useful to see what optimizations are contributing to making a particular program run faster./p @@ -501,7 +501,7 @@ pOften you may run your pass on some big program, and you're interested to see how many times it makes a certain transformation. Although you can do this with hand inspection, or some ad-hoc method, this is a real pain and not very useful -for big programs. Using the ttStatistic/tt template makes it very easy to +for big programs. Using the ttStatistic/tt class makes it very easy to keep track of this information, and the calculated information is presented in a uniform manner with the rest of the passes being executed./p @@ -513,13 +513,15 @@ div class=doc_code pre -static Statisticlt;gt; NumXForms(mypassname, The # of times I did stuff); +#define a href=#DEBUG_TYPEDEBUG_TYPE/a mypassname i// This goes before any #includes./i +STATISTIC(NumXForms, The # of times I did stuff); /pre /div - pThe ttStatistic/tt template can emulate just about any data-type, - but if you do not specify a template argument, it defaults to acting like - an unsigned int counter (this is usually what you want)./p/li + pThe ttSTATISTIC/tt macro defines a static variable, whose name is +specified by the first argument. The pass name is taken from the DEBUG_TYPE +macro, and the description is taken from the second argument. The variable +defined (NumXForms in this case) acts like an unsigned int./p/li lipWhenever you make a transformation, bump the counter:/p @@ -2577,7 +2579,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2006/12/19 19:47:19 $ + Last modified: $Date: 2006/12/19 21:46:21 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html Stacker.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.94 - 1.95 Stacker.html updated: 1.20 - 1.21 --- Log message: For PR950: http://llvm.org/PR950 : This patch implements the first increment for the Signless Types feature. All changes pertain to removing the ConstantSInt and ConstantUInt classes in favor of just using ConstantInt. --- Diffs of the changes: (+14 -19) ProgrammersManual.html | 21 - Stacker.html | 12 ++-- 2 files changed, 14 insertions(+), 19 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.94 llvm/docs/ProgrammersManual.html:1.95 --- llvm/docs/ProgrammersManual.html:1.94 Wed Oct 11 13:00:22 2006 +++ llvm/docs/ProgrammersManual.htmlFri Oct 20 02:07:23 2006 @@ -2390,8 +2390,8 @@ div class=doc_text pConstant represents a base class for different types of constants. It -is subclassed by ConstantBool, ConstantInt, ConstantSInt, ConstantUInt, -ConstantArray etc for representing the various types of Constants./p +is subclassed by ConstantBool, ConstantInt, ConstantArray etc for representing +the various types of Constants./p /div @@ -2406,17 +2406,12 @@ div class=doc_subsubsectionImportant Subclasses of Constant /div div class=doc_text ul - liConstantSInt : This subclass of Constant represents a signed integer - constant. + liConstantInt : This subclass of Constant represents an integer constant. ul - littint64_t getValue() const/tt: Returns the underlying value of - this constant. /li -/ul - /li - liConstantUInt : This class represents an unsigned integer. -ul - littuint64_t getValue() const/tt: Returns the underlying value of - this constant. /li + littint64_t getSExtValue() const/tt: Returns the underlying value of + this constant as a sign extended signed integer value./li + littuint64_t getZExtValue() const/tt: Returns the underlying value + of this constant as a zero extended unsigned integer value./li /ul /li liConstantFP : This class represents a floating point constant. @@ -2559,7 +2554,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2006/10/11 18:00:22 $ + Last modified: $Date: 2006/10/20 07:07:23 $ /address /body Index: llvm/docs/Stacker.html diff -u llvm/docs/Stacker.html:1.20 llvm/docs/Stacker.html:1.21 --- llvm/docs/Stacker.html:1.20 Mon Mar 13 23:39:39 2006 +++ llvm/docs/Stacker.html Fri Oct 20 02:07:23 2006 @@ -139,7 +139,7 @@ Value* expression(BasicBlock* bb, Value* a, Value* b, Value* x, Value* y ) { -ConstantSInt* one = ConstantSInt::get(Type::IntTy, 1); +ConstantInt* one = ConstantInt::get(Type::IntTy, 1); BinaryOperator* or1 = BinaryOperator::createOr(a, b, , bb); BinaryOperator* add1 = BinaryOperator::createAdd(x, one, , bb); BinaryOperator* add2 = BinaryOperator::createAdd(y, one, , bb); @@ -308,7 +308,7 @@ /p pre std::vectorlt;Value*gt; index_vector; -index_vector.push_back( ConstantSInt::get( Type::LongTy, 0 ); +index_vector.push_back( ConstantInt::get( Type::LongTy, 0 ); // ... push other indices ... GetElementPtrInst* gep = new GetElementPtrInst( ptr, index_vector ); /pre @@ -367,9 +367,9 @@ ul liConstants are Values like anything else and can be operands of instructions/li liInteger constants, frequently needed, can be created using the static get - methods of the ConstantInt, ConstantSInt, and ConstantUInt classes. The nice thing - about these is that you can get any kind of integer quickly./li - liThere's a special method on Constant class which allows you to get the null + methods of the ConstantInt class. The nice thing about these is that you can + get any kind of integer quickly./li + liThere's a special method on Constant class which allows you to get the null constant for emany/em type. This is really handy for initializing large arrays or structures, etc./li /ul @@ -1405,7 +1405,7 @@ a href=mailto:[EMAIL PROTECTED]Reid Spencer/abr a href=http://llvm.org;LLVM Compiler Infrastructure/abr - Last modified: $Date: 2006/03/14 05:39:39 $ + Last modified: $Date: 2006/10/20 07:07:23 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.91 - 1.92 --- Log message: Update documentaion of node annotation (coloring) in viewGraph. --- Diffs of the changes: (+14 -2) ProgrammersManual.html | 16 ++-- 1 files changed, 14 insertions(+), 2 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.91 llvm/docs/ProgrammersManual.html:1.92 --- llvm/docs/ProgrammersManual.html:1.91 Fri Apr 14 09:11:48 2006 +++ llvm/docs/ProgrammersManual.htmlMon Oct 2 07:28:07 2006 @@ -516,7 +516,7 @@ ttFunction::viewCFGOnly()/tt (does not include the instructions), the ttMachineFunction::viewCFG()/tt and ttMachineFunction::viewCFGOnly()/tt, and the ttSelectionDAG::viewGraph()/tt methods. Within GDB, for example, -you can usually use something like ttcall DAG.viewGraph()/tt to pop +you can usually use something like ttcall DAG.viewGraph()/tt to pop up a window. Alternatively, you can sprinkle calls to these functions in your code in places you want to debug./p @@ -529,6 +529,18 @@ it) to your path. Once in your system and path are set up, rerun the LLVM configure script and rebuild LLVM to enable this functionality./p +pttSelectionDAG/tt has been extended to make it easier to locate +iinteresting/i nodes in large complex graphs. From gdb, if you +ttcall DAG.setGraphColor(inode/i, icolor/i)/tt, then the +next ttcall DAG.viewGraph()/tt would hilight the node in the +specified color (choices of colors can be found at a +href=http://www.graphviz.org/doc/info/colors.html;Colorsa.) More +complex node attributes can be provided with ttcall +DAG.setGraphAttrs(inode/i, iattributes/i)/tt (choices can be +found at a href=http://www.graphviz.org/doc/info/attrs.html;Graph +Attributes/a.) If you want to restart and clear all the current graph +attributes, then you can ttcall DAG.clearGraphAttrs()/tt. /p + /div @@ -2281,7 +2293,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2006/04/14 14:11:48 $ + Last modified: $Date: 2006/10/02 12:28:07 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.90 - 1.91 --- Log message: Correct the Superclasses list for GlobalVariable and Function to indicate that they are Constant as they derive from GlobalValue. Also, fix some of the wording where it mentions this. Patch inspired by Nai Xia. --- Diffs of the changes: (+21 -17) ProgrammersManual.html | 38 +- 1 files changed, 21 insertions(+), 17 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.90 llvm/docs/ProgrammersManual.html:1.91 --- llvm/docs/ProgrammersManual.html:1.90 Mon Mar 13 23:39:39 2006 +++ llvm/docs/ProgrammersManual.htmlFri Apr 14 09:11:48 2006 @@ -1710,8 +1710,8 @@ href=/doxygen/GlobalValue_8h-source.htmlllvm/GlobalValue.h/a/ttbr doxygen info: a href=/doxygen/classllvm_1_1GlobalValue.htmlGlobalValue Class/abr -Superclasses: a href=#UserttUser/tt/a, a -href=#ValuettValue/tt/a/p +Superclasses: a href=#ConstantttConstant/tt/a, +a href=#UserttUser/tt/a, a href=#ValuettValue/tt/a/p pGlobal values (a href=#GlobalVariablettGlobalVariable/tt/as or a href=#FunctionttFunction/tt/as) are the only LLVM values that are @@ -1778,15 +1778,17 @@ ptt#include a href=/doxygen/Function_8h-source.htmlllvm/Function.h/a/ttbr doxygen info: a href=/doxygen/classllvm_1_1Function.htmlFunction Class/abr -Superclasses: a href=#GlobalValuettGlobalValue/tt/a, a -href=#UserttUser/tt/a, a href=#ValuettValue/tt/a/p +Superclasses: a href=#GlobalValuettGlobalValue/tt/a, +a href=#ConstantttConstant/tt/a, +a href=#UserttUser/tt/a, +a href=#ValuettValue/tt/a/p pThe ttFunction/tt class represents a single procedure in LLVM. It is actually one of the more complex classes in the LLVM heirarchy because it must keep track of a large amount of data. The ttFunction/tt class keeps track -of a list of a href=#BasicBlockttBasicBlock/tt/as, a list of formal a -href=#ArgumentttArgument/tt/as, and a a -href=#SymbolTablettSymbolTable/tt/a./p +of a list of a href=#BasicBlockttBasicBlock/tt/as, a list of formal +a href=#ArgumentttArgument/tt/as, and a +a href=#SymbolTablettSymbolTable/tt/a./p pThe list of a href=#BasicBlockttBasicBlock/tt/as is the most commonly used part of ttFunction/tt objects. The list imposes an implicit @@ -1915,20 +1917,22 @@ href=/doxygen/GlobalVariable_8h-source.htmlllvm/GlobalVariable.h/a/tt br doxygen info: a href=/doxygen/classllvm_1_1GlobalVariable.htmlGlobalVariable -Class/abr Superclasses: a href=#GlobalValuettGlobalValue/tt/a, a -href=#UserttUser/tt/a, a href=#ValuettValue/tt/a/p + Class/abr +Superclasses: a href=#GlobalValuettGlobalValue/tt/a, +a href=#ConstantttConstant/tt/a, +a href=#UserttUser/tt/a, +a href=#ValuettValue/tt/a/p pGlobal variables are represented with the (suprise suprise) ttGlobalVariable/tt class. Like functions, ttGlobalVariable/tts are also subclasses of a href=#GlobalValuettGlobalValue/tt/a, and as such are always referenced by their address (global values must live in memory, so their -name refers to their address). See a -href=#GlobalValuettGlobalValue/tt/a for more on this. Global variables -may have an initial value (which must be a a -href=#ConstantttConstant/tt/a), and if they have an initializer, they -may be marked as constant themselves (indicating that their contents never -change at runtime)./p - +name refers to their constant address). See +a href=#GlobalValuettGlobalValue/tt/a for more on this. Global +variables may have an initial value (which must be a +a href=#ConstantttConstant/tt/a), and if they have an initializer, +they may be marked as constant themselves (indicating that their contents +never change at runtime)./p /div !-- ___ -- @@ -2277,7 +2281,7 @@ a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2006/03/14 05:39:39 $ + Last modified: $Date: 2006/04/14 14:11:48 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.87 - 1.88 --- Log message: * Replace ampersands in section titles with more formal ``and'' * Surround C++ template operators with tt * Add after templated operators for consistency --- Diffs of the changes: (+36 -34) ProgrammersManual.html | 70 + 1 files changed, 36 insertions(+), 34 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.87 llvm/docs/ProgrammersManual.html:1.88 --- llvm/docs/ProgrammersManual.html:1.87 Sun Oct 16 20:36:23 2005 +++ llvm/docs/ProgrammersManual.htmlTue Nov 1 15:12:49 2005 @@ -28,7 +28,7 @@ ul lia href=#isaThe ttisalt;gt;/tt, ttcastlt;gt;/tt and ttdyn_castlt;gt;/tt templates/a /li - lia href=#DEBUGThe ttDEBUG()/tt macro amp; tt-debug/tt + lia href=#DEBUGThe ttDEBUG()/tt macro and tt-debug/tt option/a ul lia href=#DEBUG_TYPEFine grained debug info with ttDEBUG_TYPE/tt @@ -264,7 +264,8 @@ !-- === -- div class=doc_subsection - a name=isaThe isalt;gt;, castlt;gt; and dyn_castlt;gt; templates/a + a name=isaThe ttisalt;gt;/tt, ttcastlt;gt;/tt and + ttdyn_castlt;gt;/tt templates/a /div div class=doc_text @@ -317,44 +318,45 @@ checks to see if the operand is of the specified type, and if so, returns a pointer to it (this operator does not work with references). If the operand is not of the correct type, a null pointer is returned. Thus, this works very - much like the ttdynamic_cast/tt operator in C++, and should be used in the - same circumstances. Typically, the ttdyn_castlt;gt;/tt operator is used - in an ttif/tt statement or some other flow control statement like this: + much like the ttdynamic_castlt;gt;/tt operator in C++, and should be + used in the same circumstances. Typically, the ttdyn_castlt;gt;/tt + operator is used in an ttif/tt statement or some other flow control + statement like this: - pre + pre if (a href=#AllocationInstAllocationInst/a *AI = dyn_castlt;a href=#AllocationInstAllocationInst/agt;(Val)) { ... } - /pre + /pre - p This form of the ttif/tt statement effectively combines together a - call to ttisalt;gt;/tt and a call to ttcastlt;gt;/tt into one - statement, which is very convenient./p - - pNote that the ttdyn_castlt;gt;/tt operator, like C++'s - ttdynamic_cast/tt or Java's ttinstanceof/tt operator, can be abused. - In particular you should not use big chained ttif/then/else/tt blocks to - check for lots of different variants of classes. If you find yourself - wanting to do this, it is much cleaner and more efficient to use the - ttInstVisitor/tt class to dispatch over the instruction type directly./p + pThis form of the ttif/tt statement effectively combines together a call + to ttisalt;gt;/tt and a call to ttcastlt;gt;/tt into one + statement, which is very convenient./p + + pNote that the ttdyn_castlt;gt;/tt operator, like C++'s + ttdynamic_castlt;gt;/tt or Java's ttinstanceof/tt operator, can be + abused. In particular, you should not use big chained ttif/then/else/tt + blocks to check for lots of different variants of classes. If you find + yourself wanting to do this, it is much cleaner and more efficient to use the + ttInstVisitor/tt class to dispatch over the instruction type directly./p -/dd + /dd -dtttcast_or_nulllt;gt;/tt: /dt - -ddThe ttcast_or_nulllt;gt;/tt operator works just like the -ttcastlt;gt;/tt operator, except that it allows for a null pointer as -an argument (which it then propagates). This can sometimes be useful, -allowing you to combine several null checks into one./dd - -dtttdyn_cast_or_nulllt;gt;/tt: /dt - -ddThe ttdyn_cast_or_nulllt;gt;/tt operator works just like the -ttdyn_castlt;gt;/tt operator, except that it allows for a null pointer -as an argument (which it then propagates). This can sometimes be useful, -allowing you to combine several null checks into one./dd + dtttcast_or_nulllt;gt;/tt: /dt + + ddThe ttcast_or_nulllt;gt;/tt operator works just like the + ttcastlt;gt;/tt operator, except that it allows for a null pointer as an + argument (which it then propagates). This can sometimes be useful, allowing + you to combine several null checks into one./dd + + dtttdyn_cast_or_nulllt;gt;/tt: /dt + + ddThe ttdyn_cast_or_nulllt;gt;/tt operator works just like the + ttdyn_castlt;gt;/tt operator, except that it allows for a null pointer + as an argument (which it then propagates). This can sometimes be useful, + allowing you to combine several null checks into one./dd - /dl +/dl pThese five templates can be used with any classes, whether they have a v-table or not. To add support for these templates, you simply need to add @@ -366,7 +368,7 @@ !--