remove more explicit accesses to the canonical type pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40653 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp
index 722452b..e052af8 100644
--- a/Sema/SemaDecl.cpp
+++ b/Sema/SemaDecl.cpp
@@ -381,7 +381,7 @@
}
// C99 6.7.5.2p2: If an identifier is declared to be an object with
// static storage duration, it shall not have a variable length array.
- if (ArrayType *ary = dyn_cast<ArrayType>(R.getCanonicalType())) {
+ if (const ArrayType *ary = R->getAsArrayType()) {
if (VerifyConstantArrayType(ary, D.getIdentifierLoc()))
return 0;
}
@@ -399,7 +399,7 @@
if (SC == VarDecl::Static) {
// C99 6.7.5.2p2: If an identifier is declared to be an object with
// static storage duration, it shall not have a variable length array.
- if (ArrayType *ary = dyn_cast<ArrayType>(R.getCanonicalType())) {
+ if (const ArrayType *ary = R->getAsArrayType()) {
if (VerifyConstantArrayType(ary, D.getIdentifierLoc()))
return 0;
}
@@ -738,7 +738,7 @@
// C99 6.7.2.1p8: A member of a structure or union may have any type other
// than a variably modified type.
- if (ArrayType *ary = dyn_cast<ArrayType>(T.getCanonicalType())) {
+ if (const ArrayType *ary = T->getAsArrayType()) {
if (VerifyConstantArrayType(ary, Loc))
return 0;
}
@@ -771,10 +771,10 @@
if (!FD) continue; // Already issued a diagnostic.
// Get the type for the field.
- Type *FDTy = FD->getType().getCanonicalType().getTypePtr();
+ Type *FDTy = FD->getType().getTypePtr();
// C99 6.7.2.1p2 - A field may not be a function type.
- if (isa<FunctionType>(FDTy)) {
+ if (FDTy->isFunctionType()) {
Diag(FD->getLocation(), diag::err_field_declared_as_function,
FD->getName());
delete FD;
@@ -785,7 +785,7 @@
if (FDTy->isIncompleteType()) {
if (i != NumFields-1 || // ... that the last member ...
Record->getKind() != Decl::Struct || // ... of a structure ...
- !isa<ArrayType>(FDTy)) { //... may have incomplete array type.
+ !FDTy->isArrayType()) { //... may have incomplete array type.
Diag(FD->getLocation(), diag::err_field_incomplete, FD->getName());
delete FD;
continue;
@@ -804,7 +804,7 @@
/// C99 6.7.2.1p2 - a struct ending in a flexible array member cannot be the
/// field of another structure or the element of an array.
- if (RecordType *FDTTy = dyn_cast<RecordType>(FDTy)) {
+ if (const RecordType *FDTTy = FDTy->getAsRecordType()) {
if (FDTTy->getDecl()->hasFlexibleArrayMember()) {
// If this is a member of a union, then entire union becomes "flexible".
if (Record->getKind() == Decl::Union) {