classof implementations for all classes

This commit is contained in:
Anton Mitrokhin
2015-07-10 12:27:16 +03:00
parent 8217448ee5
commit 9f083f99ac
7 changed files with 242 additions and 20 deletions

View File

@@ -1603,7 +1603,7 @@ ArrayType::SizeUnsizedArrays(const Type *type, Expr *initExpr) {
if (at == NULL)
return type;
ExprList *exprList = llvm::dyn_cast<ExprList>(initExpr);
ExprList *exprList = llvm::dyn_cast_or_null<ExprList>(initExpr);
if (exprList == NULL || exprList->exprs.size() == 0)
return type;
@@ -1618,7 +1618,7 @@ ArrayType::SizeUnsizedArrays(const Type *type, Expr *initExpr) {
// now. Otherwise we'll use the first one to size the next dimension
// (after checking below that it has the same length as all of the
// other ones.
ExprList *nextList = llvm::dyn_cast<ExprList>(exprList->exprs[0]);
ExprList *nextList = llvm::dyn_cast_or_null<ExprList>(exprList->exprs[0]);
if (nextList == NULL)
return type;
@@ -1638,7 +1638,7 @@ ArrayType::SizeUnsizedArrays(const Type *type, Expr *initExpr) {
continue;
}
ExprList *el = llvm::dyn_cast<ExprList>(exprList->exprs[i]);
ExprList *el = llvm::dyn_cast_or_null<ExprList>(exprList->exprs[i]);
if (el == NULL || el->exprs.size() != nextSize) {
Error(Union(exprList->exprs[0]->pos, exprList->exprs[i]->pos),
"Inconsistent initializer expression list lengths "