diff options
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGCXX.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGExprAgg.cpp | 4 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGExprConstant.cpp | 4 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGObjCMac.cpp | 4 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenTypes.cpp | 4 | ||||
-rw-r--r-- | clang/lib/CodeGen/TargetABIInfo.cpp | 10 |
8 files changed, 16 insertions, 16 deletions
diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp index 07f387f83fe..9031caf5052 100644 --- a/clang/lib/CodeGen/CGCXX.cpp +++ b/clang/lib/CodeGen/CGCXX.cpp @@ -179,7 +179,7 @@ CodeGenFunction::EmitCXXConstructExpr(llvm::Value *Dest, assert(Dest && "Must have a destination!"); const CXXRecordDecl *RD = - cast<CXXRecordDecl>(E->getType()->getAsRecordType()->getDecl()); + cast<CXXRecordDecl>(E->getType()->getAs<RecordType>()->getDecl()); if (RD->hasTrivialConstructor()) return; diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp index e4192d66f39..58be86d2cbe 100644 --- a/clang/lib/CodeGen/CGExprAgg.cpp +++ b/clang/lib/CodeGen/CGExprAgg.cpp @@ -253,7 +253,7 @@ void AggExprEmitter::VisitBinAssign(const BinaryOperator *E) { } else { if (CGF.getContext().getLangOptions().NeXTRuntime) { QualType LHSTy = E->getLHS()->getType(); - if (const RecordType *FDTTy = LHSTy.getTypePtr()->getAsRecordType()) + if (const RecordType *FDTTy = LHSTy.getTypePtr()->getAs<RecordType>()) if (FDTTy->getDecl()->hasObjectMember()) { LValue RHS = CGF.EmitLValue(E->getRHS()); CGF.CGM.getObjCRuntime().EmitGCMemmoveCollectable(CGF, LHS.getAddress(), @@ -441,7 +441,7 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) { // the disadvantage is that the generated code is more difficult for // the optimizer, especially with bitfields. unsigned NumInitElements = E->getNumInits(); - RecordDecl *SD = E->getType()->getAsRecordType()->getDecl(); + RecordDecl *SD = E->getType()->getAs<RecordType>()->getDecl(); unsigned CurInitVal = 0; if (E->getType()->isUnionType()) { diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp index 4f1f58fefda..dea207cc72c 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/lib/CodeGen/CGExprConstant.cpp @@ -188,7 +188,7 @@ public: llvm::Constant *EmitStructInitialization(InitListExpr *ILE) { const llvm::StructType *SType = cast<llvm::StructType>(ConvertType(ILE->getType())); - RecordDecl *RD = ILE->getType()->getAsRecordType()->getDecl(); + RecordDecl *RD = ILE->getType()->getAs<RecordType>()->getDecl(); std::vector<llvm::Constant*> Elts; // Initialize the whole structure to zero. @@ -264,7 +264,7 @@ public: #ifndef NDEBUG // Make sure that it's really an empty and not a failure of // semantic analysis. - RecordDecl *RD = ILE->getType()->getAsRecordType()->getDecl(); + RecordDecl *RD = ILE->getType()->getAs<RecordType>()->getDecl(); for (RecordDecl::field_iterator Field = RD->field_begin(), FieldEnd = RD->field_end(); Field != FieldEnd; ++Field) diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index bb80be961b2..02516d76084 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -3072,7 +3072,7 @@ void CGObjCCommonMac::BuildAggrIvarLayout(const ObjCImplementationDecl *OI, if (FQT->isUnionType()) HasUnion = true; - BuildAggrIvarRecordLayout(FQT->getAsRecordType(), + BuildAggrIvarRecordLayout(FQT->getAs<RecordType>(), BytePos + FieldOffset, ForStrongLayout, HasUnion); continue; @@ -3097,7 +3097,7 @@ void CGObjCCommonMac::BuildAggrIvarLayout(const ObjCImplementationDecl *OI, int OldIndex = IvarsInfo.size() - 1; int OldSkIndex = SkipIvars.size() -1; - const RecordType *RT = FQT->getAsRecordType(); + const RecordType *RT = FQT->getAs<RecordType>(); BuildAggrIvarRecordLayout(RT, BytePos + FieldOffset, ForStrongLayout, HasUnion); diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 842bf8be49b..250ccce3cd0 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -380,7 +380,7 @@ void CodeGenFunction::EmitBranchOnBoolExpr(const Expr *Cond, /// getCGRecordLayout - Return record layout info. const CGRecordLayout *CodeGenFunction::getCGRecordLayout(CodeGenTypes &CGT, QualType Ty) { - const RecordType *RTy = Ty->getAsRecordType(); + const RecordType *RTy = Ty->getAs<RecordType>(); assert (RTy && "Unexpected type. RecordType expected here."); return CGT.getCGRecordLayout(RTy->getDecl()); diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index d502d79d294..adc88a026bb 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1251,7 +1251,7 @@ GetAddrOfConstantCFString(const StringLiteral *Literal) { } QualType CFTy = getContext().getCFConstantStringType(); - RecordDecl *CFRD = CFTy->getAsRecordType()->getDecl(); + RecordDecl *CFRD = CFTy->getAs<RecordType>()->getDecl(); const llvm::StructType *STy = cast<llvm::StructType>(getTypes().ConvertType(CFTy)); diff --git a/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp index e97cbbd66c9..2117e6d5b4e 100644 --- a/clang/lib/CodeGen/CodeGenTypes.cpp +++ b/clang/lib/CodeGen/CodeGenTypes.cpp @@ -142,12 +142,12 @@ const llvm::Type *CodeGenTypes::ConvertTypeForMem(QualType T) { // and all of the argument types are complete. static const TagType *VerifyFuncTypeComplete(const Type* T) { const FunctionType *FT = cast<FunctionType>(T); - if (const TagType* TT = FT->getResultType()->getAsTagType()) + if (const TagType* TT = FT->getResultType()->getAs<TagType>()) if (!TT->getDecl()->isDefinition()) return TT; if (const FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(T)) for (unsigned i = 0; i < FPT->getNumArgs(); i++) - if (const TagType* TT = FPT->getArgType(i)->getAsTagType()) + if (const TagType* TT = FPT->getArgType(i)->getAs<TagType>()) if (!TT->getDecl()->isDefinition()) return TT; return 0; diff --git a/clang/lib/CodeGen/TargetABIInfo.cpp b/clang/lib/CodeGen/TargetABIInfo.cpp index c3f35453ba7..7063327d3ae 100644 --- a/clang/lib/CodeGen/TargetABIInfo.cpp +++ b/clang/lib/CodeGen/TargetABIInfo.cpp @@ -68,7 +68,7 @@ static bool isEmptyField(ASTContext &Context, const FieldDecl *FD) { /// fields. Note that a structure with a flexible array member is not /// considered empty. static bool isEmptyRecord(ASTContext &Context, QualType T) { - const RecordType *RT = T->getAsRecordType(); + const RecordType *RT = T->getAs<RecordType>(); if (!RT) return 0; const RecordDecl *RD = RT->getDecl(); @@ -168,7 +168,7 @@ static bool typeContainsSSEVector(const RecordDecl *RD, ASTContext &Context) { Context.getTypeSize(FD->getType()) >= 128) return true; - if (const RecordType* RT = FD->getType()->getAsRecordType()) + if (const RecordType* RT = FD->getType()->getAs<RecordType>()) if (typeContainsSSEVector(RT->getDecl(), Context)) return true; } @@ -272,7 +272,7 @@ bool X86_32ABIInfo::shouldReturnTypeInRegister(QualType Ty, return shouldReturnTypeInRegister(AT->getElementType(), Context); // Otherwise, it must be a record type. - const RecordType *RT = Ty->getAsRecordType(); + const RecordType *RT = Ty->getAs<RecordType>(); if (!RT) return false; // Structure types are passed in register if all fields would be @@ -385,7 +385,7 @@ unsigned X86_32ABIInfo::getIndirectArgumentAlignment(QualType Ty, ASTContext &Context) { unsigned Align = Context.getTypeAlign(Ty); if (Align < 128) return 0; - if (const RecordType* RT = Ty->getAsRecordType()) + if (const RecordType* RT = Ty->getAs<RecordType>()) if (typeContainsSSEVector(RT->getDecl(), Context)) return 16; return 0; @@ -704,7 +704,7 @@ void X86_64ABIInfo::classify(QualType Ty, if (Hi == Memory) Lo = Memory; assert((Hi != SSEUp || Lo == SSE) && "Invalid SSEUp array classification."); - } else if (const RecordType *RT = Ty->getAsRecordType()) { + } else if (const RecordType *RT = Ty->getAs<RecordType>()) { uint64_t Size = Context.getTypeSize(Ty); // AMD64-ABI 3.2.3p2: Rule 1. If the size of an object is larger |