diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-07-17 17:50:17 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-07-17 17:50:17 +0000 |
commit | 35366a67baa970c287c714c957cf78a4131cf60d (patch) | |
tree | 053ba730a50f0c434f8e6d6ca89d03d9cdcfc14d /lib/Sema/SemaInit.cpp | |
parent | 01bc160ffccc03e4c0583acf82bd7ab80494219a (diff) |
Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76193 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index d92f37fb25..52099a3d90 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -162,7 +162,7 @@ bool Sema::CheckInitializerTypes(Expr *&Init, QualType &DeclType, if ((DeclTypeC.getUnqualifiedType() == InitTypeC.getUnqualifiedType()) || IsDerivedFrom(InitTypeC, DeclTypeC)) { const CXXRecordDecl *RD = - cast<CXXRecordDecl>(DeclType->getAs<RecordType>()->getDecl()); + cast<CXXRecordDecl>(DeclType->getAsRecordType()->getDecl()); // No need to make a CXXConstructExpr if both the ctor and dtor are // trivial. @@ -341,7 +341,7 @@ void InitListChecker::FillInValueInitializations(InitListExpr *ILE) { if (ILE->getSyntacticForm()) Loc = ILE->getSyntacticForm()->getSourceRange().getBegin(); - if (const RecordType *RType = ILE->getType()->getAs<RecordType>()) { + if (const RecordType *RType = ILE->getType()->getAsRecordType()) { unsigned Init = 0, NumInits = ILE->getNumInits(); for (RecordDecl::field_iterator Field = RType->getDecl()->field_begin(), @@ -447,7 +447,7 @@ int InitListChecker::numArrayElements(QualType DeclType) { } int InitListChecker::numStructUnionElements(QualType DeclType) { - RecordDecl *structDecl = DeclType->getAs<RecordType>()->getDecl(); + RecordDecl *structDecl = DeclType->getAsRecordType()->getDecl(); int InitializableMembers = 0; for (RecordDecl::field_iterator Field = structDecl->field_begin(), @@ -584,7 +584,7 @@ void InitListChecker::CheckListElementTypes(InitListExpr *IList, CheckVectorType(IList, DeclType, Index, StructuredList, StructuredIndex); } else if (DeclType->isAggregateType()) { if (DeclType->isRecordType()) { - RecordDecl *RD = DeclType->getAs<RecordType>()->getDecl(); + RecordDecl *RD = DeclType->getAsRecordType()->getDecl(); CheckStructUnionTypes(IList, DeclType, RD->field_begin(), SubobjectIsDesignatorContext, Index, StructuredList, StructuredIndex, @@ -939,7 +939,7 @@ void InitListChecker::CheckStructUnionTypes(InitListExpr *IList, InitListExpr *StructuredList, unsigned &StructuredIndex, bool TopLevelObject) { - RecordDecl* structDecl = DeclType->getAs<RecordType>()->getDecl(); + RecordDecl* structDecl = DeclType->getAsRecordType()->getDecl(); // If the record is invalid, some of it's members are invalid. To avoid // confusion, we forgo checking the intializer for the entire record. @@ -950,7 +950,7 @@ void InitListChecker::CheckStructUnionTypes(InitListExpr *IList, if (DeclType->isUnionType() && IList->getNumInits() == 0) { // Value-initialize the first named member of the union. - RecordDecl *RD = DeclType->getAs<RecordType>()->getDecl(); + RecordDecl *RD = DeclType->getAsRecordType()->getDecl(); for (RecordDecl::field_iterator FieldEnd = RD->field_end(); Field != FieldEnd; ++Field) { if (Field->getDeclName()) { @@ -965,7 +965,7 @@ void InitListChecker::CheckStructUnionTypes(InitListExpr *IList, // anything except look at designated initializers; That's okay, // because an error should get printed out elsewhere. It might be // worthwhile to skip over the rest of the initializer, though. - RecordDecl *RD = DeclType->getAs<RecordType>()->getDecl(); + RecordDecl *RD = DeclType->getAsRecordType()->getDecl(); RecordDecl::field_iterator FieldEnd = RD->field_end(); bool InitializedSomething = false; while (Index < IList->getNumInits()) { @@ -1204,7 +1204,7 @@ InitListChecker::CheckDesignatedInitializer(InitListExpr *IList, // then the current object (defined below) shall have // structure or union type and the identifier shall be the // name of a member of that type. - const RecordType *RT = CurrentObjectType->getAs<RecordType>(); + const RecordType *RT = CurrentObjectType->getAsRecordType(); if (!RT) { SourceLocation Loc = D->getDotLoc(); if (Loc.isInvalid()) @@ -1564,7 +1564,7 @@ InitListChecker::getStructuredSubobjectInit(InitListExpr *IList, unsigned Index, } } else if (const VectorType *VType = CurrentObjectType->getAsVectorType()) NumElements = VType->getNumElements(); - else if (const RecordType *RType = CurrentObjectType->getAs<RecordType>()) { + else if (const RecordType *RType = CurrentObjectType->getAsRecordType()) { RecordDecl *RDecl = RType->getDecl(); if (RDecl->isUnion()) NumElements = 1; @@ -1758,7 +1758,7 @@ bool Sema::CheckValueInitialization(QualType Type, SourceLocation Loc) { if (const ArrayType *AT = Context.getAsArrayType(Type)) return CheckValueInitialization(AT->getElementType(), Loc); - if (const RecordType *RT = Type->getAs<RecordType>()) { + if (const RecordType *RT = Type->getAsRecordType()) { if (CXXRecordDecl *ClassDecl = dyn_cast<CXXRecordDecl>(RT->getDecl())) { // -- if T is a class type (clause 9) with a user-declared // constructor (12.1), then the default constructor for T is |