- Rename Instruction::First*Op to *OpsBegin, and Num*Ops to *OpsEnd to
authorChris Lattner <sabre@nondot.org>
Sun, 13 Oct 2002 19:39:16 +0000 (19:39 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 13 Oct 2002 19:39:16 +0000 (19:39 +0000)
    reflect the fact that it's a range being defined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4147 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/InstrTypes.h
include/llvm/Instruction.h
lib/Bytecode/Reader/InstructionReader.cpp
lib/Target/SparcV9/SparcV9InstrInfo.cpp
lib/Target/SparcV9/SparcV9PreSelection.cpp
lib/Transforms/Instrumentation/TraceValues.cpp
lib/VMCore/BasicBlock.cpp
lib/VMCore/Constants.cpp

index fc1917b10be2b14f8a20c887af88b5b7687797ae..09c08b8342a5d1908500d1fe32542316361dc82b 100644 (file)
@@ -47,7 +47,7 @@ public:
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const TerminatorInst *) { return true; }
   static inline bool classof(const Instruction *I) {
-    return I->getOpcode() >= FirstTermOp && I->getOpcode() < NumTermOps; 
+    return I->getOpcode() >= TermOpsBegin && I->getOpcode() < TermOpsEnd;
   }
   static inline bool classof(const Value *V) {
     return isa<Instruction>(V) && classof(cast<Instruction>(V));
@@ -120,7 +120,7 @@ public:
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const BinaryOperator *) { return true; }
   static inline bool classof(const Instruction *I) {
-    return I->getOpcode() >= FirstBinaryOp && I->getOpcode() < NumBinaryOps
+    return I->getOpcode() >= BinaryOpsBegin && I->getOpcode() < BinaryOpsEnd
   }
   static inline bool classof(const Value *V) {
     return isa<Instruction>(V) && classof(cast<Instruction>(V));
index 0674f0ed1ab34193f6170df3c3b7939ef486e081..89c64098c3c279a800318b902b3ab4975e91b437 100644 (file)
@@ -68,10 +68,10 @@ public:
   static const char* getOpcodeName(unsigned OpCode);
 
   inline bool isTerminator() const {   // Instance of TerminatorInst?
-    return iType >= FirstTermOp && iType < NumTermOps;
+    return iType >= TermOpsBegin && iType < TermOpsEnd;
   }
   inline bool isBinaryOp() const {
-    return iType >= FirstBinaryOp && iType < NumBinaryOps;
+    return iType >= BinaryOpsBegin && iType < BinaryOpsEnd;
   }
 
   virtual void print(std::ostream &OS) const;
@@ -86,30 +86,30 @@ public:
   // Exported enumerations...
   //
   enum TermOps {       // These terminate basic blocks
-#define  FIRST_TERM_INST(N)             FirstTermOp = N,
+#define  FIRST_TERM_INST(N)             TermOpsBegin = N,
 #define HANDLE_TERM_INST(N, OPC, CLASS) OPC = N,
-#define   LAST_TERM_INST(N)             NumTermOps = N+1,
+#define   LAST_TERM_INST(N)             TermOpsEnd = N+1,
 #include "llvm/Instruction.def"
   };
 
   enum BinaryOps {
-#define  FIRST_BINARY_INST(N)             FirstBinaryOp = N,
+#define  FIRST_BINARY_INST(N)             BinaryOpsBegin = N,
 #define HANDLE_BINARY_INST(N, OPC, CLASS) OPC = N,
-#define   LAST_BINARY_INST(N)             NumBinaryOps = N+1,
+#define   LAST_BINARY_INST(N)             BinaryOpsEnd = N+1,
 #include "llvm/Instruction.def"
   };
 
   enum MemoryOps {
-#define  FIRST_MEMORY_INST(N)             FirstMemoryOp = N,
+#define  FIRST_MEMORY_INST(N)             MemoryOpsBegin = N,
 #define HANDLE_MEMORY_INST(N, OPC, CLASS) OPC = N,
-#define   LAST_MEMORY_INST(N)             NumMemoryOps = N+1,
+#define   LAST_MEMORY_INST(N)             MemoryOpsEnd = N+1,
 #include "llvm/Instruction.def"
   };
 
   enum OtherOps {
-#define  FIRST_OTHER_INST(N)             FirstOtherOp = N,
+#define  FIRST_OTHER_INST(N)             OtherOpsBegin = N,
 #define HANDLE_OTHER_INST(N, OPC, CLASS) OPC = N,
-#define   LAST_OTHER_INST(N)             NumOtherOps = N+1,
+#define   LAST_OTHER_INST(N)             OtherOpsEnd = N+1,
 #include "llvm/Instruction.def"
   };
 };
index 40360991f5c42cef9a05b4031b5e21e80dea19eb..a4750b0e59089a0b1dd93028bddfb395492d2be9 100644 (file)
@@ -122,8 +122,8 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
   if (ParseRawInst(Buf, EndBuf, Raw))
     return true;
 
-  if (Raw.Opcode >= Instruction::FirstBinaryOp &&
-      Raw.Opcode <  Instruction::NumBinaryOps  && Raw.NumOperands == 2) {
+  if (Raw.Opcode >= Instruction::BinaryOpsBegin &&
+      Raw.Opcode <  Instruction::BinaryOpsEnd  && Raw.NumOperands == 2) {
     Res = BinaryOperator::create((Instruction::BinaryOps)Raw.Opcode,
                                 getValue(Raw.Ty, Raw.Arg1),
                                 getValue(Raw.Ty, Raw.Arg2));
index 148b76ef5a0541ddb7657957eb3e27c5021bc846..662c80a357701d959f2f7ab817eb4eea7f811172 100644 (file)
@@ -266,15 +266,15 @@ CreateIntSetInstruction(const TargetMachine& target,
 // Entry == 0 ==> no immediate constant field exists at all.
 // Entry >  0 ==> abs(immediate constant) <= Entry
 // 
-vector<int> MaxConstantsTable(Instruction::NumOtherOps);
+vector<int> MaxConstantsTable(Instruction::OtherOpsEnd);
 
 static int
 MaxConstantForInstr(unsigned llvmOpCode)
 {
   int modelOpCode = -1;
 
-  if (llvmOpCode >= Instruction::FirstBinaryOp &&
-      llvmOpCode <  Instruction::NumBinaryOps)
+  if (llvmOpCode >= Instruction::BinaryOpsBegin &&
+      llvmOpCode <  Instruction::BinaryOpsEnd)
     modelOpCode = ADD;
   else
     switch(llvmOpCode) {
@@ -300,15 +300,15 @@ static void
 InitializeMaxConstantsTable()
 {
   unsigned op;
-  assert(MaxConstantsTable.size() == Instruction::NumOtherOps &&
+  assert(MaxConstantsTable.size() == Instruction::OtherOpsEnd &&
          "assignments below will be illegal!");
-  for (op = Instruction::FirstTermOp; op < Instruction::NumTermOps; ++op)
+  for (op = Instruction::TermOpsBegin; op < Instruction::TermOpsEnd; ++op)
     MaxConstantsTable[op] = MaxConstantForInstr(op);
-  for (op = Instruction::FirstBinaryOp; op < Instruction::NumBinaryOps; ++op)
+  for (op = Instruction::BinaryOpsBegin; op < Instruction::BinaryOpsEnd; ++op)
     MaxConstantsTable[op] = MaxConstantForInstr(op);
-  for (op = Instruction::FirstMemoryOp; op < Instruction::NumMemoryOps; ++op)
+  for (op = Instruction::MemoryOpsBegin; op < Instruction::MemoryOpsEnd; ++op)
     MaxConstantsTable[op] = MaxConstantForInstr(op);
-  for (op = Instruction::FirstOtherOp; op < Instruction::NumOtherOps; ++op)
+  for (op = Instruction::OtherOpsBegin; op < Instruction::OtherOpsEnd; ++op)
     MaxConstantsTable[op] = MaxConstantForInstr(op);
 }
 
index 916938dabec3ccc6b7a19450fac26dc4f730da2b..56c34edbb7f70245285fca509e5d71c97065bae4 100644 (file)
@@ -214,8 +214,8 @@ static Instruction* DecomposeConstantExpr(ConstantExpr* CE,
                           "constantGEP", &insertBefore);
 
     default:                            // must be a binary operator
-      assert(CE->getOpcode() >= Instruction::FirstBinaryOp &&
-             CE->getOpcode() <  Instruction::NumBinaryOps &&
+      assert(CE->getOpcode() >= Instruction::BinaryOpsBegin &&
+             CE->getOpcode() <  Instruction::BinaryOpsEnd &&
              "Unrecognized opcode in ConstantExpr");
       getArg1 = CE->getOperand(0);
       if (ConstantExpr* CEarg = dyn_cast<ConstantExpr>(getArg1))
index 5abfe272387497ebce6883cc7d039420d7cd8676..7c9d60fa20428f9940c736dd925ba32b72d7f7c3 100644 (file)
@@ -179,7 +179,7 @@ static inline bool TraceThisOpCode(unsigned opCode) {
   // Explicitly test for opCodes *not* to trace so that any new opcodes will
   // be traced by default (VoidTy's are already excluded)
   // 
-  return (opCode  < Instruction::FirstOtherOp &&
+  return (opCode  < Instruction::OtherOpsBegin &&
           opCode != Instruction::Alloca &&
           opCode != Instruction::PHINode &&
           opCode != Instruction::Cast);
index 667346c9c180c098a5b635e383a68dcceb246189..6ddcc08c8287a3f876a6b06e69851c7cc114c44c 100644 (file)
@@ -19,7 +19,7 @@
 // instruction list.  This is not a real instruction.
 //
 struct DummyInst : public Instruction {
-  DummyInst() : Instruction(Type::VoidTy, NumOtherOps) {
+  DummyInst() : Instruction(Type::VoidTy, OtherOpsEnd) {
     // This should not be garbage monitored.
     LeakDetector::removeGarbageObject(this);
   }
@@ -33,7 +33,7 @@ struct DummyInst : public Instruction {
   // Methods for support type inquiry through isa, cast, and dyn_cast...
   static inline bool classof(const DummyInst *) { return true; }
   static inline bool classof(const Instruction *I) {
-    return I->getOpcode() == NumOtherOps;
+    return I->getOpcode() == OtherOpsEnd;
   }
   static inline bool classof(const Value *V) {
     return isa<Instruction>(V) && classof(cast<Instruction>(V));
index d0413f12b3437f7f41ea48aefff557d905f94e20..8464c437fcb4e68734bed325203dbb87e430b051 100644 (file)
@@ -634,8 +634,8 @@ ConstantExpr *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2) {
   
   // Its not in the table so create a new one and put it in the table.
   // Check the operands for consistency first
-  assert((Opcode >= Instruction::FirstBinaryOp &&
-          Opcode < Instruction::NumBinaryOps) &&
+  assert((Opcode >= Instruction::BinaryOpsBegin &&
+          Opcode < Instruction::BinaryOpsEnd) &&
          "Invalid opcode in binary constant expression");
 
   assert(C1->getType() == C2->getType() &&