From 35366a67baa970c287c714c957cf78a4131cf60d Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 17 Jul 2009 17:50:17 +0000 Subject: 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 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 --- lib/CodeGen/CGExprScalar.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/CodeGen/CGExprScalar.cpp') diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 8103506c2f..129b4c7846 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -679,7 +679,7 @@ Value *ScalarExprEmitter::VisitPrePostIncDec(const UnaryOperator *E, int AmountVal = isInc ? 1 : -1; if (ValTy->isPointerType() && - ValTy->getAs()->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()->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(); + 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(); + 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()->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 -- cgit v1.2.3