[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 @@ -Deleting 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. +Deleting 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: GlobalVariable *GV = .. ; -Module *M = GV->getParent(); -M->getGlobaleList().erase(GV); +GV->eraseFromParent(); @@ -3086,7 +3083,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/06/20 18:33:15 $ + Last modified: $Date: 2007/06/20 20:46:37 $ ___ 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.131 -> 1.132 --- Log message: Add blurb on deleting global variables. --- Diffs of the changes: (+27 -1) ProgrammersManual.html | 28 +++- 1 files changed, 27 insertions(+), 1 deletion(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.131 llvm/docs/ProgrammersManual.html:1.132 --- llvm/docs/ProgrammersManual.html:1.131 Fri Mar 30 07:22:09 2007 +++ llvm/docs/ProgrammersManual.htmlWed Jun 20 13:33:15 2007 @@ -106,6 +106,7 @@ Deleting Instructions Replacing an Instruction with another Value + Deleting GlobalVariables + + Deleting GlobalVariables + + + + +Deleting 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. + For example: + + + +GlobalVariable *GV = .. ; +Module *M = GV->getParent(); + +M->getGlobaleList().erase(GV); + + + + + Advanced Topics @@ -3060,7 +3086,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/03/30 12:22:09 $ + Last modified: $Date: 2007/06/20 18:33:15 $ ___ 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 @@ for ( ... ) { - std::vector V; + std::vectorV; use V; } @@ -813,7 +813,7 @@ -std::vector V; +std::vector V; for ( ... ) { use V; V.clear(); @@ -3060,7 +3060,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/03/02 01:31:31 $ + Last modified: $Date: 2007/03/28 18:27:57 $ ___ 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 @@ uint64_t getZExtValue() const: 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. + For this reason, use of this method is discouraged. static ConstantInt* get(const APInt& Val): Returns the ConstantInt object that represents the value provided by Val. The type is implied as the IntegerType that corresponds to the bit width @@ -3060,7 +3060,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/03/01 21:05:33 $ + Last modified: $Date: 2007/03/02 01:31:31 $ ___ 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 @@ ConstantInt : This subclass of Constant represents an integer constant of any width. - int64_t getSExtValue() const: Returns the underlying value of - this constant as a sign extended signed integer value. - uint64_t getZExtValue() const: Returns the underlying value - of this constant as a zero extended unsigned integer value. + const APInt& getValue() const: Returns the underlying + value of this constant, an APInt value. + int64_t getSExtValue() const: 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. + uint64_t getZExtValue() const: 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. + static ConstantInt* get(const APInt& Val): Returns the + ConstantInt object that represents the value provided by Val. + The type is implied as the IntegerType that corresponds to the bit width + of Val. static ConstantInt* get(const Type *Ty, uint64_t Val): Returns the ConstantInt object that represents the value provided by Val for integer type Ty. @@ -3050,7 +3060,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/02/16 04:37:31 $ + Last modified: $Date: 2007/03/01 21:05:33 $ ___ 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.126 -> 1.127 --- Log message: update symtab section to reflect recent changes. --- Diffs of the changes: (+20 -147) ProgrammersManual.html | 167 + 1 files changed, 20 insertions(+), 147 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.126 llvm/docs/ProgrammersManual.html:1.127 --- llvm/docs/ProgrammersManual.html:1.126 Wed Feb 14 21:07:05 2007 +++ llvm/docs/ProgrammersManual.htmlThu Feb 15 22:37:31 2007 @@ -129,7 +129,7 @@ The AbstractTypeUser Class - The SymbolTable class + The ValueSymbolTable and TypeSymbolTable classes The Core LLVM Class Hierarchy Reference @@ -2045,12 +2045,8 @@ Some data structures need more to perform more complex updates when types get -resolved. The SymbolTable class, for example, needs -move and potentially merge type planes in its representation when a pointer -changes. - - -To support this, a class can derive from the AbstractTypeUser class. This class +resolved. To support this, a class can derive from the AbstractTypeUser class. +This class 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 @@ -2062,16 +2058,19 @@ - The SymbolTable class + The ValueSymbolTable and + TypeSymbolTable classes -This class provides a symbol table that the The http://llvm.org/doxygen/classllvm_1_1ValueSymbolTable.html";> +ValueSymbolTable class provides a symbol table that the Function and -Module classes use for naming definitions. The symbol table can -provide a name for any Value. -SymbolTable is an abstract data type. It hides the data it contains -and provides access to it through a controlled interface. +Module classes use for naming value definitions. The symbol table +can provide a name for any Value. +The http://llvm.org/doxygen/classllvm_1_1TypeSymbolTable.html";> +TypeSymbolTable class is used by the Module class to store +names for types. Note that the SymbolTable class should not be directly accessed by most clients. It should only be used when iteration over the symbol table @@ -2081,140 +2080,14 @@ an empty name) do not exist in the symbol table. -To use the SymbolTable well, you need to understand the -structure of the information it holds. The class contains two -std::map objects. The first, pmap, is a map of -Type* to maps of name (std::string) to Value*. -Thus, Values are stored in two-dimensions and accessed by Type and -name. - -The interface of this class provides three basic types of operations: - - Accessors. Accessors provide read-only access to information - such as finding a value for a name with the - lookup method. - Mutators. Mutators allow the user to add information to the - SymbolTable with methods like - insert. - Iterators. Iterators allow the user to traverse the content - of the symbol table in well defined ways, such as the method - plane_begin. - - -Accessors - - Value* lookup(const Type* Ty, const std::string& name) const: - - The lookup method searches the type plane given by the - Ty parameter for a Value with the provided name. - If a suitable Value is not found, null is returned. - - bool isEmpty() const: - This function returns true if both the value and types maps are - empty - - -Mutators - - void insert(Value *Val): - This method adds the provided value to the symbol table. The Value must - 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. - - void remove(Value* Val): - 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 - lookup the Value in the correct type plane. If the Value is - not in the symbol table, this method silently ignores the - request. +These symbol tables support iteration over the values/types in the symbol +table with begin/end/iterator and supports querying to see if a +specific name is in the symbol table (with lookup). The +ValueSymbolTable class exposes no public mutator methods, instead, +simply call setName on a value, which will autoinsert it into the +appropriate symbol table. For types, use the Module::addTypeName method to +insert entries into the symbol table. - - -Iteration -The following functions describe three types of iterators you can obtain -the beginning or end of the sequence for both const and non-const. It is -important to keep track of the different kinds of iterators. There are -three idioms worth pointing out: - - - UnitsIteratorIdiom - -Planes Of name/Value mapsPI - -for (SymbolTable::plane_const_iterator PI = ST.plane_begin(), - PE = ST.plane_end(); PI != PE; ++PI ) { - PI
[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Changes in directory llvm/docs: ProgrammersManual.html updated: 1.124 -> 1.125 --- Log message: For PR1195: http://llvm.org/PR1195 : Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. --- 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.124 llvm/docs/ProgrammersManual.html:1.125 --- llvm/docs/ProgrammersManual.html:1.124 Fri Feb 9 10:00:28 2007 +++ llvm/docs/ProgrammersManual.htmlWed Feb 14 20:26:09 2007 @@ -2314,7 +2314,7 @@ PointerType Subclass of SequentialType for pointer types. - PackedType + VectorType Subclass 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 @@ -3177,7 +3177,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/02/09 16:00:28 $ + Last modified: $Date: 2007/02/15 02:26:09 $ ___ 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 @@ - When running gccas on a C file from the SPEC benchmark + When running opt on a C file from the SPEC benchmark suite, it gives a report that looks like this: @@ -3177,7 +3177,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/02/08 19:14:21 $ + Last modified: $Date: 2007/02/09 16:00:28 $ ___ 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 @@ Map-Like Containers (std::map, DenseMap, etc) A sorted 'vector' - "llvm/ADT/CStringMap.h" + "llvm/ADT/StringMap.h" "llvm/ADT/IndexedMap.h" "llvm/ADT/DenseMap.h"
[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. - void insert(const std::string& Name, Value *Val): - 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. - void remove(Value* Val): 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. - Value* remove(const std::string& Name, Value *Val): - Remove a constant or type with the specified name from the - symbol table. - - Value *remove(const value_iterator& It): - Removes a specific value from the symbol table. - Returns the removed value. - - bool strip(): - This method will strip the symbol table of its names leaving - the type and values. - - void clear(): - Empty the symbol table completely. Iteration @@ -3197,7 +3178,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/02/05 06:30:51 $ + Last modified: $Date: 2007/02/07 06:24:17 $ ___ 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.120 -> 1.121 --- Log message: add a note --- Diffs of the changes: (+28 -1) ProgrammersManual.html | 29 - 1 files changed, 28 insertions(+), 1 deletion(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.120 llvm/docs/ProgrammersManual.html:1.121 --- llvm/docs/ProgrammersManual.html:1.120 Sat Feb 3 18:00:26 2007 +++ llvm/docs/ProgrammersManual.htmlMon Feb 5 00:30:51 2007 @@ -797,6 +797,33 @@ itself (which would waste space for elements that aren't in the container). vector is also useful when interfacing with code that expects vectors :). + +One worthwhile note about std::vector: avoid code like this: + + + +for ( ... ) { + std::vector V; + use V; +} + + + +Instead, write this as: + + + +std::vector V; +for ( ... ) { + use V; + V.clear(); +} + + + +Doing so will save (at least) one heap allocation and free per iteration of +the loop. + @@ -3170,7 +3197,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/02/04 00:00:26 $ + Last modified: $Date: 2007/02/05 06:30:51 $ ___ 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 @@ -LLVM's SetVectoris actually a combination of a set along with -a Sequential Container. The important property +LLVM's SetVector is an adapter class that combines your choice of +a set-like container along with a Sequential +Container. 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. @@ -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. +SetVector is an adapter class that defaults to using std::vector and std::set +for the underlying containers, so it is quite expensive. However, +"llvm/ADT/SetVector.h" 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. + @@ -3161,7 +3170,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/02/03 22:04:27 $ + Last modified: $Date: 2007/02/04 00:00:26 $ ___ 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=NUL&p=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. > > The CStringMap implementation uses a quadratically-probed > hash table, where > @@ -3161,7 +3161,7 @@ > mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and > mailto:[EMAIL PROTECTED]">Chris Lattner > http://llvm.org";>The LLVM Compiler Infrastructure a> > - Last modified: $Date: 2007/02/03 21:06:43 $ > + Last modified: $Date: 2007/02/03 22:04:27 $ > > > > > > > ___ > 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
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=NUL&p=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. The CStringMap implementation uses a quadratically-probed hash table, where @@ -3161,7 +3161,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure>>> a> - Last modified: $Date: 2007/02/03 21:06:43 $ + Last modified: $Date: 2007/02/03 22:04:27 $ ___ 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: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. > >> > >> The CStringMap implementation uses a quadratically-probed hash table, > >> where > >> @@ -3161,7 +3161,7 @@ > >>mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and > >>mailto:[EMAIL PROTECTED]">Chris Lattner > >>http://llvm.org";>The LLVM Compiler Infrastructure > >> - Last modified: $Date: 2007/02/03 21:06:43 $ > >> + Last modified: $Date: 2007/02/03 22:04:27 $ > >> > >> > >> > >> > >> > >> > >> ___ > >> 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 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. >> >> The CStringMap implementation uses a quadratically-probed hash table, >> where >> @@ -3161,7 +3161,7 @@ >>mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and >>mailto:[EMAIL PROTECTED]">Chris Lattner >>http://llvm.org";>The LLVM Compiler Infrastructure >> - Last modified: $Date: 2007/02/03 21:06:43 $ >> + Last modified: $Date: 2007/02/03 22:04:27 $ >> >> >> >> >> >> >> ___ >> 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 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. > > The CStringMap implementation uses a quadratically-probed hash table, > where > @@ -3161,7 +3161,7 @@ >mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and >mailto:[EMAIL PROTECTED]">Chris Lattner >http://llvm.org";>The LLVM Compiler Infrastructure > - Last modified: $Date: 2007/02/03 21:06:43 $ > + Last modified: $Date: 2007/02/03 22:04:27 $ > > > > > > > ___ > 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.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. The CStringMap implementation uses a quadratically-probed hash table, where @@ -3161,7 +3161,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/02/03 21:06:43 $ + Last modified: $Date: 2007/02/03 22:04:27 $ ___ 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 http://www.pixelglow.com/graphviz/";>Graphviz program, and add -/Applications/Graphviz.app/Contents/MacOS/ (or whereever you install +/Applications/Graphviz.app/Contents/MacOS/ (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. SelectionDAG has been extended to make it easier to locate interesting nodes in large complex graphs. From gdb, if you call DAG.setGraphColor(node, "color"), then the -next call DAG.viewGraph() would hilight the node in the +next call DAG.viewGraph() would highlight the node in the specified color (choices of colors can be found at http://www.graphviz.org/doc/info/colors.html";>colors.) More complex node attributes can be provided with call @@ -671,8 +671,8 @@ -LLVM has a plethora of datastructures in the llvm/ADT/ directory, - and we commonly use STL datastructures. This section describes the tradeoffs +LLVM has a plethora of data structures in the llvm/ADT/ directory, + and we commonly use STL data structures. This section describes the trade-offs you should consider when you pick one. @@ -682,7 +682,7 @@ access the container. Based on that, you should use: -a map-like container if you need efficient lookup +a map-like 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 @@ a sequential 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. -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 SmallVector than vector @@ -751,7 +751,7 @@ consider a SmallVector). 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). @@ -912,7 +912,7 @@ -If you have a set-like datastructure that is usually small and whose elements +If you have a set-like data structure that is usually small and whose elements are reasonably small, a SmallSetis 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 @@ SmallPtrSet 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 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 +does not have an embedded null character in it ("C strings") to an arbitrary other object. The CStringMap i
[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). +inserted into the map) that it needs internally. @@ -3161,7 +3161,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/02/03 20:02:25 $ + Last modified: $Date: 2007/02/03 20:17:53 $ ___ 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 @@ The Core LLVM Class Hierarchy Reference The Type class + The Module class The Value class + +The User class - The User class + The Instruction class + The Constant class + +The GlobalValue class - The Instruction class - - The GetElementPtrInst class - - - The Module class - The Constant class - - The GlobalValue class - - The BasicBlockclass - The Function class - The GlobalVariable class - - - - - - - The Argument class + The Function class + The GlobalVariable class + + + + + +The BasicBlock class +The Argument class + @@ -2334,12 +2330,141 @@ + + + + + The Module class + + + + +#include "llvm/Module.h" doxygen info: +Module Class + +The Module 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 Module class keeps track of a list of Functions, a list of GlobalVariables, and a SymbolTable. Additionally, it contains a few +helpful member functions that try to make common operations easy. + + + + + + Important Public Members of the Module class + + + + + + Module::Module(std::string name = "") + + +Constructing a Module is easy. You can optionally +provide a name for it (probably based on the name of the translation unit). + + + Module::iterator - Typedef for function list iterator +Module::const_iterator - Typedef for const_iterator. + +begin(), end() +size(), empty() + +These are forwarding methods that make it easy to access the contents of +a Module object's Function +list. + + Module::FunctionListType &getFunctionList() + + Returns the list of Functions. This is +necessary to use when you need to update the list or perform a complex +action that doesn't have a forwarding method. + + + + + + + + Module::global_iterator - Typedef for global variable list iterator + +Module::const_global_iterator - Typedef for const_iterator. + +global_begin(), global_end() +global_size(), global_empty() + + These are forwarding methods that make it easy to access the contents of +a Module object's GlobalVariable list. + + Module::GlobalListType &getGlobalList() + +Returns the list of GlobalVariables. This is necessary to +use when you need to update the list or perform a complex action that +doesn't have a forwarding method. + + + + + + + + SymbolTable *getSymbolTable() + +Return a reference to the SymbolTable +for this Module. + + + + + + + + Function *getFunction(const std::string + &Name, const FunctionType *Ty) + +Look up the specified function in the Module SymbolTable. If it does not exist, return +null. + + Function *getOrInsertFunction(const + std::string &Name, const FunctionType *T) + +Look up the specified function in the Module SymbolTable. If it does not exist, add an +external declaration for the function and return it. + + std::string getTypeName(const Type *Ty) + +If there is at least one entry in the SymbolTable for the specified Type, return it. Otherwise return the empty +string. + + bool addTypeName(const std::string &Name, const Type *Ty) + +Insert an entry in the SymbolTable +mapping Name to Ty. If there is already an entry for this +name, true is returned and the SymbolTable is not modified. + + + + + The Value class - + #include "llvm/Value.h" @@ -2587,95 +2712,60 @@ - The BasicBlock class + The Constant class and subclasses -#include "llvm/BasicBlock.h" -doxygen info: BasicBlock -Class -Superclass: Value - -This class represents a single entry multiple exi
[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 @@ "llvm/ADT/UniqueVector.h" Other Set-Like ContainerOptions -Map-Like Containers (std::map, DenseMap, etc) +Map-Like Containers (std::map, DenseMap, etc) + + A sorted 'vector' + "llvm/ADT/CStringMap.h" + "llvm/ADT/IndexedMap.h" + "llvm/ADT/DenseMap.h" +
[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 @@llvm/ADT/ilist + Other Sequential Container Options Set-Like Containers (std::set, SmallSet, SetVector, etc) @@ -64,7 +65,8 @@ "llvm/ADT/FoldingSet.h"
"llvm/ADT/SetVector.h" - Other Options + "llvm/ADT/UniqueVector.h" + Other Set-Like ContainerOptions Map-Like Containers (std::map, DenseMap, etc) @@ -850,7 +852,7 @@ - Other options + Other Sequential Container options @@ -986,13 +988,14 @@ -std::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 +std::set 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). +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. The 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 @@ - Other Options + "llvm/ADT/UniqueVector.h" + + + + + +UniqueVector is similar to SetVector, 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. + +UniqueVector 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. + + + + + + + Other Set-Like Container Options 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). +"hash_set" like containers (whether from C++ TR1 or from the SGI library). std::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 @@ -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. :) + + + + + A sorted 'vector' + + + + + +If your usage pattern follows a strict insert-then-query approach, you can +trivially use the same approach as sorted vectors +for set-like containers. 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. + + + + + + "llvm/ADT/CStringMap.h" + + + + + +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. + +The CStringMap 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 +stored in the same allocation with the string data immediately after the element +object. This container guarantees the "(char*)(&Value+1)" points +to the key string for a value. + +The CStringMap 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 +memory for unrelated objects when looking up a value (even when hash collisions +happen), hash table g
[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 @@ If you have a set-like datastructure that is usually small and whose elements are reasonably small, a SmallSetis 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 SmallPtrSet). The magic of this class is that it handles small sets extremely efficiently, @@ -931,7 +931,7 @@ SmallPtrSet 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. @@ -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. +FoldingSetNode) that uses SmallVector as part of +its ID process. -Consider a case where you want to implement a "getorcreate_foo" method for +Consider 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. To 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. +take place. Construction of the ID usually does not require heap traffic. Because 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 @@ -std::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 +std::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 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. - +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). -The advantages of std::set is that its iterators are stable (deleting or +The 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). std::multiset is useful if you're not interested in elimination of -duplicates, but has all the drawbacks of std::set. A sorted vector or some -other approach is almost always better. +duplicates, but has all the drawbacks of std::set. A sorted vector (whe
[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 @@ -If 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 +If 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 sequential container -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. +your usage pattern has these two distinct phases (insert then query), and can be +coupled with a good choice of sequential container. + + + +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. @@ -983,7 +986,7 @@ std::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 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/02/03 07:59:51 $ + Last modified: $Date: 2007/02/03 08:10:45 $ ___ 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 @@ If you have a set-like datastructure that is usually small and whose elements -are reasonably small, a SmallSetis a good choice. This set +are reasonably small, a SmallSet 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 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/02/03 07:59:07 $ + Last modified: $Date: 2007/02/03 07:59:51 $ ___ 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 @@ Picking the Right Data Structure for a Task -Sequential Containers (std::vector, std::list, etc) -Fixed Size Arrays -Heap Allocated Arrays -"llvm/ADT/SmallVector.h" --llvm/ADT/ilist - +Sequential Containers (std::vector, std::list, etc) + + Fixed Size Arrays + Heap Allocated Arrays + "llvm/ADT/SmallVector.h" +
+ + + llvm/ADT/ilist + +Set-Like Containers (std::set, SmallSet, SetVector, etc) + + A sorted 'vector' + "llvm/ADT/SmallSet.h" + "llvm/ADT/SmallPtrSet.h" + "llvm/ADT/FoldingSet.h" +
+ "llvm/ADT/SetVector.h" + Other Options -Set-Like Containers (std::set, SmallSet, SetVector, etc) Map-Like Containers (std::map, DenseMap, etc) - + Helpful Hints for Common Operations @@ -784,6 +795,22 @@ + + + + +std::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. + +In exchange for this extra flexibility, std::deque has significantly higher +constant factor costs than std::vector. If possible, use std::vector or +something cheaper. + + + + @@ -827,9 +854,7 @@ -Other 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. +Other STL containers are available, such as std::string. There 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 @@ +Set-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. + + + + + + + A sorted 'vector' + + + + +If 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 sequential container +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. + + + + + + "llvm/ADT/SmallSet.h" + + + + +If you have a set-like datastructure that is usually small and whose elements +are reasonably small, a SmallSet
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 +guarantees efficient access (for most types, it falls back to std::set, but for +pointers it uses something far better, see SmallPtrSet). + +The magic of this class is that it handles small sets extremely efficiently, +but gracefully handles extremely large sets without loss of efficiency. The +drawback is that the interface is quite small: it supports insertion, queries +and erasing, but does not support iteration. + + + + + + "llvm/ADT/SmallPtrSet.h" + + + + +SmallPtrSet 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 +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. + +Note that, unlike std::set, the iterators of SmallPtrSet are invalidated +whenever an insertion occurs. Also, the values visited by the iterators are not +visited in sorted order. + + + + + + "llvm/ADT/FoldingSet.h" + + + + -SmallPtrSet -SmallSet -sorted vector -FoldingSet -hash_set
[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 refineAbstractTypeTo method, which is +href="#refineAbstractTypeTo">refineAbstractTypeTo method, which is described next. After that, we describe the PATypeHolder class. @@ -2750,11 +2750,6 @@ this constant. - - bool getValue() const: Returns the underlying value of this - constant. - - ConstantArray : This represents a constant array. const std::vector
[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 @@ call DAG.setGraphColor(node, "color"), then the next call DAG.viewGraph() would hilight the node in the specified color (choices of colors can be found at http://www.graphviz.org/doc/info/colors.html";>Colors.) More +href="http://www.graphviz.org/doc/info/colors.html";>colors.) More complex node attributes can be provided with call DAG.setGraphAttrs(node, "attributes") (choices can be found at http://www.graphviz.org/doc/info/attrs.html";>Graph @@ -1928,7 +1928,7 @@ PointerType - Subclass of SequentialType for pointer types. + Subclass of SequentialType for pointer types. PackedType Subclass of SequentialType for packed (vector) types. A packed type is similar to an ArrayType but is distinguished because it is @@ -2796,7 +2796,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/02/03 03:04:03 $ + Last modified: $Date: 2007/02/03 03:05:57 $ ___ 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 @@ Viewing graphs while debugging code + Picking the Right Data Structure for a Task + +Sequential Containers (std::vector, std::list, etc) +Fixed Size Arrays +Heap Allocated Arrays +"llvm/ADT/SmallVector.h" ++llvm/ADT/ilist + + +Set-Like Containers (std::set, SmallSet, SetVector, etc) +Map-Like Containers (std::map, DenseMap, etc) + + Helpful Hints for Common Operations Basic Inspection and Traversal Routines @@ -632,6 +646,231 @@ + + + Picking the Right Data Structure for a Task + + + + + +LLVM has a plethora of datastructures in the llvm/ADT/ directory, + and we commonly use STL datastructures. This section describes the tradeoffs + you should consider when you pick one. + + +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: + + +a map-like 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. + +a set-like 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. + + +a sequential 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. + + + + + +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 +SmallVector than vector +. Doing so avoids (relatively) expensive malloc/free calls, which dwarf the +cost of adding the elements to the container. + + + + + + Sequential Containers (std::vector, std::list, etc) + + + +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. + + + + + Fixed Size Arrays + + + +Fixed 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. + + + + + Heap Allocated Arrays + + + +Heap allocated arrays (new[] + delete[]) are also simple. They are good if +the number of elements is variable, if you know how many elements you will need +before the array is allocated, and if the array is usually large (if not, +consider a SmallVector). 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 +construct those elements actually used). + + + + + "llvm/ADT/SmallVector.h" + + + +SmallVector
is a simple class that looks and smells +just like vector : +it supports efficient iteration, lays out elements in memory order (so you can +do pointer arithmetic between elements), supports efficient push_back/pop_back +operations, supports efficient random access to its elements, etc. + +The advantage of SmallVector is that it allocates space for +some number of elements (N) in the object itself. Because of this, if +the SmallVector is dynamically smaller than N, no malloc is performed. This can +be a big win in cases where the malloc/free call is far m
[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 @@ - bool isInteger() const: Returns true for any integer type except - a one-bit integer (i1). - - bool isIntegral() const: Returns true for any integer type - including a one-bit integer. + bool isInteger() const: Returns true for any integer type. bool isFloatingPoint(): Return true if this is one of the two floating point types. @@ -2561,7 +2557,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/01/12 17:26:25 $ + Last modified: $Date: 2007/01/15 01:55:32 $ ___ 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.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 @@ The Core LLVM Class Hierarchy Reference + The Type class The Value class The User class @@ -122,7 +123,6 @@ - The Type class The Argument class @@ -1602,6 +1602,8 @@ +#include "llvm/Type.h" +doxygen info: Type Class The 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 @@ + The Type class and Derived Types + + + + + Type is a superclass of all type classes. Every Value has + a Type. Type cannot be instantiated directly but only + through its subclasses. Certain primitive types (VoidType, + LabelType, FloatType and DoubleType) have hidden + subclasses. They are hidden because they offer no useful functionality beyond + what the Type class offers except to distinguish themselves from + other subclasses of Type. + All other types are subclasses of DerivedType. 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 + Type* values, the types are identical if the pointers are identical. + + + + + + Important Public Methods + + + + + + bool isInteger() const: Returns true for any integer type except + a one-bit integer (i1). + + bool isIntegral() const: Returns true for any integer type + including a one-bit integer. + + bool isFloatingPoint(): Return true if this is one of the two + floating point types. + + bool isAbstract(): Return true if the type is abstract (contains + an OpaqueType anywhere in its definition). + + bool isSized(): Return true if the type has known size. Things + that don't have a size are abstract types, labels and void. + + + + + + + Important Derived Types + + + + IntegerType + Subclass of DerivedType that represents integer types of any bit width. + Any bit width between IntegerType::MIN_INT_BITS (1) and + IntegerType::MAX_INT_BITS (~8 million) can be represented. + +static const IntegerType* get(unsigned NumBits): get an integer +type of a specific bit width. +unsigned getBitWidth() const: Get the bit width of an integer +type. + + + SequentialType + This is subclassed by ArrayType and PointerType + + const Type * getElementType() const: Returns the type of each + of the elements in the sequential type. + + + ArrayType + This is a subclass of SequentialType and defines the interface for array + types. + + unsigned getNumElements() const: Returns the number of + elements in the array. + + + PointerType + Subclass of SequentialType for pointer types. + PackedType + Subclass 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 + vector operations and are usually small vectors of of an integer or floating + point type. + StructType + Subclass of DerivedTypes for struct types. + FunctionType + Subclass of DerivedTypes for function types. + + bool isVarArg() const: Returns true if its a vararg + function + const Type * getReturnType() const: Returns the + return type of the function. + const Type * getParamType (unsigned i): Returns + the type of the ith parameter. + const unsigned getNumParams() const: Returns the + number of formal parameters. + + + OpaqueType + Sublcass of DerivedType for abstract types. This class + defines no content and is used as a placeholder for some other type. Note + that OpaqueType is used (temporarily) during type resolution for forward + references of types. Once the referenced type is resolved, the OpaqueType + is replaced with the actual type. OpaqueType can also be used for data + abstraction. At link time opaque types can be resolved to actual types
[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 @@ The STATISTIC 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. +defined ("NumXForms" in this case) acts like an unsigned integer. Whenever you make a transformation, bump the counter: @@ -1278,8 +1278,8 @@ For our purposes below, we need three concepts. First, an "Opaque Type" is exactly as defined in the language reference. Second an "Abstract Type" is any type which includes an -opaque type as part of its type graph (for example "{ opaque, int }"). -Third, a concrete type is a type that is not an abstract type (e.g. "{ int, +opaque type as part of its type graph (for example "{ opaque, i32 }"). +Third, a concrete type is a type that is not an abstract type (e.g. "{ i32, float }"). @@ -1300,7 +1300,7 @@ -%mylist = type { %mylist*, int } +%mylist = type { %mylist*, i32 } @@ -1317,7 +1317,7 @@ Elts.push_back(Type::IntTy); StructType *NewSTy = StructType::get(Elts); -// At this point, NewSTy = "{ opaque*, int }". Tell VMCore that +// At this point, NewSTy = "{ opaque*, i32 }". Tell VMCore that // the struct and the opaque type are actually the same. cast(StructTy.get())->refineAbstractTypeTo(NewSTy); @@ -1357,7 +1357,7 @@ 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 also deleted. Obviously whenever a type is deleted, any "Type*" pointers in the program are invalidated. As such, it is safest to avoid having any "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 -abstract types. Concrete types (those that do not include an opaque objects -somewhere) can never be refined. + abstract types. Concrete types (those that do not include any opaque +objects) can never be refined. @@ -1647,7 +1647,7 @@ -%foo = add int 1, 2 +%foo = add i32 1, 2 @@ -1988,11 +1988,11 @@ when using the GetElementPtrInst instruction because this pointer must be dereferenced first. For example, if you have a GlobalVariable (a subclass of GlobalValue) that is an array of 24 ints, type [24 x -int], then the GlobalVariable is a pointer to that array. Although +i32], then the GlobalVariable is a pointer to that array. Although the address of the first element of this array and the value of the GlobalVariable are the same, they have different types. The -GlobalVariable's type is [24 x int]. The first element's type -is int. Because of this, accessing a global value requires you to +GlobalVariable's type is [24 x i32]. The first element's type +is i32. Because of this, accessing a global value requires you to dereference the pointer with GetElementPtrInst first, then its elements can be accessed. This is explained in the LLVM Language Reference Manual. @@ -2429,15 +2429,19 @@ -Type 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 for comparing -types. - + Type is a superclass of all type classes. Every Value has + a Type. Type cannot be instantiated directly but only + through its subclasses. Certain primitive types (VoidType, + LabelType, FloatType and DoubleType) have hidden + subclasses. They are hidden because
[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 @@ Constant 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. @@ -2381,12 +2381,16 @@ Important Subclasses of Constant - ConstantInt : This subclass of Constant represents an integer constant. + ConstantInt : This subclass of Constant represents an integer constant of + any width, including boolean (1 bit integer). int64_t getSExtValue() const: Returns the underlying value of this constant as a sign extended signed integer value. uint64_t getZExtValue() const: Returns the underlying value of this constant as a zero extended unsigned integer value. + static ConstantInt* get(const Type *Ty, uint64_t Val): + Returns the ConstantInt object that represents the value provided by + Val for integer type Ty. ConstantFP : This class represents a floating point constant. @@ -2395,7 +2399,6 @@ this constant. - ConstantBool : This represents a boolean constant. bool getValue() const: Returns the underlying value of this constant. @@ -2519,7 +2522,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/01/07 00:41:39 $ + Last modified: $Date: 2007/01/12 03:36:33 $ ___ 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 @@ This class provides a symbol table that the Function and Module classes use for naming definitions. The symbol table can -provide a name for any Value or Type. SymbolTable is an abstract data -type. It hides the data it contains and provides access to it through a -controlled interface. - -Note 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 Value. +SymbolTable is an abstract data type. It hides the data it contains +and provides access to it through a controlled interface. + +Note that the SymbolTable 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 Values have names, and those without names (i.e. they have an empty name) do not exist in the symbol table. @@ -1442,9 +1442,8 @@ structure of the information it holds. The class contains two std::map objects. The first, pmap, is a map of Type* to maps of name (std::string) to Value*. -The second, tmap, is a map of names to Type*. Thus, Values -are stored in two-dimensions and accessed by Type and name. Types, -however, are stored in a single dimension and accessed only by name. +Thus, Values are stored in two-dimensions and accessed by Type and +name. The interface of this class provides three basic types of operations: @@ -1456,7 +1455,7 @@ insert. Iterators. Iterators allow the user to traverse the content of the symbol table in well defined ways, such as the method - type_begin. + plane_begin. Accessors @@ -1467,15 +1466,6 @@ Ty parameter for a Value with the provided name. If a suitable Value is not found, null is returned. - Type* lookupType( const std::string& name) const: - The lookupType method searches through the types for a - Type with the provided name. If a suitable Type - is not found, null is returned. - - bool hasTypes() const: - This function returns true if an entry has been made into the type - map. - bool isEmpty() const: This function returns true if both the value and types maps are empty @@ -1493,12 +1483,6 @@ name. There can be a many to one mapping between names and constants or types. - void insert(const std::string& Name, Type *Typ): - 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. - void remove(Value* Val): 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. - void remove(Type* Typ): - 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. - Value* remove(const std::string& Name, Value *Val): Remove a constant or type with the specified name from the symbol table. - Type* remove(const std::string& Name, Type* T): - Remove a type with the specified name from the symbol table. - Returns the removed Type. - - Value *value_remove(const value_iterator& It): + Value *remove(const value_iterator& It): Removes a specific value from the symbol table. Returns the removed value. @@ -1551,16 +1525,6 @@ -All name/Type PairsTI - -for (SymbolTable::type_const_iterator TI = ST.type_begin(), - TE = ST.type_end(); TI != TE; ++TI ) { - TI->first // This is the name of the type - TI->second // This is the Type* value associated with the name -} - - - name/Value pairs in a planeVI for (SymbolTable::value_const_iterator VI = ST.value_begin(SomeType), @@ -1618,20 +1582,6 @@ marker for end of iteration of the type plane. Note: the type plane must already exist before using this. - type_iterator type_begin(): - Get an iterator to the start of the name/Type map. - - type_const_iterator type_begin() cons: - Get a
[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 @@ Frequently, we might have an instance of the Value Class and we want to +href="/doxygen/classllvm_1_1Value.html">Value Class and we want to determine which Users use the Value. The list of all Users of a particular Value is called a def-use chain. For example, let's say we have a Function* named F to a @@ -1225,7 +1225,7 @@ You can use Value::replaceAllUsesWith and User::replaceUsesOfWith to change more than one use at a time. See the -doxygen documentation for the Value Class +doxygen documentation for the Value Class and User Class, respectively, for more information. @@ -1669,7 +1669,7 @@ #include "llvm/Value.h" -doxygen info: Value Class +doxygen info: Value Class The Value 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 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/12/20 04:23:36 $ + Last modified: $Date: 2007/01/04 22:01:45 $ ___ 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.99 -> 1.100 --- 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.99 llvm/docs/ProgrammersManual.html:1.100 --- llvm/docs/ProgrammersManual.html:1.99 Tue Dec 19 17:12:09 2006 +++ llvm/docs/ProgrammersManual.htmlTue Dec 19 22:23:36 2006 @@ -1279,7 +1279,7 @@ exactly as defined in the language reference. Second an "Abstract Type" is any type which includes an opaque type as part of its type graph (for example "{ opaque, int }"). -Third, a concrete type is a type that is not an abstract type (e.g. "[ int, +Third, a concrete type is a type that is not an abstract type (e.g. "{ int, float }"). @@ -2569,7 +2569,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/12/19 23:12:09 $ + Last modified: $Date: 2006/12/20 04:23:36 $ ___ 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.98 -> 1.99 --- Log message: Remove documentation for isSigned and isUnsigned methods of Type class. --- Diffs of the changes: (+2 -12) ProgrammersManual.html | 14 ++ 1 files changed, 2 insertions(+), 12 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.98 llvm/docs/ProgrammersManual.html:1.99 --- llvm/docs/ProgrammersManual.html:1.98 Tue Dec 19 15:46:21 2006 +++ llvm/docs/ProgrammersManual.htmlTue Dec 19 17:12:09 2006 @@ -2495,17 +2495,7 @@ - - bool isSigned() const: Returns whether an integral numeric type - is signed. This is true for SByteTy, ShortTy, IntTy, LongTy. Note that this is - not true for Float and Double. - - bool isUnsigned() const: Returns whether a numeric type is - unsigned. This is not quite the complement of isSigned... nonnumeric types - return false as they do with isSigned. This returns true for UByteTy, - UShortTy, UIntTy, and ULongTy. - - bool isInteger() const: Equivalent to isSigned() || isUnsigned(). + bool isInteger() const: True for any integer type. bool isIntegral() const: Returns true if this is an integral type, which is either Bool type or one of the Integer types. @@ -2579,7 +2569,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/12/19 21:46:21 $ + Last modified: $Date: 2006/12/19 23:12:09 $ ___ 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 -debug-only option - The Statistic template & -stats + The Statistic class & -stats option - The Statistic template & -stats + The Statistic class & -stats option @@ -493,7 +493,7 @@ The "llvm/ADT/Statistic.h" file -provides a template named Statistic that is used as a unified way to +provides a class named Statistic 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. @@ -501,7 +501,7 @@ Often 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 Statistic template makes it very easy to +for big programs. Using the Statistic 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. @@ -513,13 +513,15 @@ -static Statistic<> NumXForms("mypassname", "The # of times I did stuff"); +#define DEBUG_TYPE "mypassname" // This goes before any #includes. +STATISTIC(NumXForms, "The # of times I did stuff"); - The Statistic 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). + The STATISTIC 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. Whenever you make a transformation, bump the counter: @@ -2577,7 +2579,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/12/19 19:47:19 $ + Last modified: $Date: 2006/12/19 21:46:21 $ ___ 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 Instruction class is the llvm/Instruction.def 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 -Instruction::Add and Instruction::SetLE), as well as the +Instruction::Add and Instruction::ICmp), as well as the concrete sub-classes of Instruction that implement the instruction (for example BinaryOperator and SetCondInst). Unfortunately, the use of macros in +href="#CmpInst">CmpInst). Unfortunately, the use of macros in this file confuses doxygen, so these enum values don't show up correctly in the doxygen output. @@ -1862,6 +1862,29 @@ + Important Subclasses of the Instruction + class + + + +BinaryOperator +This subclasses represents all two operand instructions whose operands +must be the same type, except for the comparison instructions. +CastInst +This subclass is the parent of the 12 casting instructions. It provides +common operations on cast instructions. +CmpInst +This subclass respresents the two comparison instructions, +ICmpInst (integer opreands), and +FCmpInst (floating point operands). +TerminatorInst +This subclass is the parent of all terminator instructions (those which +can terminate a block). + + + + + Important Public Members of the Instruction class @@ -2554,7 +2577,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/12/07 20:04:41 $ + Last modified: $Date: 2006/12/19 19:47:19 $ ___ 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 @@ Constant 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. +is subclassed by ConstantBool, ConstantInt, ConstantArray etc for representing +the various types of Constants. @@ -2406,17 +2406,12 @@ Important Subclasses of Constant - ConstantSInt : This subclass of Constant represents a signed integer - constant. + ConstantInt : This subclass of Constant represents an integer constant. - int64_t getValue() const: Returns the underlying value of - this constant. - - - ConstantUInt : This class represents an unsigned integer. - - uint64_t getValue() const: Returns the underlying value of - this constant. + int64_t getSExtValue() const: Returns the underlying value of + this constant as a sign extended signed integer value. + uint64_t getZExtValue() const: Returns the underlying value + of this constant as a zero extended unsigned integer value. ConstantFP : This class represents a floating point constant. @@ -2559,7 +2554,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/10/11 18:00:22 $ + Last modified: $Date: 2006/10/20 07:07:23 $ 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 @@ std::vectorindex_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 ); @@ -367,9 +367,9 @@ Constants are Values like anything else and can be operands of instructions Integer 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. - There'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. + There's a special method on Constant class which allows you to get the null constant for any type. This is really handy for initializing large arrays or structures, etc. @@ -1405,7 +1405,7 @@ mailto:[EMAIL PROTECTED]">Reid Spencer http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2006/03/14 05:39:39 $ + Last modified: $Date: 2006/10/20 07:07:23 $ ___ 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 @@ Function::viewCFGOnly() (does not include the instructions), the MachineFunction::viewCFG() and MachineFunction::viewCFGOnly(), and the SelectionDAG::viewGraph() methods. Within GDB, for example, -you can usually use something like "call DAG.viewGraph()" to pop +you can usually use something like call DAG.viewGraph() to pop up a window. Alternatively, you can sprinkle calls to these functions in your code in places you want to debug. @@ -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. +SelectionDAG has been extended to make it easier to locate +interesting nodes in large complex graphs. From gdb, if you +call DAG.setGraphColor(node, "color"), then the +next call DAG.viewGraph() would hilight the node in the +specified color (choices of colors can be found at http://www.graphviz.org/doc/info/colors.html";>Colors.) More +complex node attributes can be provided with call +DAG.setGraphAttrs(node, "attributes") (choices can be +found at http://www.graphviz.org/doc/info/attrs.html";>Graph +Attributes.) If you want to restart and clear all the current graph +attributes, then you can call DAG.clearGraphAttrs(). + @@ -2281,7 +2293,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/04/14 14:11:48 $ + Last modified: $Date: 2006/10/02 12:28:07 $ ___ 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.html">llvm/GlobalValue.h" doxygen info: GlobalValue Class -Superclasses: User, Value +Superclasses: Constant, +User, Value Global values (GlobalVariables or Functions) are the only LLVM values that are @@ -1778,15 +1778,17 @@ #include "llvm/Function.h" doxygen info: Function Class -Superclasses: GlobalValue, User, Value +Superclasses: GlobalValue, +Constant, +User, +Value The Function 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 Function class keeps track -of a list of BasicBlocks, a list of formal Arguments, and a SymbolTable. +of a list of BasicBlocks, a list of formal +Arguments, and a +SymbolTable. The list of BasicBlocks is the most commonly used part of Function objects. The list imposes an implicit @@ -1915,20 +1917,22 @@ href="/doxygen/GlobalVariable_8h-source.html">llvm/GlobalVariable.h" doxygen info: GlobalVariable -Class Superclasses: GlobalValue, User, Value + Class +Superclasses: GlobalValue, +Constant, +User, +Value Global variables are represented with the (suprise suprise) GlobalVariable class. Like functions, GlobalVariables are also subclasses of GlobalValue, and as such are always referenced by their address (global values must live in memory, so their -"name" refers to their address). See GlobalValue for more on this. Global variables -may have an initial value (which must be a Constant), and if they have an initializer, they -may be marked as "constant" themselves (indicating that their contents never -change at runtime). - +"name" refers to their constant address). See +GlobalValue for more on this. Global +variables may have an initial value (which must be a +Constant), and if they have an initializer, +they may be marked as "constant" themselves (indicating that their contents +never change at runtime). @@ -2277,7 +2281,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/03/14 05:39:39 $ + Last modified: $Date: 2006/04/14 14:11:48 $ ___ 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.88 -> 1.89 --- Log message: Use std:: where appropriate --- Diffs of the changes: (+5 -5) ProgrammersManual.html | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.88 llvm/docs/ProgrammersManual.html:1.89 --- llvm/docs/ProgrammersManual.html:1.88 Tue Nov 1 15:12:49 2005 +++ llvm/docs/ProgrammersManual.htmlSun Nov 27 20:30:22 2005 @@ -590,7 +590,7 @@ an example that prints the name of a BasicBlock and the number of Instructions it contains: -// func is a pointer to a Function instance for (Function::iterator i = func->begin(), e = func->end(); i != e; ++i) { // print out the name of the basic block if it has one, and then the // number of instructions that it contains cerr << "Basic block (name=" << i->getName() << ") has " << i->size() << " instructions.\n"; } +// func is a pointer to a Function instance for (Function::iterator i = func->begin(), e = func->end(); i != e; ++i) { // print out the name of the basic block if it has one, and then the // number of instructions that it contains std::cerr << "Basic block (name=" << i->getName() << ") has " << i->size() << " instructions.\n"; } Note that i can be used as if it were a pointer for the purposes of invoking member functions of the Instruction class. This is @@ -645,7 +645,7 @@ and then instantiate InstIterators explicitly in your code. Here's a small example that shows how to dump all instructions in a function to the standard error stream: - #include "llvm/Support/InstIterator.h"...// Suppose F is a ptr to a functionfor (inst_iterator i = inst_begin(F), e = inst_end(F); i != e; ++i) cerr << *i << "\n"; + #include "llvm/Support/InstIterator.h"...// Suppose F is a ptr to a functionfor (inst_iterator i = inst_begin(F), e = inst_end(F); i != e; ++i) std::cerr << *i << "\n"; Easy, isn't it? You can also use InstIterators to fill a worklist with its initial contents. For example, if you wanted to initialize a worklist to contain all instructions in a Function @@ -693,7 +693,7 @@ iterators. By using these, you can explicitly grab the iterator of something without actually obtaining it via iteration over some structure: - void printNextInstruction(Instruction* inst) { BasicBlock::iterator it(inst);++it; // after this line, it refers to the instruction after *inst.if (it != inst->getParent()->end()) cerr << *it << "\n";} + void printNextInstruction(Instruction* inst) { BasicBlock::iterator it(inst);++it; // after this line, it refers to the instruction after *inst.if (it != inst->getParent()->end()) std::cerr << *it << "\n";} @@ -768,7 +768,7 @@ use foo is as simple as iterating over the def-use chain of F: - Function* F = ...;for (Value::use_iterator i = F->use_begin(), e = F->use_end(); i != e; ++i) {if (Instruction *Inst = dyn_cast(*i)) {cerr << "F is used in instruction:\n";cerr << *Inst << "\n"; }} + Function* F = ...;for (Value::use_iterator i = F->use_begin(), e = F->use_end(); i != e; ++i) {if (Instruction *Inst = dyn_cast (*i)) {std::cerr << "F is used in instruction:\n";std::cerr << *Inst << "\n"; }} Alternately, it's common to have an instance of the User Class and need to know what @@ -2277,7 +2277,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.cs.uiuc.edu";>The LLVM Compiler Infrastructure - Last modified: $Date: 2005/11/01 21:12:49 $ + Last modified: $Date: 2005/11/28 02:30:22 $ ___ 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 * 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 @@ The isa<>, cast<> and dyn_cast<> templates - The DEBUG() macro & -debug + The DEBUG() macro and -debug option Fine grained debug info with DEBUG_TYPE @@ -264,7 +264,8 @@ - The isa<>, cast<> and dyn_cast<> templates + The isa<>, cast<> and + dyn_cast<> templates @@ -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 dynamic_cast operator in C++, and should be used in the - same circumstances. Typically, the dyn_cast<> operator is used - in an if statement or some other flow control statement like this: + much like the dynamic_cast<> operator in C++, and should be + used in the same circumstances. Typically, the dyn_cast<> + operator is used in an if statement or some other flow control + statement like this: - + if (AllocationInst *AI = dyn_cast(Val)) { ... } - + -This form of the if statement effectively combines together a - call to isa<> and a call to cast<> into one - statement, which is very convenient. - - Note that the dyn_cast<> operator, like C++'s - dynamic_cast or Java's instanceof operator, can be abused. - In particular you should not use big chained if/then/else 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 - InstVisitor class to dispatch over the instruction type directly. + This form of the if statement effectively combines together a call + to isa<> and a call to cast<> into one + statement, which is very convenient. + + Note that the dyn_cast<> operator, like C++'s + dynamic_cast<> or Java's instanceof operator, can be + abused. In particular, you should not use big chained if/then/else + 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 + InstVisitor class to dispatch over the instruction type directly. - + -cast_or_null<>: - -The cast_or_null<> operator works just like the -cast<> 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. - -dyn_cast_or_null<>: - -The dyn_cast_or_null<> operator works just like the -dyn_cast<> 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. + cast_or_null<>: + + The cast_or_null<> operator works just like the + cast<> 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. + + dyn_cast_or_null<>: + + The dyn_cast_or_null<> operator works just like the + dyn_cast<> 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. - + These 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 @@ - The DEBUG() macro & -debug option + The DEBUG() macro and -debug option @@ -2275,7 +2277,7 @@ mailto:[EMAIL PROTECTED]">Dinakar Dhurjati and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.cs.uiuc.edu";>The LLVM Compiler Infrastructure - Last modified: $Date: 2005/10/17 01:36:23 $ + Last modified: $Date: 2005/11/01 21:12:49 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits