summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-07-29 21:53:49 +0000
committerTed Kremenek <kremenek@apple.com>2009-07-29 21:53:49 +0000
commitc23c7e6a51927d48a2d4d91a86bd422262f7352d (patch)
tree35b19b3eff4bfc9556abe0a4716d2e63da5a7152 /clang/lib/CodeGen/CGExprScalar.cpp
parent4301526e8dad61db333728626e8fe3c916bb2cc2 (diff)
downloadbcm5719-llvm-c23c7e6a51927d48a2d4d91a86bd422262f7352d.tar.gz
bcm5719-llvm-c23c7e6a51927d48a2d4d91a86bd422262f7352d.zip
Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsRecordType() -> Type::getAs<RecordType>() Type::getAsPointerType() -> Type::getAs<PointerType>() Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>() Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>() Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>() Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>() Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsTagType() -> Type::getAs<TagType>() And remove Type::getAsReferenceType(), etc. This change is similar to one I made a couple weeks ago, but that was partly reverted pending some additional design discussion. With Doug's pending smart pointer changes for Types, it seemed natural to take this approach. llvm-svn: 77510
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp10
1 files changed, 5 insertions, 5 deletions
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
OpenPOWER on IntegriCloud