[llvm-commits] CVS: llvm/include/llvm/AbstractTypeUser.h Argument.h BasicBlock.h CallingConv.h Constant.h Value.h

Reid Spencer reid at x10sys.com
Mon Jun 5 09:29:19 PDT 2006



Changes in directory llvm/include/llvm:

AbstractTypeUser.h updated: 1.26 -> 1.27
Argument.h updated: 1.11 -> 1.12
BasicBlock.h updated: 1.57 -> 1.58
CallingConv.h updated: 1.3 -> 1.4
Constant.h updated: 1.29 -> 1.30
Value.h updated: 1.83 -> 1.84
---
Log message:

For PR778: http://llvm.cs.uiuc.edu/PR778 :
Move file-scoped documentation to class-scoped so it is more readily
accessible.


---
Diffs of the changes:  (+82 -46)

 AbstractTypeUser.h |   33 ++++++++++++++++++---------------
 Argument.h         |    8 ++++++--
 BasicBlock.h       |   30 +++++++++++++++---------------
 CallingConv.h      |    6 ++++--
 Constant.h         |   17 +++++++++++++++++
 Value.h            |   34 ++++++++++++++++++++++------------
 6 files changed, 82 insertions(+), 46 deletions(-)


Index: llvm/include/llvm/AbstractTypeUser.h
diff -u llvm/include/llvm/AbstractTypeUser.h:1.26 llvm/include/llvm/AbstractTypeUser.h:1.27
--- llvm/include/llvm/AbstractTypeUser.h:1.26	Sat Nov 12 02:42:30 2005
+++ llvm/include/llvm/AbstractTypeUser.h	Mon Jun  5 11:29:06 2006
@@ -7,21 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// The AbstractTypeUser class is an interface to be implemented by classes who
-// could possible use an abstract type.  Abstract types are denoted by the
-// isAbstract flag set to true in the Type class.  These are classes that
-// contain an Opaque type in their structure somehow.
-//
-// Classes must implement this interface so that they may be notified when an
-// abstract type is resolved.  Abstract types may be resolved into more concrete
-// types through: linking, parsing, and bytecode reading.  When this happens,
-// all of the users of the type must be updated to reference the new, more
-// concrete type.  They are notified through the AbstractTypeUser interface.
-//
-// In addition to this, AbstractTypeUsers must keep the use list of the
-// potentially abstract type that they reference up-to-date.  To do this in a
-// nice, transparent way, the PATypeHandle class is used to hold "Potentially
-// Abstract Types", and keep the use list of the abstract types up-to-date.
+// This file declares the AbstractTypeUser class.
 //
 //===----------------------------------------------------------------------===//
 
@@ -42,6 +28,23 @@
 class Type;
 class DerivedType;
 
+/// The AbstractTypeUser class is an interface to be implemented by classes who
+/// could possibly use an abstract type.  Abstract types are denoted by the
+/// isAbstract flag set to true in the Type class.  These are classes that
+/// contain an Opaque type in their structure somewhere.
+///
+/// Classes must implement this interface so that they may be notified when an
+/// abstract type is resolved.  Abstract types may be resolved into more 
+/// concrete types through: linking, parsing, and bytecode reading.  When this 
+/// happens, all of the users of the type must be updated to reference the new,
+/// more concrete type.  They are notified through the AbstractTypeUser 
+/// interface.
+///
+/// In addition to this, AbstractTypeUsers must keep the use list of the
+/// potentially abstract type that they reference up-to-date.  To do this in a
+/// nice, transparent way, the PATypeHandle class is used to hold "Potentially
+/// Abstract Types", and keep the use list of the abstract types up-to-date.
+/// @brief LLVM Abstract Type User Representation
 class AbstractTypeUser {
 protected:
   virtual ~AbstractTypeUser();                        // Derive from me


Index: llvm/include/llvm/Argument.h
diff -u llvm/include/llvm/Argument.h:1.11 llvm/include/llvm/Argument.h:1.12
--- llvm/include/llvm/Argument.h:1.11	Thu Apr 21 15:11:51 2005
+++ llvm/include/llvm/Argument.h	Mon Jun  5 11:29:06 2006
@@ -7,8 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file defines the Argument class, which represents an incoming formal
-// argument to a Function.
+// This file declares the Argument class. 
 //
 //===----------------------------------------------------------------------===//
 
@@ -23,6 +22,11 @@
 template<typename ValueSubClass, typename ItemParentClass, typename SymTabClass,
          typename SubClass> class SymbolTableListTraits;
 
+/// A class to represent an incoming formal argument to a Function. An argument
+/// is a very simple Value. It is essentially a named (optional) type. When used
+/// in the body of a function, it represents the value of the actual argument
+/// the function was called with.
+/// @brief LLVM Argument representation  
 class Argument : public Value {  // Defined in the Function.cpp file
   Function *Parent;
 


Index: llvm/include/llvm/BasicBlock.h
diff -u llvm/include/llvm/BasicBlock.h:1.57 llvm/include/llvm/BasicBlock.h:1.58
--- llvm/include/llvm/BasicBlock.h:1.57	Tue Oct 25 12:59:28 2005
+++ llvm/include/llvm/BasicBlock.h	Mon Jun  5 11:29:06 2006
@@ -8,21 +8,7 @@
 //===----------------------------------------------------------------------===//
 //
 //
-// This file contains the declaration of the BasicBlock class, which represents
-// a single basic block in the VM.
-//
-// Note that basic blocks themselves are Value's, because they are referenced
-// by instructions like branches and can go in switch tables and stuff...
-//
-///===---------------------------------------------------------------------===//
-//
-// Note that well formed basic blocks are formed of a list of instructions
-// followed by a single TerminatorInst instruction.  TerminatorInst's may not
-// occur in the middle of basic blocks, and must terminate the blocks.
-//
-// This code allows malformed basic blocks to occur, because it may be useful
-// in the intermediate stage modification to a program.
-//
+// This file contains the declaration of the BasicBlock class.
 //===----------------------------------------------------------------------===//
 
 #ifndef LLVM_BASICBLOCK_H
@@ -46,6 +32,20 @@
   static iplist<Instruction> &getList(BasicBlock *BB);
 };
 
+/// This represents a single basic block in LLVM. A basic block is simply a
+/// container of instructions that execute sequentially. Basic blocks are Values
+/// because they are referenced by instructions such as branches and switch
+/// tables. The type of a BasicBlock is "Type::LabelTy" because the basic block
+/// represents a label to which a branch can jump.
+///
+/// A well formed basic block is formed of a list of non-terminating 
+/// instructions followed by a single TerminatorInst instruction.  
+/// TerminatorInst's may not occur in the middle of basic blocks, and must 
+/// terminate the blocks. The BasicBlock class allows malformed basic blocks to
+/// occur because it may be useful in the intermediate stage of constructing or
+/// modifying a program. However, the verifier will ensure that basic blocks
+/// are "well formed".
+/// @brief LLVM Basic Block Representation
 class BasicBlock : public Value {       // Basic blocks are data objects also
 public:
   typedef iplist<Instruction> InstListType;


Index: llvm/include/llvm/CallingConv.h
diff -u llvm/include/llvm/CallingConv.h:1.3 llvm/include/llvm/CallingConv.h:1.4
--- llvm/include/llvm/CallingConv.h:1.3	Fri May 19 16:19:02 2006
+++ llvm/include/llvm/CallingConv.h	Mon Jun  5 11:29:06 2006
@@ -7,8 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file defines a set of enums which specify the assigned numeric values
-// for known llvm calling conventions.
+// This file defines LLVM's set of calling conventions. 
 //
 //===----------------------------------------------------------------------===//
 
@@ -21,6 +20,9 @@
 /// the well-known calling conventions.
 ///
 namespace CallingConv {
+  /// A set of enums which specify the assigned numeric values for known llvm 
+  /// calling conventions.
+  /// @brief LLVM Calling Convention Representation
   enum ID {
     // C - The default llvm calling convention, compatible with C.  This
     // convention is the only calling convention that supports varargs calls.


Index: llvm/include/llvm/Constant.h
diff -u llvm/include/llvm/Constant.h:1.29 llvm/include/llvm/Constant.h:1.30
--- llvm/include/llvm/Constant.h:1.29	Fri Mar 10 17:52:03 2006
+++ llvm/include/llvm/Constant.h	Mon Jun  5 11:29:06 2006
@@ -18,6 +18,23 @@
 
 namespace llvm {
 
+/// This is an important base class in LLVM. It provides the common facilities
+/// of all constant values in an LLVM program. A constant is a value that is
+/// immutable at runtime. Functions are constants because their address is
+/// immutable. Same with global variables. 
+/// 
+/// All constants share the capabilities provided in this class. All constants
+/// can have a null value. They can have an operand list. Constants can be
+/// simple (integer and floating point values), complex (arrays and structures),
+/// or expression based (computations yielding a constant value composed of 
+/// only certain operators and other constant values).
+/// 
+/// Note that Constants are immutable (once created they never change) 
+/// and are fully shared by structural equivalence.  This means that two 
+/// structurally equivalent constants will always have the same address.  
+/// Constant's are created on demand as needed and never deleted: thus clients 
+/// don't have to worry about the lifetime of the objects.
+/// @brief LLVM Constant Representation
 class Constant : public User {
   void operator=(const Constant &);     // Do not implement
   Constant(const Constant &);           // Do not implement


Index: llvm/include/llvm/Value.h
diff -u llvm/include/llvm/Value.h:1.83 llvm/include/llvm/Value.h:1.84
--- llvm/include/llvm/Value.h:1.83	Wed Jan 25 19:54:21 2006
+++ llvm/include/llvm/Value.h	Mon Jun  5 11:29:06 2006
@@ -7,9 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file defines the very important Value class.  This is subclassed by a
-// bunch of other important classes, like Instruction, Function, Type, etc...
-//
+// This file declares the Value class. 
 // This file also defines the Use<> template for users of value.
 //
 //===----------------------------------------------------------------------===//
@@ -38,9 +36,16 @@
 //                                 Value Class
 //===----------------------------------------------------------------------===//
 
-/// Value - The base class of all values computed by a program that may be used
-/// as operands to other values.
+/// This is a very important LLVM class. It is the base class of all values 
+/// computed by a program that may be used as operands to other values. Value is
+/// the super class of other important classes such as Instruction and Function.
+/// All Values have a Type. Type is not a subclass of Value. All types can have
+/// a name and they should belong to some Module. Setting the name on the Value
+/// automatically update's the module's symbol table.
 ///
+/// Every value has a "use list" that keeps track of which other Values are
+/// using this Value.
+/// @brief LLVM Value Representation
 class Value {
   unsigned short SubclassID;         // Subclass identifier (for isa/dyn_cast)
 protected:
@@ -133,13 +138,10 @@
   ///
   void addUse(Use &U) { U.addToList(&UseList); }
 
-  /// getValueType - Return an ID for the concrete type of this object.  This is
-  /// used to implement the classof checks.  This should not be used for any
-  /// other purpose, as the values may change as LLVM evolves.  Also, note that
-  /// starting with the InstructionVal value, the value stored is actually the
-  /// Instruction opcode, so there are more than just these values possible here
-  /// (and Instruction must be last).
-  ///
+  /// An enumeration for keeping track of the concrete subclass of Value that
+  /// is actually instantiated. Values of this enumeration are kept in the 
+  /// Value classes SubclassID field. They are used for concrete type
+  /// identification.
   enum ValueTy {
     ArgumentVal,              // This is an instance of Argument
     BasicBlockVal,            // This is an instance of BasicBlock
@@ -163,6 +165,14 @@
     ConstantFirstVal = FunctionVal,
     ConstantLastVal  = ConstantPointerNullVal
   };
+
+  /// getValueType - Return an ID for the concrete type of this object.  This is
+  /// used to implement the classof checks.  This should not be used for any
+  /// other purpose, as the values may change as LLVM evolves.  Also, note that
+  /// starting with the InstructionVal value, the value stored is actually the
+  /// Instruction opcode, so there are more than just these values possible here
+  /// (and Instruction must be last).
+  ///
   unsigned getValueType() const {
     return SubclassID;
   }






More information about the llvm-commits mailing list