diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html index d98573e253a..9a09c9bb484 100644 --- a/docs/ProgrammersManual.html +++ b/docs/ProgrammersManual.html @@ -521,7 +521,7 @@ STATISTIC(NumXForms, "The # of times I did stuff");

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 @@ system. 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 @@ to be emitted to an output .ll file:
    -%mylist = type { %mylist*, int }
    +%mylist = type { %mylist*, i32 }
     
    @@ -1317,7 +1317,7 @@ Elts.push_back(PointerType::get(StructTy)); 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<OpaqueType>(StructTy.get())->refineAbstractTypeTo(NewSTy); @@ -1357,7 +1357,7 @@ existing types, and all duplicates are deleted (to preserve pointer equality).

    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 @@ 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 -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 @@ method. In addition, all LLVM values can be named. The "name" of the
    -%foo = add int 1, 2
    +%foo = add i32 1, 2
     
    @@ -1988,11 +1988,11 @@ global is always a pointer to its contents. It is important to remember this 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 @@ the various types of Constants.

    -

    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 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. +

    @@ -2448,17 +2452,21 @@ types.

    @@ -2468,6 +2476,16 @@ types.