From 2b78d967ea35ff0f4b501e7024cd5e36ca7e5940 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 3 Feb 2007 20:02:25 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33838 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ProgrammersManual.html | 497 ++++++++++++++++++------------------ 1 file changed, 247 insertions(+), 250 deletions(-) diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html index 67b240ae887..ed81a734c0a 100644 --- a/docs/ProgrammersManual.html +++ b/docs/ProgrammersManual.html @@ -135,31 +135,27 @@ with another Value
  • The Core LLVM Class Hierarchy Reference
  • @@ -2334,12 +2330,141 @@ the lib/VMCore directory.

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

    Constructing a Module is easy. You can optionally +provide a name for it (probably based on the name of the translation unit).

    + + + +
    + + + +
    + + + +
    + + + +
    + +
    The Value class
    -
    +

    #include "llvm/Value.h"
    @@ -2587,95 +2712,60 @@ and it has no name

    -

    #include "llvm/BasicBlock.h"
    -doxygen info: BasicBlock -Class
    -Superclass: Value

    - -

    This class represents a single entry multiple exit section of the code, -commonly known as a basic block by the compiler community. The -BasicBlock class maintains a list of Instructions, which form the body of the block. -Matching the language definition, the last element of this list of instructions -is always a terminator instruction (a subclass of the TerminatorInst class).

    - -

    In addition to tracking the list of instructions that make up the block, the -BasicBlock class also keeps track of the Function that it is embedded into.

    - -

    Note that BasicBlocks themselves are Values, because they are referenced by instructions -like branches and can go in the switch tables. BasicBlocks have type -label.

    +

    Constant represents a base class for different types of constants. It +is subclassed by ConstantInt, ConstantArray, etc. for representing +the various types of Constants. GlobalValue is also +a subclass, which represents the address of a global variable or function. +

    - - +
    Important Subclasses of Constant
    -
      - -
    • BasicBlock(const std::string &Name = "", Function *Parent = 0) - -

      The BasicBlock constructor is used to create new basic blocks for -insertion into a function. The constructor optionally takes a name for the new -block, and a Function to insert it into. If -the Parent parameter is specified, the new BasicBlock is -automatically inserted at the end of the specified Function, if not specified, the BasicBlock must be -manually inserted into the Function.

    • - -
    • BasicBlock::iterator - Typedef for instruction list iterator
      -BasicBlock::const_iterator - Typedef for const_iterator.
      -begin(), end(), front(), back(), -size(), empty() -STL-style functions for accessing the instruction list. - -

      These methods and typedefs are forwarding functions that have the same -semantics as the standard library methods of the same names. These methods -expose the underlying instruction list of a basic block in a way that is easy to -manipulate. To get the full complement of container operations (including -operations to update the list), you must use the getInstList() -method.

    • - -
    • BasicBlock::InstListType &getInstList() - -

      This method is used to get access to the underlying container that actually -holds the Instructions. This method must be used when there isn't a forwarding -function in the BasicBlock class for the operation that you would like -to perform. Because there are no forwarding functions for "updating" -operations, you need to use this if you want to update the contents of a -BasicBlock.

    • - -
    • Function *getParent() - -

      Returns a pointer to Function the block is -embedded into, or a null pointer if it is homeless.

    • - -
    • TerminatorInst *getTerminator() - -

      Returns a pointer to the terminator instruction that appears at the end of -the BasicBlock. If there is no terminator instruction, or if the last -instruction in the block is not a terminator, then a null pointer is -returned.

    • - +
    • 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.
      • +
      • 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. +
        +
      • double getValue() const: Returns the underlying value of + this constant.
      • +
      +
    • +
    • ConstantArray : This represents a constant array. +
        +
      • const std::vector<Use> &getValues() const: Returns + a vector of component constants that makeup this array.
      • +
      +
    • +
    • ConstantStruct : This represents a constant struct. +
        +
      • const std::vector<Use> &getValues() const: Returns + a vector of component constants that makeup this array.
      • +
      +
    • +
    • GlobalValue : This represents either a global variable or a function. In + either case, the value is a constant fixed address (after linking). +
    -
    +
    The GlobalValue class @@ -2955,191 +3045,98 @@ never change at runtime).

    +

    #include "llvm/Module.h"
    doxygen info: -Module Class

    +href="/doxygen/BasicBlock_8h-source.html">llvm/BasicBlock.h"
    +doxygen info: BasicBlock +Class
    +Superclass: Value

    -

    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.

    +

    This class represents a single entry multiple exit section of the code, +commonly known as a basic block by the compiler community. The +BasicBlock class maintains a list of Instructions, which form the body of the block. +Matching the language definition, the last element of this list of instructions +is always a terminator instruction (a subclass of the TerminatorInst class).

    + +

    In addition to tracking the list of instructions that make up the block, the +BasicBlock class also keeps track of the Function that it is embedded into.

    + +

    Note that BasicBlocks themselves are Values, because they are referenced by instructions +like branches and can go in the switch tables. BasicBlocks have type +label.

    -
      -
    • 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).

    +
  • BasicBlock(const std::string &Name = "", Function *Parent = 0) -
      -
    • Module::iterator - Typedef for function list iterator
      - Module::const_iterator - Typedef for const_iterator.
      +

      The BasicBlock constructor is used to create new basic blocks for +insertion into a function. The constructor optionally takes a name for the new +block, and a Function to insert it into. If +the Parent parameter is specified, the new BasicBlock is +automatically inserted at the end of the specified Function, if not specified, the BasicBlock must be +manually inserted into the Function.

    • - begin(), end() - size(), empty() +
    • BasicBlock::iterator - Typedef for instruction list iterator
      +BasicBlock::const_iterator - Typedef for const_iterator.
      +begin(), end(), front(), back(), +size(), empty() +STL-style functions for accessing the instruction list. -

      These are forwarding methods that make it easy to access the contents of - a Module object's Function - list.

    • +

      These methods and typedefs are forwarding functions that have the same +semantics as the standard library methods of the same names. These methods +expose the underlying instruction list of a basic block in a way that is easy to +manipulate. To get the full complement of container operations (including +operations to update the list), you must use the getInstList() +method.

      -
    • Module::FunctionListType &getFunctionList() +
    • BasicBlock::InstListType &getInstList() -

      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.

      +

      This method is used to get access to the underlying container that actually +holds the Instructions. This method must be used when there isn't a forwarding +function in the BasicBlock class for the operation that you would like +to perform. Because there are no forwarding functions for "updating" +operations, you need to use this if you want to update the contents of a +BasicBlock.

    • -

      -
    +
  • Function *getParent() -
    +

    Returns a pointer to Function the block is +embedded into, or a null pointer if it is homeless.

  • -
      -
    • Module::global_iterator - Typedef for global variable list iterator
      +
    • TerminatorInst *getTerminator() - Module::const_global_iterator - Typedef for const_iterator.
      +

      Returns a pointer to the terminator instruction that appears at the end of +the BasicBlock. If there is no terminator instruction, or if the last +instruction in the block is not a terminator, then a null pointer is +returned.

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

      - -

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

    - - -
    - -

    Constant represents a base class for different types of constants. It -is subclassed by ConstantInt, ConstantArray, etc. for representing -the various types of Constants.

    - -
    - - - -
    -
    - - -
    Important Subclasses of 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. -
        -
      • double getValue() const: Returns the underlying value of - this constant.
      • -
      -
    • -
    • ConstantArray : This represents a constant array. -
        -
      • const std::vector<Use> &getValues() const: Returns - a vector of component constants that makeup this array.
      • -
      -
    • -
    • ConstantStruct : This represents a constant struct. -
        -
      • const std::vector<Use> &getValues() const: Returns - a vector of component constants that makeup this array.
      • -
      -
    • -
    • GlobalValue : This represents either a global variable or a function. In - either case, the value is a constant fixed address (after linking). -
    • -
    -