diff options
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGBlocks.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGCXX.cpp | 6 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 6 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGExprAgg.cpp | 4 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGExprConstant.cpp | 6 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 10 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGObjCMac.cpp | 6 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 4 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenTypes.cpp | 6 | ||||
-rw-r--r-- | clang/lib/CodeGen/TargetABIInfo.cpp | 10 |
11 files changed, 31 insertions, 31 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp index da72b18787b..8e7a7922adb 100644 --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/lib/CodeGen/CGBlocks.cpp @@ -386,7 +386,7 @@ const llvm::Type *BlockModule::getGenericExtendedBlockLiteralType() { RValue CodeGenFunction::EmitBlockCallExpr(const CallExpr* E) { const BlockPointerType *BPT = - E->getCallee()->getType()->getAsBlockPointerType(); + E->getCallee()->getType()->getAs<BlockPointerType>(); llvm::Value *Callee = EmitScalarExpr(E->getCallee()); diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp index 050323a5b6c..d6173a0ec1d 100644 --- a/clang/lib/CodeGen/CGCXX.cpp +++ b/clang/lib/CodeGen/CGCXX.cpp @@ -207,7 +207,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; @@ -458,7 +458,7 @@ void CodeGenFunction::EmitCtorPrologue(const CXXConstructorDecl *CD) { llvm::Value *LoadOfThis = LoadCXXThis(); Type *BaseType = Member->getBaseClass(); CXXRecordDecl *BaseClassDecl = - cast<CXXRecordDecl>(BaseType->getAsRecordType()->getDecl()); + cast<CXXRecordDecl>(BaseType->getAs<RecordType>()->getDecl()); llvm::Value *V = AddressCXXOfBaseClass(LoadOfThis, ClassDecl, BaseClassDecl); EmitCXXConstructorCall(Member->getConstructor(), @@ -475,7 +475,7 @@ void CodeGenFunction::EmitCtorPrologue(const CXXConstructorDecl *CD) { llvm::Value *LoadOfThis = LoadCXXThis(); LValue LHS = EmitLValueForField(LoadOfThis, Field, false, 0); - if (FieldType->getAsRecordType()) { + if (FieldType->getAs<RecordType>()) { assert(Member->getConstructor() && "EmitCtorPrologue - no constructor to initialize member"); diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index bf3a0ae8c6c..8c77f386ed9 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -945,7 +945,7 @@ EmitExtVectorElementExpr(const ExtVectorElementExpr *E) { assert(E->getBase()->getType()->isVectorType()); Base = EmitLValue(E->getBase()); } else { - const PointerType *PT = E->getBase()->getType()->getAsPointerType(); + const PointerType *PT = E->getBase()->getType()->getAs<PointerType>(); llvm::Value *Ptr = EmitScalarExpr(E->getBase()); Base = LValue::MakeAddr(Ptr, PT->getPointeeType().getCVRQualifiers(), QualType::GCNone, @@ -989,7 +989,7 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) { if (E->isArrow()) { BaseValue = EmitScalarExpr(BaseExpr); const PointerType *PTy = - BaseExpr->getType()->getAsPointerType(); + BaseExpr->getType()->getAs<PointerType>(); if (PTy->getPointeeType()->isUnionType()) isUnion = true; CVRQualifiers = PTy->getPointeeType().getCVRQualifiers(); @@ -1343,7 +1343,7 @@ RValue CodeGenFunction::EmitCall(llvm::Value *Callee, QualType CalleeType, assert(CalleeType->isFunctionPointerType() && "Call must have function pointer type!"); - QualType FnType = CalleeType->getAsPointerType()->getPointeeType(); + QualType FnType = CalleeType->getAs<PointerType>()->getPointeeType(); QualType ResultType = FnType->getAsFunctionType()->getResultType(); CallArgList Args; diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp index 5e81bf26510..7dbf2df6ddf 100644 --- a/clang/lib/CodeGen/CGExprAgg.cpp +++ b/clang/lib/CodeGen/CGExprAgg.cpp @@ -254,7 +254,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(), @@ -442,7 +442,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 ec873ffcd9a..8e45997aee7 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/lib/CodeGen/CGExprConstant.cpp @@ -271,7 +271,7 @@ class VISIBILITY_HIDDEN ConstStructBuilder { } bool Build(const InitListExpr *ILE) { - RecordDecl *RD = ILE->getType()->getAsRecordType()->getDecl(); + RecordDecl *RD = ILE->getType()->getAs<RecordType>()->getDecl(); const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD); unsigned FieldNo = 0; @@ -512,7 +512,7 @@ public: // works well enough! 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. @@ -591,7 +591,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/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index d7808246321..c9a12767387 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -687,7 +687,7 @@ Value *ScalarExprEmitter::VisitPrePostIncDec(const UnaryOperator *E, int AmountVal = isInc ? 1 : -1; if (ValTy->isPointerType() && - ValTy->getAsPointerType()->isVariableArrayType()) { + ValTy->getAs<PointerType>()->isVariableArrayType()) { // The amount of the addition/subtraction needs to account for the VLA size CGF.ErrorUnsupported(E, "VLA pointer inc/dec"); } @@ -1030,13 +1030,13 @@ Value *ScalarExprEmitter::EmitAdd(const BinOpInfo &Ops) { } if (Ops.Ty->isPointerType() && - Ops.Ty->getAsPointerType()->isVariableArrayType()) { + Ops.Ty->getAs<PointerType>()->isVariableArrayType()) { // The amount of the addition needs to account for the VLA size CGF.ErrorUnsupported(Ops.E, "VLA pointer addition"); } Value *Ptr, *Idx; Expr *IdxExp; - const PointerType *PT = Ops.E->getLHS()->getType()->getAsPointerType(); + const PointerType *PT = Ops.E->getLHS()->getType()->getAs<PointerType>(); const ObjCObjectPointerType *OPT = Ops.E->getLHS()->getType()->getAsObjCObjectPointerType(); if (PT || OPT) { @@ -1044,7 +1044,7 @@ Value *ScalarExprEmitter::EmitAdd(const BinOpInfo &Ops) { Idx = Ops.RHS; IdxExp = Ops.E->getRHS(); } else { // int + pointer - PT = Ops.E->getRHS()->getType()->getAsPointerType(); + PT = Ops.E->getRHS()->getType()->getAs<PointerType>(); OPT = Ops.E->getRHS()->getType()->getAsObjCObjectPointerType(); assert((PT || OPT) && "Invalid add expr"); Ptr = Ops.RHS; @@ -1101,7 +1101,7 @@ Value *ScalarExprEmitter::EmitSub(const BinOpInfo &Ops) { } if (Ops.E->getLHS()->getType()->isPointerType() && - Ops.E->getLHS()->getType()->getAsPointerType()->isVariableArrayType()) { + Ops.E->getLHS()->getType()->getAs<PointerType>()->isVariableArrayType()) { // The amount of the addition needs to account for the VLA size for // ptr-int // The amount of the division needs to account for the VLA size for diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index 6628d183e57..1a065fab966 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -2997,7 +2997,7 @@ static QualType::GCAttrTypes GetGCAttrTypeForType(ASTContext &Ctx, if (FQT->isObjCObjectPointerType()) return QualType::Strong; - if (const PointerType *PT = FQT->getAsPointerType()) + if (const PointerType *PT = FQT->getAs<PointerType>()) return GetGCAttrTypeForType(Ctx, PT->getPointeeType()); return QualType::GCNone; @@ -3065,7 +3065,7 @@ void CGObjCCommonMac::BuildAggrIvarLayout(const ObjCImplementationDecl *OI, if (FQT->isUnionType()) HasUnion = true; - BuildAggrIvarRecordLayout(FQT->getAsRecordType(), + BuildAggrIvarRecordLayout(FQT->getAs<RecordType>(), BytePos + FieldOffset, ForStrongLayout, HasUnion); continue; @@ -3090,7 +3090,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 94fd052431d..28d729c2257 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -384,7 +384,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()); @@ -494,7 +494,7 @@ llvm::Value *CodeGenFunction::EmitVLASize(QualType Ty) { return SizeEntry; } else if (const ArrayType *AT = dyn_cast<ArrayType>(Ty)) { EmitVLASize(AT->getElementType()); - } else if (const PointerType *PT = Ty->getAsPointerType()) + } else if (const PointerType *PT = Ty->getAs<PointerType>()) EmitVLASize(PT->getPointeeType()); else { assert(0 && "unknown VM type!"); diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index bdc0876cdbc..f0b90f05b0b 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1275,7 +1275,7 @@ CodeGenModule::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 7d9c5fcc4c3..f88ed048fd3 100644 --- a/clang/lib/CodeGen/CodeGenTypes.cpp +++ b/clang/lib/CodeGen/CodeGenTypes.cpp @@ -107,12 +107,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; @@ -387,7 +387,7 @@ const llvm::Type *CodeGenTypes::ConvertTagDeclType(const TagDecl *TD) { e = RD->bases_end(); i != e; ++i) { if (!i->isVirtual()) { const CXXRecordDecl *Base = - cast<CXXRecordDecl>(i->getType()->getAsRecordType()->getDecl()); + cast<CXXRecordDecl>(i->getType()->getAs<RecordType>()->getDecl()); ConvertTagDeclType(Base); } } diff --git a/clang/lib/CodeGen/TargetABIInfo.cpp b/clang/lib/CodeGen/TargetABIInfo.cpp index 5c8d5dd230b..938281e9dbc 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 |