summaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-06-02 17:42:47 +0000
committerChris Lattner <sabre@nondot.org>2003-06-02 17:42:47 +0000
commitb84388937cbe7d5cb32a39e649ef020d4d7e5cb5 (patch)
tree01e94863bc0d7d067d270f298fd4e24b0d054196 /lib/VMCore
parent1bafd29e0eedd1c8050658ec2b88b65c81bf89f4 (diff)
downloadllvm-b84388937cbe7d5cb32a39e649ef020d4d7e5cb5.tar.gz
llvm-b84388937cbe7d5cb32a39e649ef020d4d7e5cb5.tar.bz2
llvm-b84388937cbe7d5cb32a39e649ef020d4d7e5cb5.tar.xz
* Make assertion message useful
* Kill dead conditional git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6544 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Constants.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 5c2f73e001..7ae04e491d 100644
--- a/lib/VMCore/Constants.cpp
+++ b/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();
}