[llvm-commits] CVS: llvm/include/llvm/AbstractTypeUser.h Constants.h DerivedTypes.h GlobalVariable.h Instruction.h SymbolTable.h User.h Value.h iOther.h iPHINode.h iTerminators.h

John Criswell criswell at choi.cs.uiuc.edu
Thu Jun 26 16:38:45 PDT 2003


Changes in directory llvm/include/llvm:

AbstractTypeUser.h updated: 1.6.2.1 -> 1.6.2.2
Constants.h updated: 1.26.2.1 -> 1.26.2.2
DerivedTypes.h updated: 1.29.2.1 -> 1.29.2.2
GlobalVariable.h updated: 1.20.2.1 -> 1.20.2.2
Instruction.h updated: 1.40.2.1 -> 1.40.2.2
SymbolTable.h updated: 1.21.2.1 -> 1.21.2.2
User.h updated: 1.18.2.1 -> 1.18.2.2
Value.h updated: 1.40 -> 1.40.2.1
iOther.h updated: 1.35.2.1 -> 1.35.2.2
iPHINode.h updated: 1.9.2.1 -> 1.9.2.2
iTerminators.h updated: 1.27.2.1 -> 1.27.2.2

---
Log message:

Merged with mainline on Thursday, June 26, 2003.
Kept includes of "Config/assert.h" to avoid implicit dependencies on header
files.


---
Diffs of the changes:

Index: llvm/include/llvm/AbstractTypeUser.h
diff -u llvm/include/llvm/AbstractTypeUser.h:1.6.2.1 llvm/include/llvm/AbstractTypeUser.h:1.6.2.2
--- llvm/include/llvm/AbstractTypeUser.h:1.6.2.1	Mon Jun 23 13:51:40 2003
+++ llvm/include/llvm/AbstractTypeUser.h	Thu Jun 26 16:34:37 2003
@@ -58,9 +58,8 @@
 // example.  This class is a simple class used to keep the use list of abstract
 // types up-to-date.
 //
-template <class TypeSubClass>
 class PATypeHandle {
-  const TypeSubClass *Ty;
+  const Type *Ty;
   AbstractTypeUser * const User;
 
   // These functions are defined at the bottom of Type.h.  See the comment there
@@ -69,7 +68,7 @@
   inline void removeUser();
 public:
   // ctor - Add use to type if abstract.  Note that Ty must not be null
-  inline PATypeHandle(const TypeSubClass *ty, AbstractTypeUser *user) 
+  inline PATypeHandle(const Type *ty, AbstractTypeUser *user) 
     : Ty(ty), User(user) {
     addUser();
   }
@@ -83,11 +82,11 @@
   inline ~PATypeHandle() { removeUser(); }
 
   // Automatic casting operator so that the handle may be used naturally
-  inline operator const TypeSubClass *() const { return Ty; }
-  inline const TypeSubClass *get() const { return Ty; }
+  inline operator const Type *() const { return Ty; }
+  inline const Type *get() const { return Ty; }
 
   // operator= - Allow assignment to handle
-  inline const TypeSubClass *operator=(const TypeSubClass *ty) {
+  inline const Type *operator=(const Type *ty) {
     if (Ty != ty) {   // Ensure we don't accidentally drop last ref to Ty
       removeUser();
       Ty = ty;
@@ -97,16 +96,16 @@
   }
 
   // operator= - Allow assignment to handle
-  inline const TypeSubClass *operator=(const PATypeHandle &T) {
+  inline const Type *operator=(const PATypeHandle &T) {
     return operator=(T.Ty);
   }
 
-  inline bool operator==(const TypeSubClass *ty) {
+  inline bool operator==(const Type *ty) {
     return Ty == ty;
   }
 
   // operator-> - Allow user to dereference handle naturally...
-  inline const TypeSubClass *operator->() const { return Ty; }
+  inline const Type *operator->() const { return Ty; }
 
   // removeUserFromConcrete - This function should be called when the User is
   // notified that our type is refined... and the type is being refined to
@@ -122,10 +121,10 @@
 // as both a handle (as above) and an AbstractTypeUser.  It uses the callback to
 // keep its pointer member updated to the current version of the type.
 //
-struct PATypeHolder : public AbstractTypeUser, public PATypeHandle<Type> {
-  inline PATypeHolder(const Type *ty) : PATypeHandle<Type>(ty, this) {}
+struct PATypeHolder : public AbstractTypeUser, public PATypeHandle {
+  inline PATypeHolder(const Type *ty) : PATypeHandle(ty, this) {}
   inline PATypeHolder(const PATypeHolder &T)
-    : AbstractTypeUser(T), PATypeHandle<Type>(T, this) {}
+    : AbstractTypeUser(T), PATypeHandle(T, this) {}
 
   // refineAbstractType - All we do is update our PATypeHandle member to point
   // to the new type.
@@ -138,20 +137,20 @@
     removeUserFromConcrete();
 
     if ((const Type*)OldTy != NewTy)
-      PATypeHandle<Type>::operator=(NewTy);
+      PATypeHandle::operator=(NewTy);
   }
 
   // operator= - Allow assignment to handle
   inline const Type *operator=(const Type *ty) {
-    return PATypeHandle<Type>::operator=(ty);
+    return PATypeHandle::operator=(ty);
   }
 
   // operator= - Allow assignment to handle
-  inline const Type *operator=(const PATypeHandle<Type> &T) {
-    return PATypeHandle<Type>::operator=(T);
+  inline const Type *operator=(const PATypeHandle &T) {
+    return PATypeHandle::operator=(T);
   }
   inline const Type *operator=(const PATypeHolder &H) {
-    return PATypeHandle<Type>::operator=(H);
+    return PATypeHandle::operator=(H);
   }
 
   void dump() const;


Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.26.2.1 llvm/include/llvm/Constants.h:1.26.2.2
--- llvm/include/llvm/Constants.h:1.26.2.1	Mon Jun 23 13:51:40 2003
+++ llvm/include/llvm/Constants.h	Thu Jun 26 16:34:37 2003
@@ -9,7 +9,6 @@
 #define LLVM_CONSTANTS_H
 
 #include "Config/assert.h"
-
 #include "llvm/Constant.h"
 #include "Support/DataTypes.h"
 


Index: llvm/include/llvm/DerivedTypes.h
diff -u llvm/include/llvm/DerivedTypes.h:1.29.2.1 llvm/include/llvm/DerivedTypes.h:1.29.2.2
--- llvm/include/llvm/DerivedTypes.h:1.29.2.1	Mon Jun 23 13:51:40 2003
+++ llvm/include/llvm/DerivedTypes.h	Thu Jun 26 16:34:37 2003
@@ -12,7 +12,6 @@
 #define LLVM_DERIVED_TYPES_H
 
 #include "Config/assert.h"
-
 #include "llvm/Type.h"
 
 class DerivedType : public Type {
@@ -86,9 +85,9 @@
 
 class FunctionType : public DerivedType {
 public:
-  typedef std::vector<PATypeHandle<Type> > ParamTypes;
+  typedef std::vector<PATypeHandle> ParamTypes;
 private:
-  PATypeHandle<Type> ResultType;
+  PATypeHandle ResultType;
   ParamTypes ParamTys;
   bool isVarArgs;
 
@@ -181,7 +180,7 @@
 
 class StructType : public CompositeType {
 public:
-  typedef std::vector<PATypeHandle<Type> > ElementTypes;
+  typedef std::vector<PATypeHandle> ElementTypes;
 
 private:
   ElementTypes ETypes;                              // Element types of struct
@@ -245,10 +244,10 @@
   SequentialType(const SequentialType &);                  // Do not implement!
   const SequentialType &operator=(const SequentialType &); // Do not implement!
 protected:
-  PATypeHandle<Type> ElementType;
+  PATypeHandle ElementType;
 
   SequentialType(PrimitiveID TID, const Type *ElType)
-    : CompositeType(TID), ElementType(PATypeHandle<Type>(ElType, this)) {
+    : CompositeType(TID), ElementType(PATypeHandle(ElType, this)) {
   }
 public:
 
@@ -390,18 +389,17 @@
 // contains an AbstractTypeUser instance, so there is no good way to factor out
 // the code.  Hence this bit of uglyness.
 //
-template <class TypeSubClass> void PATypeHandle<TypeSubClass>::addUser() {
+inline void PATypeHandle::addUser() {
   assert(Ty && "Type Handle has a null type!");
   if (Ty->isAbstract())
     cast<DerivedType>(Ty)->addAbstractTypeUser(User);
 }
-template <class TypeSubClass> void PATypeHandle<TypeSubClass>::removeUser() {
+inline void PATypeHandle::removeUser() {
   if (Ty->isAbstract())
     cast<DerivedType>(Ty)->removeAbstractTypeUser(User);
 }
 
-template <class TypeSubClass>
-void PATypeHandle<TypeSubClass>::removeUserFromConcrete() {
+inline void PATypeHandle::removeUserFromConcrete() {
   if (!Ty->isAbstract())
     cast<DerivedType>(Ty)->removeAbstractTypeUser(User);
 }


Index: llvm/include/llvm/GlobalVariable.h
diff -u llvm/include/llvm/GlobalVariable.h:1.20.2.1 llvm/include/llvm/GlobalVariable.h:1.20.2.2
--- llvm/include/llvm/GlobalVariable.h:1.20.2.1	Mon Jun 23 13:51:40 2003
+++ llvm/include/llvm/GlobalVariable.h	Thu Jun 26 16:34:37 2003
@@ -14,8 +14,8 @@
 #define LLVM_GLOBAL_VARIABLE_H
 
 #include "Config/assert.h"
-
 #include "llvm/GlobalValue.h"
+
 class Module;
 class Constant;
 class PointerType;


Index: llvm/include/llvm/Instruction.h
diff -u llvm/include/llvm/Instruction.h:1.40.2.1 llvm/include/llvm/Instruction.h:1.40.2.2
--- llvm/include/llvm/Instruction.h:1.40.2.1	Mon Jun 23 13:51:40 2003
+++ llvm/include/llvm/Instruction.h	Thu Jun 26 16:34:37 2003
@@ -9,8 +9,8 @@
 #define LLVM_INSTRUCTION_H
 
 #include "Config/assert.h"
-
 #include "llvm/User.h"
+
 template<typename SC> struct ilist_traits;
 template<typename ValueSubClass, typename ItemParentClass, typename SymTabClass,
          typename SubClass> class SymbolTableListTraits;


Index: llvm/include/llvm/SymbolTable.h
diff -u llvm/include/llvm/SymbolTable.h:1.21.2.1 llvm/include/llvm/SymbolTable.h:1.21.2.2
--- llvm/include/llvm/SymbolTable.h:1.21.2.1	Mon Jun 23 13:51:40 2003
+++ llvm/include/llvm/SymbolTable.h	Thu Jun 26 16:34:37 2003
@@ -17,7 +17,6 @@
 #define LLVM_SYMBOL_TABLE_H
 
 #include "Config/assert.h"
-
 #include "llvm/Value.h"
 #include <map>
 


Index: llvm/include/llvm/User.h
diff -u llvm/include/llvm/User.h:1.18.2.1 llvm/include/llvm/User.h:1.18.2.2
--- llvm/include/llvm/User.h:1.18.2.1	Mon Jun 23 13:51:40 2003
+++ llvm/include/llvm/User.h	Thu Jun 26 16:34:37 2003
@@ -13,7 +13,6 @@
 #define LLVM_USER_H
 
 #include "Config/assert.h"
-
 #include "llvm/Value.h"
 
 class User : public Value {
@@ -48,6 +47,11 @@
   inline const_op_iterator op_begin() const { return Operands.begin(); }
   inline op_iterator       op_end()         { return Operands.end(); }
   inline const_op_iterator op_end()   const { return Operands.end(); }
+
+  /// op_erase - This method is used to remove one of the arguments from the
+  /// operands list.  Only use this if you know what you are doing.
+  ///
+  op_iterator op_erase(op_iterator I) { return Operands.erase(I); }
 
   // dropAllReferences() - This function is in charge of "letting go" of all
   // objects that this User refers to.  This allows one to


Index: llvm/include/llvm/Value.h
diff -u llvm/include/llvm/Value.h:1.40 llvm/include/llvm/Value.h:1.40.2.1
--- llvm/include/llvm/Value.h:1.40	Tue Jan 14 15:29:58 2003
+++ llvm/include/llvm/Value.h	Thu Jun 26 16:34:37 2003
@@ -50,7 +50,7 @@
 private:
   std::vector<User *> Uses;
   std::string Name;
-  PATypeHandle<Type> Ty;
+  PATypeHandle Ty;
   ValueTy VTy;
 
   void operator=(const Value &);     // Do not implement


Index: llvm/include/llvm/iOther.h
diff -u llvm/include/llvm/iOther.h:1.35.2.1 llvm/include/llvm/iOther.h:1.35.2.2
--- llvm/include/llvm/iOther.h:1.35.2.1	Mon Jun 23 13:51:40 2003
+++ llvm/include/llvm/iOther.h	Thu Jun 26 16:34:37 2003
@@ -9,7 +9,6 @@
 #define LLVM_IOTHER_H
 
 #include "Config/assert.h"
-
 #include "llvm/InstrTypes.h"
 
 //===----------------------------------------------------------------------===//


Index: llvm/include/llvm/iPHINode.h
diff -u llvm/include/llvm/iPHINode.h:1.9.2.1 llvm/include/llvm/iPHINode.h:1.9.2.2
--- llvm/include/llvm/iPHINode.h:1.9.2.1	Mon Jun 23 13:51:40 2003
+++ llvm/include/llvm/iPHINode.h	Thu Jun 26 16:34:37 2003
@@ -8,7 +8,6 @@
 #define LLVM_IPHINODE_H
 
 #include "Config/assert.h"
-
 #include "llvm/Instruction.h"
 class BasicBlock;
 


Index: llvm/include/llvm/iTerminators.h
diff -u llvm/include/llvm/iTerminators.h:1.27.2.1 llvm/include/llvm/iTerminators.h:1.27.2.2
--- llvm/include/llvm/iTerminators.h:1.27.2.1	Mon Jun 23 13:51:40 2003
+++ llvm/include/llvm/iTerminators.h	Thu Jun 26 16:34:37 2003
@@ -10,12 +10,11 @@
 #define LLVM_ITERMINATORS_H
 
 #include "Config/assert.h"
-
 #include "llvm/InstrTypes.h"
 
 //===---------------------------------------------------------------------------
-// ReturnInst - Return a value (possibly void), from a method.  Execution does
-//              not continue in this method any longer.
+// ReturnInst - Return a value (possibly void), from a function.  Execution does
+//              not continue in this function any longer.
 //
 class ReturnInst : public TerminatorInst {
   ReturnInst(const ReturnInst &RI) : TerminatorInst(Instruction::Ret) {
@@ -194,7 +193,7 @@
 class InvokeInst : public TerminatorInst {
   InvokeInst(const InvokeInst &BI);
 public:
-  InvokeInst(Value *Meth, BasicBlock *IfNormal, BasicBlock *IfException,
+  InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
 	     const std::vector<Value*> &Params, const std::string &Name = "",
              Instruction *InsertBefore = 0);
 
@@ -212,7 +211,7 @@
     return dyn_cast<Function>(Operands[0].get());
   }
 
-  // getCalledValue - Get a pointer to a method that is invoked by this inst.
+  // getCalledValue - Get a pointer to a function that is invoked by this inst.
   inline const Value *getCalledValue() const { return Operands[0]; }
   inline       Value *getCalledValue()       { return Operands[0]; }
 





More information about the llvm-commits mailing list