[IR] Add classof for GetElementPtrConstantExpr, CompareConstantExpr, InsertValueConst...
authorCraig Topper <craig.topper@gmail.com>
Tue, 15 Dec 2015 06:11:36 +0000 (06:11 +0000)
committerCraig Topper <craig.topper@gmail.com>
Tue, 15 Dec 2015 06:11:36 +0000 (06:11 +0000)
commit07e8f8869589124603ea6b678e4540cb840f781d
treed439fea3fdcec01d8e90ac8643f39215ccbf966b
parent240b0e16f64a14362ec76758cc0699148b42219b
[IR] Add classof for GetElementPtrConstantExpr, CompareConstantExpr, InsertValueConstantExpr, and ExtractValueConstantExpr. All but CompareConstantExpr were being used in casts that were erroneously using ConstantExpr::classof due to inheritance. While there use cast<CompareConstantExpr> to simplify code slightly.

I believe in one place we were always casting to ExtractValueConstantExpr when we were trying to choose between ExtractValueConstantExpr and InsertValueConstantExpr because of this. But since they have identical layouts this didn't cause any observable problems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255624 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/Constants.cpp
lib/IR/ConstantsContext.h