From 183700f494ec9b6701b6efe82bcb25f4c79ba561 Mon Sep 17 00:00:00 2001 From: John McCall Date: Mon, 21 Sep 2009 23:43:11 +0000 Subject: Change all the Type::getAsFoo() methods to specializations of Type::getAs(). Several of the existing methods were identical to their respective specializations, and so have been removed entirely. Several more 'leaf' optimizations were introduced. The getAsFoo() methods which imposed extra conditions, like getAsObjCInterfacePointerType(), have been left in place. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82501 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 682d14ca2e..308376c179 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -494,7 +494,7 @@ Value *ScalarExprEmitter::EmitScalarConversion(Value *Src, QualType SrcType, // A scalar can be splatted to an extended vector of the same element type if (DstType->isExtVectorType() && !SrcType->isVectorType()) { // Cast the scalar to element type - QualType EltTy = DstType->getAsExtVectorType()->getElementType(); + QualType EltTy = DstType->getAs()->getElementType(); llvm::Value *Elt = EmitScalarConversion(Src, SrcType, EltTy); // Insert the element in element zero of an undef vector @@ -553,7 +553,7 @@ Value *ScalarExprEmitter:: EmitComplexToScalarConversion(CodeGenFunction::ComplexPairTy Src, QualType SrcTy, QualType DstTy) { // Get the source element type. - SrcTy = SrcTy->getAsComplexType()->getElementType(); + SrcTy = SrcTy->getAs()->getElementType(); // Handle conversions to bool first, they are special: comparisons against 0. if (DstTy->isBooleanType()) { @@ -1118,14 +1118,14 @@ Value *ScalarExprEmitter::EmitAdd(const BinOpInfo &Ops) { Expr *IdxExp; const PointerType *PT = Ops.E->getLHS()->getType()->getAs(); const ObjCObjectPointerType *OPT = - Ops.E->getLHS()->getType()->getAsObjCObjectPointerType(); + Ops.E->getLHS()->getType()->getAs(); if (PT || OPT) { Ptr = Ops.LHS; Idx = Ops.RHS; IdxExp = Ops.E->getRHS(); } else { // int + pointer PT = Ops.E->getRHS()->getType()->getAs(); - OPT = Ops.E->getRHS()->getType()->getAsObjCObjectPointerType(); + OPT = Ops.E->getRHS()->getType()->getAs(); assert((PT || OPT) && "Invalid add expr"); Ptr = Ops.RHS; Idx = Ops.LHS; @@ -1320,7 +1320,7 @@ Value *ScalarExprEmitter::EmitCompare(const BinaryOperator *E,unsigned UICmpOpc, CodeGenFunction::ComplexPairTy LHS = CGF.EmitComplexExpr(E->getLHS()); CodeGenFunction::ComplexPairTy RHS = CGF.EmitComplexExpr(E->getRHS()); - QualType CETy = LHSTy->getAsComplexType()->getElementType(); + QualType CETy = LHSTy->getAs()->getElementType(); Value *ResultR, *ResultI; if (CETy->isRealFloatingType()) { -- cgit v1.2.3