diff options
author | Chris Lattner <sabre@nondot.org> | 2003-06-02 17:42:47 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-06-02 17:42:47 +0000 |
commit | 93c8f1490667e2ba8210e95b37edf76f07ce342a (patch) | |
tree | e09aacdfbb46a03e94bbd940b9639e44af18dab4 /llvm/lib | |
parent | 4476a7bf80edace50ec304bbb077fece45209572 (diff) | |
download | bcm5719-llvm-93c8f1490667e2ba8210e95b37edf76f07ce342a.tar.gz bcm5719-llvm-93c8f1490667e2ba8210e95b37edf76f07ce342a.zip |
* Make assertion message useful
* Kill dead conditional
llvm-svn: 6544
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/VMCore/Constants.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index 5c2f73e0017..7ae04e491d2 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/lib/VMCore/Constants.cpp @@ -225,7 +225,8 @@ ConstantStruct::ConstantStruct(const StructType *T, "Invalid initializer vector for constant structure"); Operands.reserve(V.size()); for (unsigned i = 0, e = V.size(); i != e; ++i) { - assert(V[i]->getType() == ETypes[i]); + assert(V[i]->getType() == ETypes[i] && + "Initializer for struct element doesn't match struct element type!"); Operands.push_back(Use(V[i], this)); } } @@ -671,12 +672,10 @@ void ConstantPointerNull::refineAbstractType(const DerivedType *OldTy, if (OldTy == NewTy) return; // Make everyone now use a constant of the new type... - if (NewTy != OldTy) { - replaceAllUsesWith(ConstantPointerNull::get(cast<PointerType>(NewTy))); + replaceAllUsesWith(ConstantPointerNull::get(cast<PointerType>(NewTy))); - // This constant is now dead, destroy it. - destroyConstant(); - } + // This constant is now dead, destroy it. + destroyConstant(); } |