summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGBlocks.cpp2
-rw-r--r--clang/lib/CodeGen/CGCXX.cpp2
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp6
-rw-r--r--clang/lib/CodeGen/CGExprAgg.cpp4
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp4
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp10
-rw-r--r--clang/lib/CodeGen/CGObjCMac.cpp6
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp4
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp2
-rw-r--r--clang/lib/CodeGen/CodeGenTypes.cpp4
-rw-r--r--clang/lib/CodeGen/TargetABIInfo.cpp10
11 files changed, 27 insertions, 27 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index d8d1259587b..73200fe2ca3 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/lib/CodeGen/CGBlocks.cpp
@@ -388,7 +388,7 @@ const llvm::Type *BlockModule::getGenericExtendedBlockLiteralType() {
RValue CodeGenFunction::EmitBlockCallExpr(const CallExpr* E) {
const BlockPointerType *BPT =
- E->getCallee()->getType()->getAs<BlockPointerType>();
+ E->getCallee()->getType()->getAsBlockPointerType();
llvm::Value *Callee = EmitScalarExpr(E->getCallee());
diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp
index 9031caf5052..07f387f83fe 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()->getAs<RecordType>()->getDecl());
+ cast<CXXRecordDecl>(E->getType()->getAsRecordType()->getDecl());
if (RD->hasTrivialConstructor())
return;
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index ab7b70e7930..346b6703d37 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -934,7 +934,7 @@ EmitExtVectorElementExpr(const ExtVectorElementExpr *E) {
assert(E->getBase()->getType()->isVectorType());
Base = EmitLValue(E->getBase());
} else {
- const PointerType *PT = E->getBase()->getType()->getAs<PointerType>();
+ const PointerType *PT = E->getBase()->getType()->getAsPointerType();
llvm::Value *Ptr = EmitScalarExpr(E->getBase());
Base = LValue::MakeAddr(Ptr, PT->getPointeeType().getCVRQualifiers());
}
@@ -976,7 +976,7 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) {
if (E->isArrow()) {
BaseValue = EmitScalarExpr(BaseExpr);
const PointerType *PTy =
- BaseExpr->getType()->getAs<PointerType>();
+ BaseExpr->getType()->getAsPointerType();
if (PTy->getPointeeType()->isUnionType())
isUnion = true;
CVRQualifiers = PTy->getPointeeType().getCVRQualifiers();
@@ -1317,7 +1317,7 @@ RValue CodeGenFunction::EmitCall(llvm::Value *Callee, QualType CalleeType,
assert(CalleeType->isFunctionPointerType() &&
"Call must have function pointer type!");
- QualType FnType = CalleeType->getAs<PointerType>()->getPointeeType();
+ QualType FnType = CalleeType->getAsPointerType()->getPointeeType();
QualType ResultType = FnType->getAsFunctionType()->getResultType();
CallArgList Args;
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index 58be86d2cbe..e4192d66f39 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()->getAs<RecordType>())
+ if (const RecordType *FDTTy = LHSTy.getTypePtr()->getAsRecordType())
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()->getAs<RecordType>()->getDecl();
+ RecordDecl *SD = E->getType()->getAsRecordType()->getDecl();
unsigned CurInitVal = 0;
if (E->getType()->isUnionType()) {
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index dea207cc72c..4f1f58fefda 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()->getAs<RecordType>()->getDecl();
+ RecordDecl *RD = ILE->getType()->getAsRecordType()->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()->getAs<RecordType>()->getDecl();
+ RecordDecl *RD = ILE->getType()->getAsRecordType()->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 8103506c2f4..129b4c7846e 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -679,7 +679,7 @@ Value *ScalarExprEmitter::VisitPrePostIncDec(const UnaryOperator *E,
int AmountVal = isInc ? 1 : -1;
if (ValTy->isPointerType() &&
- ValTy->getAs<PointerType>()->isVariableArrayType()) {
+ ValTy->getAsPointerType()->isVariableArrayType()) {
// The amount of the addition/subtraction needs to account for the VLA size
CGF.ErrorUnsupported(E, "VLA pointer inc/dec");
}
@@ -1020,13 +1020,13 @@ Value *ScalarExprEmitter::EmitAdd(const BinOpInfo &Ops) {
}
if (Ops.Ty->isPointerType() &&
- Ops.Ty->getAs<PointerType>()->isVariableArrayType()) {
+ Ops.Ty->getAsPointerType()->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()->getAs<PointerType>();
+ const PointerType *PT = Ops.E->getLHS()->getType()->getAsPointerType();
const ObjCObjectPointerType *OPT =
Ops.E->getLHS()->getType()->getAsObjCObjectPointerType();
if (PT || OPT) {
@@ -1034,7 +1034,7 @@ Value *ScalarExprEmitter::EmitAdd(const BinOpInfo &Ops) {
Idx = Ops.RHS;
IdxExp = Ops.E->getRHS();
} else { // int + pointer
- PT = Ops.E->getRHS()->getType()->getAs<PointerType>();
+ PT = Ops.E->getRHS()->getType()->getAsPointerType();
OPT = Ops.E->getRHS()->getType()->getAsObjCObjectPointerType();
assert((PT || OPT) && "Invalid add expr");
Ptr = Ops.RHS;
@@ -1091,7 +1091,7 @@ Value *ScalarExprEmitter::EmitSub(const BinOpInfo &Ops) {
}
if (Ops.E->getLHS()->getType()->isPointerType() &&
- Ops.E->getLHS()->getType()->getAs<PointerType>()->isVariableArrayType()) {
+ Ops.E->getLHS()->getType()->getAsPointerType()->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 02516d76084..661f75a057c 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/lib/CodeGen/CGObjCMac.cpp
@@ -3008,7 +3008,7 @@ static QualType::GCAttrTypes GetGCAttrTypeForType(ASTContext &Ctx,
if (FQT->isObjCObjectPointerType())
return QualType::Strong;
- if (const PointerType *PT = FQT->getAs<PointerType>())
+ if (const PointerType *PT = FQT->getAsPointerType())
return GetGCAttrTypeForType(Ctx, PT->getPointeeType());
return QualType::GCNone;
@@ -3072,7 +3072,7 @@ void CGObjCCommonMac::BuildAggrIvarLayout(const ObjCImplementationDecl *OI,
if (FQT->isUnionType())
HasUnion = true;
- BuildAggrIvarRecordLayout(FQT->getAs<RecordType>(),
+ BuildAggrIvarRecordLayout(FQT->getAsRecordType(),
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->getAs<RecordType>();
+ const RecordType *RT = FQT->getAsRecordType();
BuildAggrIvarRecordLayout(RT, BytePos + FieldOffset,
ForStrongLayout, HasUnion);
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 250ccce3cd0..a72f2ae7106 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->getAs<RecordType>();
+ const RecordType *RTy = Ty->getAsRecordType();
assert (RTy && "Unexpected type. RecordType expected here.");
return CGT.getCGRecordLayout(RTy->getDecl());
@@ -490,7 +490,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->getAs<PointerType>())
+ } else if (const PointerType *PT = Ty->getAsPointerType())
EmitVLASize(PT->getPointeeType());
else {
assert(0 && "unknown VM type!");
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index adc88a026bb..d502d79d294 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->getAs<RecordType>()->getDecl();
+ RecordDecl *CFRD = CFTy->getAsRecordType()->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 2117e6d5b4e..e97cbbd66c9 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()->getAs<TagType>())
+ if (const TagType* TT = FT->getResultType()->getAsTagType())
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)->getAs<TagType>())
+ if (const TagType* TT = FPT->getArgType(i)->getAsTagType())
if (!TT->getDecl()->isDefinition())
return TT;
return 0;
diff --git a/clang/lib/CodeGen/TargetABIInfo.cpp b/clang/lib/CodeGen/TargetABIInfo.cpp
index 7063327d3ae..c3f35453ba7 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->getAs<RecordType>();
+ const RecordType *RT = T->getAsRecordType();
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()->getAs<RecordType>())
+ if (const RecordType* RT = FD->getType()->getAsRecordType())
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->getAs<RecordType>();
+ const RecordType *RT = Ty->getAsRecordType();
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->getAs<RecordType>())
+ if (const RecordType* RT = Ty->getAsRecordType())
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->getAs<RecordType>()) {
+ } else if (const RecordType *RT = Ty->getAsRecordType()) {
uint64_t Size = Context.getTypeSize(Ty);
// AMD64-ABI 3.2.3p2: Rule 1. If the size of an object is larger
OpenPOWER on IntegriCloud