llvm.org GIT mirror llvm / bddcb94
For PR778: Move file-scoped documentation to class-scoped so it is more readily accessible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28689 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 14 years ago
6 changed file(s) with 82 addition(s) and 46 deletion(s). Raw diff Collapse all Expand all
66 //
77 //===----------------------------------------------------------------------===//
88 //
9 // The AbstractTypeUser class is an interface to be implemented by classes who
10 // could possible use an abstract type. Abstract types are denoted by the
11 // isAbstract flag set to true in the Type class. These are classes that
12 // contain an Opaque type in their structure somehow.
13 //
14 // Classes must implement this interface so that they may be notified when an
15 // abstract type is resolved. Abstract types may be resolved into more concrete
16 // types through: linking, parsing, and bytecode reading. When this happens,
17 // all of the users of the type must be updated to reference the new, more
18 // concrete type. They are notified through the AbstractTypeUser interface.
19 //
20 // In addition to this, AbstractTypeUsers must keep the use list of the
21 // potentially abstract type that they reference up-to-date. To do this in a
22 // nice, transparent way, the PATypeHandle class is used to hold "Potentially
23 // Abstract Types", and keep the use list of the abstract types up-to-date.
9 // This file declares the AbstractTypeUser class.
2410 //
2511 //===----------------------------------------------------------------------===//
2612
4127 class Type;
4228 class DerivedType;
4329
30 /// The AbstractTypeUser class is an interface to be implemented by classes who
31 /// could possibly use an abstract type. Abstract types are denoted by the
32 /// isAbstract flag set to true in the Type class. These are classes that
33 /// contain an Opaque type in their structure somewhere.
34 ///
35 /// Classes must implement this interface so that they may be notified when an
36 /// abstract type is resolved. Abstract types may be resolved into more
37 /// concrete types through: linking, parsing, and bytecode reading. When this
38 /// happens, all of the users of the type must be updated to reference the new,
39 /// more concrete type. They are notified through the AbstractTypeUser
40 /// interface.
41 ///
42 /// In addition to this, AbstractTypeUsers must keep the use list of the
43 /// potentially abstract type that they reference up-to-date. To do this in a
44 /// nice, transparent way, the PATypeHandle class is used to hold "Potentially
45 /// Abstract Types", and keep the use list of the abstract types up-to-date.
46 /// @brief LLVM Abstract Type User Representation
4447 class AbstractTypeUser {
4548 protected:
4649 virtual ~AbstractTypeUser(); // Derive from me
66 //
77 //===----------------------------------------------------------------------===//
88 //
9 // This file defines the Argument class, which represents an incoming formal
10 // argument to a Function.
9 // This file declares the Argument class.
1110 //
1211 //===----------------------------------------------------------------------===//
1312
2221 template
2322 typename SubClass> class SymbolTableListTraits;
2423
24 /// A class to represent an incoming formal argument to a Function. An argument
25 /// is a very simple Value. It is essentially a named (optional) type. When used
26 /// in the body of a function, it represents the value of the actual argument
27 /// the function was called with.
28 /// @brief LLVM Argument representation
2529 class Argument : public Value { // Defined in the Function.cpp file
2630 Function *Parent;
2731
77 //===----------------------------------------------------------------------===//
88 //
99 //
10 // This file contains the declaration of the BasicBlock class, which represents
11 // a single basic block in the VM.
12 //
13 // Note that basic blocks themselves are Value's, because they are referenced
14 // by instructions like branches and can go in switch tables and stuff...
15 //
16 ///===---------------------------------------------------------------------===//
17 //
18 // Note that well formed basic blocks are formed of a list of instructions
19 // followed by a single TerminatorInst instruction. TerminatorInst's may not
20 // occur in the middle of basic blocks, and must terminate the blocks.
21 //
22 // This code allows malformed basic blocks to occur, because it may be useful
23 // in the intermediate stage modification to a program.
24 //
10 // This file contains the declaration of the BasicBlock class.
2511 //===----------------------------------------------------------------------===//
2612
2713 #ifndef LLVM_BASICBLOCK_H
4531 static iplist &getList(BasicBlock *BB);
4632 };
4733
34 /// This represents a single basic block in LLVM. A basic block is simply a
35 /// container of instructions that execute sequentially. Basic blocks are Values
36 /// because they are referenced by instructions such as branches and switch
37 /// tables. The type of a BasicBlock is "Type::LabelTy" because the basic block
38 /// represents a label to which a branch can jump.
39 ///
40 /// A well formed basic block is formed of a list of non-terminating
41 /// instructions followed by a single TerminatorInst instruction.
42 /// TerminatorInst's may not occur in the middle of basic blocks, and must
43 /// terminate the blocks. The BasicBlock class allows malformed basic blocks to
44 /// occur because it may be useful in the intermediate stage of constructing or
45 /// modifying a program. However, the verifier will ensure that basic blocks
46 /// are "well formed".
47 /// @brief LLVM Basic Block Representation
4848 class BasicBlock : public Value { // Basic blocks are data objects also
4949 public:
5050 typedef iplist InstListType;
66 //
77 //===----------------------------------------------------------------------===//
88 //
9 // This file defines a set of enums which specify the assigned numeric values
10 // for known llvm calling conventions.
9 // This file defines LLVM's set of calling conventions.
1110 //
1211 //===----------------------------------------------------------------------===//
1312
2019 /// the well-known calling conventions.
2120 ///
2221 namespace CallingConv {
22 /// A set of enums which specify the assigned numeric values for known llvm
23 /// calling conventions.
24 /// @brief LLVM Calling Convention Representation
2325 enum ID {
2426 // C - The default llvm calling convention, compatible with C. This
2527 // convention is the only calling convention that supports varargs calls.
1717
1818 namespace llvm {
1919
20 /// This is an important base class in LLVM. It provides the common facilities
21 /// of all constant values in an LLVM program. A constant is a value that is
22 /// immutable at runtime. Functions are constants because their address is
23 /// immutable. Same with global variables.
24 ///
25 /// All constants share the capabilities provided in this class. All constants
26 /// can have a null value. They can have an operand list. Constants can be
27 /// simple (integer and floating point values), complex (arrays and structures),
28 /// or expression based (computations yielding a constant value composed of
29 /// only certain operators and other constant values).
30 ///
31 /// Note that Constants are immutable (once created they never change)
32 /// and are fully shared by structural equivalence. This means that two
33 /// structurally equivalent constants will always have the same address.
34 /// Constant's are created on demand as needed and never deleted: thus clients
35 /// don't have to worry about the lifetime of the objects.
36 /// @brief LLVM Constant Representation
2037 class Constant : public User {
2138 void operator=(const Constant &); // Do not implement
2239 Constant(const Constant &); // Do not implement
66 //
77 //===----------------------------------------------------------------------===//
88 //
9 // This file defines the very important Value class. This is subclassed by a
10 // bunch of other important classes, like Instruction, Function, Type, etc...
11 //
9 // This file declares the Value class.
1210 // This file also defines the Use<> template for users of value.
1311 //
1412 //===----------------------------------------------------------------------===//
3735 // Value Class
3836 //===----------------------------------------------------------------------===//
3937
40 /// Value - The base class of all values computed by a program that may be used
41 /// as operands to other values.
38 /// This is a very important LLVM class. It is the base class of all values
39 /// computed by a program that may be used as operands to other values. Value is
40 /// the super class of other important classes such as Instruction and Function.
41 /// All Values have a Type. Type is not a subclass of Value. All types can have
42 /// a name and they should belong to some Module. Setting the name on the Value
43 /// automatically update's the module's symbol table.
4244 ///
45 /// Every value has a "use list" that keeps track of which other Values are
46 /// using this Value.
47 /// @brief LLVM Value Representation
4348 class Value {
4449 unsigned short SubclassID; // Subclass identifier (for isa/dyn_cast)
4550 protected:
132137 ///
133138 void addUse(Use &U) { U.addToList(&UseList); }
134139
135 /// getValueType - Return an ID for the concrete type of this object. This is
136 /// used to implement the classof checks. This should not be used for any
137 /// other purpose, as the values may change as LLVM evolves. Also, note that
138 /// starting with the InstructionVal value, the value stored is actually the
139 /// Instruction opcode, so there are more than just these values possible here
140 /// (and Instruction must be last).
141 ///
140 /// An enumeration for keeping track of the concrete subclass of Value that
141 /// is actually instantiated. Values of this enumeration are kept in the
142 /// Value classes SubclassID field. They are used for concrete type
143 /// identification.
142144 enum ValueTy {
143145 ArgumentVal, // This is an instance of Argument
144146 BasicBlockVal, // This is an instance of BasicBlock
162164 ConstantFirstVal = FunctionVal,
163165 ConstantLastVal = ConstantPointerNullVal
164166 };
167
168 /// getValueType - Return an ID for the concrete type of this object. This is
169 /// used to implement the classof checks. This should not be used for any
170 /// other purpose, as the values may change as LLVM evolves. Also, note that
171 /// starting with the InstructionVal value, the value stored is actually the
172 /// Instruction opcode, so there are more than just these values possible here
173 /// (and Instruction must be last).
174 ///
165175 unsigned getValueType() const {
166176 return SubclassID;
167177 }