diff options
| author | Ted Kremenek <kremenek@apple.com> | 2009-07-17 17:50:17 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2009-07-17 17:50:17 +0000 |
| commit | 35366a67baa970c287c714c957cf78a4131cf60d (patch) | |
| tree | 053ba730a50f0c434f8e6d6ca89d03d9cdcfc14d /lib/CodeGen/CGExprScalar.cpp | |
| parent | 01bc160ffccc03e4c0583acf82bd7ab80494219a (diff) | |
| download | clang-35366a67baa970c287c714c957cf78a4131cf60d.tar.gz clang-35366a67baa970c287c714c957cf78a4131cf60d.tar.bz2 clang-35366a67baa970c287c714c957cf78a4131cf60d.tar.xz | |
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<XXX> 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
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
| -rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<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 |
