Add a new llvm::SmallVector template, which is similar to the vector class, but
[oota-llvm.git] / lib / VMCore / Instructions.cpp
index d3c7b54d2a8e98640ae021a0c90d173b1739c405..c6730e14c5c098750ebdb113503337606f4ffe12 100644 (file)
@@ -34,6 +34,8 @@ void CallSite::setCallingConv(unsigned CC) {
 }
 
 
+
+
 //===----------------------------------------------------------------------===//
 //                            TerminatorInst Class
 //===----------------------------------------------------------------------===//
@@ -48,6 +50,13 @@ TerminatorInst::TerminatorInst(Instruction::TermOps iType,
   : Instruction(Type::VoidTy, iType, Ops, NumOps, "", IAE) {
 }
 
+// Out of line virtual method, so the vtable, etc has a home.
+TerminatorInst::~TerminatorInst() {
+}
+
+// Out of line virtual method, so the vtable, etc has a home.
+UnaryInstruction::~UnaryInstruction() {
+}
 
 
 //===----------------------------------------------------------------------===//
@@ -505,9 +514,12 @@ void BranchInst::setSuccessorV(unsigned idx, BasicBlock *B) {
 static Value *getAISize(Value *Amt) {
   if (!Amt)
     Amt = ConstantUInt::get(Type::UIntTy, 1);
-  else
+  else {
+    assert(!isa<BasicBlock>(Amt) &&
+           "Passed basic block into allocation size parameter!  Ue other ctor");
     assert(Amt->getType() == Type::UIntTy &&
            "Malloc/Allocation array size != UIntTy!");
+  }
   return Amt;
 }
 
@@ -529,6 +541,10 @@ AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy,
   assert(Ty != Type::VoidTy && "Cannot allocate void!");
 }
 
+// Out of line virtual method, so the vtable, etc has a home.
+AllocationInst::~AllocationInst() {
+}
+
 bool AllocationInst::isArrayAllocation() const {
   if (ConstantUInt *CUI = dyn_cast<ConstantUInt>(getOperand(0)))
     return CUI->getValue() != 1;
@@ -664,7 +680,7 @@ StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
 // message on bad indexes for a gep instruction.
 //
 static inline const Type *checkType(const Type *Ty) {
-  assert(Ty && "Invalid indices for type!");
+  assert(Ty && "Invalid GetElementPtrInst indices for type!");
   return Ty;
 }