X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FProgrammersManual.html;h=64ddb9d105d7ce7e2942b9208d8920bce84df005;hb=7eafc3e7be067709c6fcdae7b7fc4994c7ec2377;hp=5068d0110875b9e8d1c29897780a9ec0ef5f0958;hpb=2946d1c928a6933c9f9b0544b58af61cdab36822;p=oota-llvm.git diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html index 5068d011087..64ddb9d105d 100644 --- a/docs/ProgrammersManual.html +++ b/docs/ProgrammersManual.html @@ -2,14 +2,15 @@ "http://www.w3.org/TR/html4/strict.dtd"> + LLVM Programmer's Manual - + -
+

LLVM Programmer's Manual -

+
  1. Introduction
  2. @@ -28,6 +29,13 @@ -

    Replacing multiple uses of Users and Values

    + + +
    Replacing multiple uses of Users and Values

    You can use Value::replaceAllUsesWith and User::replaceUsesOfWith to change more than one use at a time. See the @@ -2023,11 +2652,11 @@ ReplaceInstWithValue, ReplaceInstWithInst --> -

    +

    Deleting GlobalVariables -

    + -
    +

    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 @@ -2044,199 +2673,266 @@ GV->eraseFromParent();

    - - - -
    -

    -This section describes some of the advanced or obscure API's that most clients -do not need to be aware of. These API's tend manage the inner workings of the -LLVM system, and only need to be accessed in unusual circumstances. -

    + +

    + How to Create Types +

    + +
    + +

    In generating IR, you may need some complex types. If you know these types +statically, you can use TypeBuilder<...>::get(), defined +in llvm/Support/TypeBuilder.h, to retrieve them. TypeBuilder +has two forms depending on whether you're building types for cross-compilation +or native library use. TypeBuilder<T, true> requires +that T be independent of the host environment, meaning that it's built +out of types from +the llvm::types +namespace and pointers, functions, arrays, etc. built of +those. TypeBuilder<T, false> additionally allows native C types +whose size may depend on the host compiler. For example,

    + +
    +
    +FunctionType *ft = TypeBuilder<types::i<8>(types::i<32>*), true>::get();
    +
    - -
    - LLVM Type Resolution +

    is easier to read and write than the equivalent

    + +
    +
    +std::vector<const Type*> params;
    +params.push_back(PointerType::getUnqual(Type::Int32Ty));
    +FunctionType *ft = FunctionType::get(Type::Int8Ty, params, false);
    +
    -
    +

    See the class +comment for more details.

    +
    + +
    + + +

    + Threads and LLVM +

    + + +

    -The LLVM type system has a very simple goal: allow clients to compare types for -structural equality with a simple pointer comparison (aka a shallow compare). -This goal makes clients much simpler and faster, and is used throughout the LLVM -system. +This section describes the interaction of the LLVM APIs with multithreading, +both on the part of client applications, and in the JIT, in the hosted +application.

    -Unfortunately achieving this goal is not a simple matter. In particular, -recursive types and late resolution of opaque types makes the situation very -difficult to handle. Fortunately, for the most part, our implementation makes -most clients able to be completely unaware of the nasty internal details. The -primary case where clients are exposed to the inner workings of it are when -building a recursive type. In addition to this case, the LLVM bitcode reader, -assembly parser, and linker also have to be aware of the inner workings of this -system. +Note that LLVM's support for multithreading is still relatively young. Up +through version 2.5, the execution of threaded hosted applications was +supported, but not threaded client access to the APIs. While this use case is +now supported, clients must adhere to the guidelines specified below to +ensure proper operation in multithreaded mode.

    -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, i32 }"). -Third, a concrete type is a type that is not an abstract type (e.g. "{ i32, -float }"). +Note that, on Unix-like platforms, LLVM requires the presence of GCC's atomic +intrinsics in order to support threaded operation. If you need a +multhreading-capable LLVM on a platform without a suitably modern system +compiler, consider compiling LLVM and LLVM-GCC in single-threaded mode, and +using the resultant compiler to build a copy of LLVM with multithreading +support.

    -
    - - - + +

    + Entering and Exiting Multithreaded Mode +

    -
    +

    -Because the most common question is "how do I build a recursive type with LLVM", -we answer it now and explain it as we go. Here we include enough to cause this -to be emitted to an output .ll file: +In order to properly protect its internal data structures while avoiding +excessive locking overhead in the single-threaded case, the LLVM must intialize +certain data structures necessary to provide guards around its internals. To do +so, the client program must invoke llvm_start_multithreaded() before +making any concurrent LLVM API calls. To subsequently tear down these +structures, use the llvm_stop_multithreaded() call. You can also use +the llvm_is_multithreaded() call to check the status of multithreaded +mode.

    -
    -
    -%mylist = type { %mylist*, i32 }
    -
    -
    -

    -To build this, use the following LLVM APIs: +Note that both of these calls must be made in isolation. That is to +say that no other LLVM API calls may be executing at any time during the +execution of llvm_start_multithreaded() or llvm_stop_multithreaded +. It's is the client's responsibility to enforce this isolation.

    -
    -
    -// Create the initial outer struct
    -PATypeHolder StructTy = OpaqueType::get();
    -std::vector<const Type*> Elts;
    -Elts.push_back(PointerType::getUnqual(StructTy));
    -Elts.push_back(Type::Int32Ty);
    -StructType *NewSTy = StructType::get(Elts);
    -
    -// 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);
    -
    -// NewSTy is potentially invalidated, but StructTy (a PATypeHolder) is
    -// kept up-to-date
    -NewSTy = cast<StructType>(StructTy.get());
    -
    -// Add a name for the type to the module symbol table (optional)
    -MyModule->addTypeName("mylist", NewSTy);
    -
    +

    +The return value of llvm_start_multithreaded() indicates the success or +failure of the initialization. Failure typically indicates that your copy of +LLVM was built without multithreading support, typically because GCC atomic +intrinsics were not found in your system compiler. In this case, the LLVM API +will not be safe for concurrent calls. However, it will be safe for +hosting threaded applications in the JIT, though care +must be taken to ensure that side exits and the like do not accidentally +result in concurrent LLVM API calls. +

    + +

    + Ending Execution with llvm_shutdown() +

    + +

    -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 -described next. After that, we describe the PATypeHolder class. +When you are done using the LLVM APIs, you should call llvm_shutdown() +to deallocate memory used for internal structures. This will also invoke +llvm_stop_multithreaded() if LLVM is operating in multithreaded mode. +As such, llvm_shutdown() requires the same isolation guarantees as +llvm_stop_multithreaded().

    +

    +Note that, if you use scope-based shutdown, you can use the +llvm_shutdown_obj class, which calls llvm_shutdown() in its +destructor.

    - - + +

    + Lazy Initialization with ManagedStatic +

    -
    +

    -The refineAbstractTypeTo method starts the type unification process. -While this method is actually a member of the DerivedType class, it is most -often used on OpaqueType instances. Type unification is actually a recursive -process. After unification, types can become structurally isomorphic to -existing types, and all duplicates are deleted (to preserve pointer equality). +ManagedStatic is a utility class in LLVM used to implement static +initialization of static resources, such as the global type tables. Before the +invocation of llvm_shutdown(), it implements a simple lazy +initialization scheme. Once llvm_start_multithreaded() returns, +however, it uses double-checked locking to implement thread-safe lazy +initialization.

    -In the example above, the OpaqueType object is definitely deleted. -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 -live across a call to refineAbstractTypeTo (note that non-abstract -types can never move or be deleted). To deal with this, the PATypeHolder class is used to maintain a stable -reference to a possibly refined type, and the AbstractTypeUser class is used to update more -complex datastructures. +Note that, because no other threads are allowed to issue LLVM API calls before +llvm_start_multithreaded() returns, it is possible to have +ManagedStatics of llvm::sys::Mutexs.

    +

    +The llvm_acquire_global_lock() and llvm_release_global_lock +APIs provide access to the global lock used to implement the double-checked +locking for lazy initialization. These should only be used internally to LLVM, +and only if you know what you're doing! +

    - - + +

    + Achieving Isolation with LLVMContext +

    -
    +

    -PATypeHolder is a form of a "smart pointer" for Type objects. When VMCore -happily goes about nuking types that become isomorphic to existing types, it -automatically updates all PATypeHolder objects to point to the new type. In the -example above, this allows the code to maintain a pointer to the resultant -resolved recursive type, even though the Type*'s are potentially invalidated. +LLVMContext is an opaque class in the LLVM API which clients can use +to operate multiple, isolated instances of LLVM concurrently within the same +address space. For instance, in a hypothetical compile-server, the compilation +of an individual translation unit is conceptually independent from all the +others, and it would be desirable to be able to compile incoming translation +units concurrently on independent server threads. Fortunately, +LLVMContext exists to enable just this kind of scenario!

    -PATypeHolder is an extremely light-weight object that uses a lazy union-find -implementation to update pointers. For example the pointer from a Value to its -Type is maintained by PATypeHolder objects. +Conceptually, LLVMContext provides isolation. Every LLVM entity +(Modules, Values, Types, Constants, etc.) +in LLVM's in-memory IR belongs to an LLVMContext. Entities in +different contexts cannot interact with each other: Modules in +different contexts cannot be linked together, Functions cannot be added +to Modules in different contexts, etc. What this means is that is is +safe to compile on multiple threads simultaneously, as long as no two threads +operate on entities within the same context.

    -
    +

    +In practice, very few places in the API require the explicit specification of a +LLVMContext, other than the Type creation/lookup APIs. +Because every Type carries a reference to its owning context, most +other entities can determine what context they belong to by looking at their +own Type. If you are adding new entities to LLVM IR, please try to +maintain this interface design. +

    - -
    - The AbstractTypeUser Class +

    +For clients that do not require the benefits of isolation, LLVM +provides a convenience API getGlobalContext(). This returns a global, +lazily initialized LLVMContext that may be used in situations where +isolation is not a concern. +

    -
    + +

    + Threads and the JIT +

    +

    -Some data structures need more to perform more complex updates when types get -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 - abstract types. Concrete types (those that do not include any opaque -objects) can never be refined. +LLVM's "eager" JIT compiler is safe to use in threaded programs. Multiple +threads can call ExecutionEngine::getPointerToFunction() or +ExecutionEngine::runFunction() concurrently, and multiple threads can +run code output by the JIT concurrently. The user must still ensure that only +one thread accesses IR in a given LLVMContext while another thread +might be modifying it. One way to do that is to always hold the JIT lock while +accessing IR outside the JIT (the JIT modifies the IR by adding +CallbackVHs). Another way is to only +call getPointerToFunction() from the LLVMContext's thread. +

    + +

    When the JIT is configured to compile lazily (using +ExecutionEngine::DisableLazyCompilation(false)), there is currently a +race condition in +updating call sites after a function is lazily-jitted. It's still possible to +use the lazy JIT in a threaded program if you ensure that only one thread at a +time can call any particular lazy stub and that the JIT lock guards any IR +access, but we suggest using only the eager JIT in threaded programs.

    +
    + + +

    + Advanced Topics +

    + + +
    +

    +This section describes some of the advanced or obscure API's that most clients +do not need to be aware of. These API's tend manage the inner workings of the +LLVM system, and only need to be accessed in unusual circumstances. +

    + - +

    + The ValueSymbolTable class +

    -
    +

    The ValueSymbolTable class provides a symbol table that the Function and Module classes use for naming value definitions. The symbol table can provide a name for any Value. -The -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 @@ -2246,24 +2942,23 @@ all LLVM an empty name) do not exist in the symbol table.

    -

    These symbol tables support iteration over the values/types in the symbol +

    Symbol tables support iteration over the values 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.

    +appropriate symbol table.

    - + -
    +

    The User class provides a basis for expressing the ownership of User towards other @@ -2272,18 +2967,19 @@ Use helper class is employed to do the bookkeeping and to facilitate -

    +

    + + Interaction and relationship between User and Use objects + +

    -
    +

    A subclass of User can choose between incorporating its Use objects or refer to them out-of-line by means of a pointer. A mixed variant (some Uses inline others hung off) is impractical and breaks the invariant that the Use objects belonging to the same User form a contiguous array.

    -

    We have 2 different layouts in the User (sub)classes: @@ -2332,17 +3028,18 @@ enforce the following memory layouts:

    (In the above figures 'P' stands for the Use** that is stored in each Use object in the member Use::Prev) +
    + - + -
    +

    Since the Use objects are deprived of the direct (back)pointer to their User objects, there must be a fast and exact method to recover it. This is accomplished by the following scheme:

    -
    A bit-encoding in the 2 LSBits (least significant bits) of the Use::Prev allows to find the start of the User object: @@ -2373,15 +3070,16 @@ Only the significant number of bits need to be stored between the stops, so that the worst case is 20 memory accesses when there are 1000 Use objects associated with a User.

    +
    + - + -
    +

    The following literate Haskell fragment demonstrates the concept:

    -
    @@ -2463,10 +3161,14 @@ And here is the result of <deepCheck identityProp>:

    OK, passed 500 tests.
    +
    + - + + +

    To maintain the invariant that the 2 LSBits of each Use** in Use @@ -2482,13 +3184,17 @@ the LSBit set. (Portability is relying on the fact that all known compilers plac

    - - + +
    + + +

    + The Core LLVM Class Hierarchy Reference +

    -
    +

    #include "llvm/Type.h"
    doxygen info: Type Class

    @@ -2497,14 +3203,12 @@ being inspected or transformed. The core LLVM classes are defined in header files in the include/llvm/ directory, and implemented in the lib/VMCore directory.

    -
    - - + -
    +

    Type is a superclass of all type classes. Every Value has a Type. Type cannot be instantiated directly but only @@ -2519,24 +3223,20 @@ the lib/VMCore directory.

    be performed with address equality of the Type Instance. That is, given two Type* values, the types are identical if the pointers are identical.

    -
    - + -
    +
      -
    • bool isInteger() const: Returns true for any integer type.
    • +
    • bool isIntegerTy() const: Returns true for any integer type.
    • -
    • bool isFloatingPoint(): Return true if this is one of the two +
    • bool isFloatingPointTy(): Return true if this is one of the five 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.
    • @@ -2544,10 +3244,10 @@ the lib/VMCore directory.

    - -
    + +
    IntegerType
    Subclass of DerivedType that represents integer types of any bit width. @@ -2561,7 +3261,7 @@ the lib/VMCore directory.

    SequentialType
    -
    This is subclassed by ArrayType and PointerType +
    This is subclassed by ArrayType, PointerType and VectorType.
    • const Type * getElementType() const: Returns the type of each of the elements in the sequential type.
    • @@ -2580,7 +3280,7 @@ the lib/VMCore directory.

      VectorType
      Subclass of SequentialType for vector types. A vector type is similar to an ArrayType but is distinguished because it is - a first class type wherease ArrayType is not. Vector types are used for + a first class type whereas ArrayType is not. Vector types are used for vector operations and are usually small vectors of of an integer or floating point type.
      StructType
      @@ -2588,7 +3288,7 @@ the lib/VMCore directory.

      FunctionType
      Subclass of DerivedTypes for function types.
        -
      • bool isVarArg() const: Returns true if its a vararg +
      • bool isVarArg() const: Returns true if it's a vararg function
      • const Type * getReturnType() const: Returns the return type of the function.
      • @@ -2598,25 +3298,17 @@ the lib/VMCore directory.

        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 - of the same name.
    - +
    - + -
    +

    #include "llvm/Module.h"
    doxygen info: @@ -2631,23 +3323,20 @@ href="#GlobalVariable">GlobalVariables, and a SymbolTable. Additionally, it contains a few helpful member functions that try to make common operations easy.

    -
    - - + -
    +
      -
    • Module::Module(std::string name = "")
    • -
    +
  3. Module::Module(std::string name = "") -

    Constructing a Module is easy. You can optionally +

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

    +
  4. -
    • Module::iterator - Typedef for function list iterator
      Module::const_iterator - Typedef for const_iterator.
      @@ -2705,8 +3394,9 @@ provide a name for it (probably based on the name of the translation unit).


        -
      • Function *getFunction(const std::string - &Name, const FunctionType *Ty) + +
      • Function *getFunction(StringRef Name) const +

        Look up the specified function in the Module SymbolTable. If it does not exist, return @@ -2737,13 +3427,14 @@ provide a name for it (probably based on the name of the translation unit).

    +
    - + -
    +

    #include "llvm/Value.h"
    @@ -2794,19 +3485,17 @@ the class that represents this value. Although this may take some getting used to, it simplifies the representation and makes it easier to manipulate.

    -
    - - + -
    +
    • Value::use_iterator - Typedef for iterator over the use-list
      - Value::use_const_iterator - Typedef for const_iterator over + Value::const_use_iterator - Typedef for const_iterator over the use-list
      unsigned use_size() - Returns the number of users of the value.
      @@ -2848,12 +3537,14 @@ Inst->replaceAllUsesWith(ConstVal);
    +
    + - + -
    +

    #include "llvm/User.h"
    @@ -2872,14 +3563,12 @@ Single Assignment (SSA) form, there can only be one definition referred to, allowing this direct connection. This connection provides the use-def information in LLVM.

    -
    - - + -
    +

    The User class exposes the operand list in two ways: through an index access interface and through an iterator based interface.

    @@ -2902,12 +3591,14 @@ the operands of a User.

    +
    + - + -
    +

    #include "llvm/Instruction.h"
    @@ -2938,14 +3629,13 @@ 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.

    -
    - - -
    +

    + + Important Subclasses of the Instruction class + +

    +
    • BinaryOperator

      This subclasses represents all two operand instructions whose operands @@ -2964,12 +3654,13 @@ this file confuses doxygen, so these enum values don't show up correctly in the

    - +

    + + Important Public Members of the Instruction class + +

    -
    +
    • BasicBlock *getParent() @@ -2989,12 +3680,14 @@ and it has no name

    +
    + - + -
    +

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

    -
    - -
    Important Subclasses of Constant
    -
    +

    Important Subclasses of Constant

    +
    • ConstantInt : This subclass of Constant represents an integer constant of any width. @@ -3054,13 +3745,14 @@ a subclass, which represents the address of a global variable or function.
    +
    - + -
    +

    #include "llvm/GlobalValue.h"
    @@ -3100,15 +3792,14 @@ dereference the pointer with GetElementPtrInst first, then its elements can be accessed. This is explained in the LLVM Language Reference Manual.

    -
    - - +

    + + Important Public Members of the GlobalValue class + +

    -
    +
    • bool hasInternalLinkage() const
      @@ -3124,12 +3815,14 @@ GlobalValue is currently embedded into.

    +
    + - + -
    +

    #include "llvm/Function.h"
    doxygen @@ -3140,7 +3833,7 @@ Superclasses: GlobalValue, 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 +actually one of the more complex classes in the LLVM hierarchy 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 @@ -3149,7 +3842,7 @@ of a list of BasicBlocks, a list of formal

    The list of BasicBlocks is the most commonly used part of Function objects. The list imposes an implicit ordering of the blocks in the function, which indicate how the code will be -layed out by the backend. Additionally, the first BasicBlock is the implicit entry node for the Function. It is not legal in LLVM to explicitly branch to this initial block. There are no implicit exit nodes, and in fact there may be multiple exit @@ -3176,22 +3869,22 @@ href="#Argument">Arguments in the function body.

    Note that Function is a GlobalValue and therefore also a Constant. The value of the function is its address (after linking) which is guaranteed to be constant.

    -
    - +

    + + Important Public Members of the Function class + +

    -
    +
    • Function(const FunctionType *Ty, LinkageTypes Linkage, const std::string &N = "", Module* Parent = 0)

      Constructor used when you need to create new Functions to add - the the program. The constructor must specify the type of the function to + the program. The constructor must specify the type of the function to create and what type of linkage the function should have. The FunctionType argument specifies the formal arguments and return value for the function. The same @@ -3262,12 +3955,14 @@ iterator

    +
    + - + -
    +

    #include "llvm/GlobalVariable.h" @@ -3279,7 +3974,7 @@ Superclasses: GlobalValue, User, Value

    -

    Global variables are represented with the (suprise suprise) +

    Global variables are represented with the (surprise surprise) 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 @@ -3289,15 +3984,15 @@ 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).

    -
    - +

    + + Important Public Members of the GlobalVariable class + +

    -
    +
    • GlobalVariable(const Type *Ty, bool @@ -3307,11 +4002,12 @@ never change at runtime).

      Create a new global variable of the specified type. If isConstant is true then the global variable will be marked as unchanging for the program. The Linkage parameter specifies the type of - linkage (internal, external, weak, linkonce, appending) for the variable. If - the linkage is InternalLinkage, WeakLinkage, or LinkOnceLinkage,  then - the resultant global variable will have internal linkage. AppendingLinkage - concatenates together all instances (in different translation units) of the - variable into a single variable but is only applicable to arrays.  See + linkage (internal, external, weak, linkonce, appending) for the variable. + If the linkage is InternalLinkage, WeakAnyLinkage, WeakODRLinkage, + LinkOnceAnyLinkage or LinkOnceODRLinkage,  then the resultant + global variable will have internal linkage. AppendingLinkage concatenates + together all instances (in different translation units) of the variable + into a single variable but is only applicable to arrays.  See the LLVM Language Reference for further details on linkage types. Optionally an initializer, a name, and the module to put the variable into may be specified for the global variable as @@ -3328,27 +4024,28 @@ never change at runtime).

    • Constant *getInitializer() -

      Returns the intial value for a GlobalVariable. It is not legal +

      Returns the initial value for a GlobalVariable. It is not legal to call this method if there is no initializer.

    +
    - + -
    +

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

    -

    This class represents a single entry multiple exit section of the code, +

    This class represents a single entry single 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. @@ -3365,15 +4062,14 @@ href="#Value">Values, because they are referenced by instructions like branches and can go in the switch tables. BasicBlocks have type label.

    -
    - - +

    + + Important Public Members of the BasicBlock class + +

    -
    +
    • BasicBlock(const std::string &Name = "",
    +
    - + -
    +

    This subclass of Value defines the interface for incoming formal arguments to a function. A Function maintains a list of its formal @@ -3439,6 +4136,8 @@ arguments. An argument has a pointer to the parent Function.

    +
    +
    @@ -3449,7 +4148,7 @@ arguments. An argument has a pointer to the parent Function.

    Dinakar Dhurjati and Chris Lattner
    - The LLVM Compiler Infrastructure
    + The LLVM Compiler Infrastructure
    Last modified: $Date$