diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-07-26 22:17:49 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-07-26 22:17:49 +0000 |
| commit | 574dee6cac605ad8995d8d40b8e69872bf97acd2 (patch) | |
| tree | 485364ea2331066ecced6c8663d43ea96cf778f5 /clang/lib/CodeGen | |
| parent | 6fc6614c0d98565c6a8315d7414983d894ab04e7 (diff) | |
| download | bcm5719-llvm-574dee6cac605ad8995d8d40b8e69872bf97acd2.tar.gz bcm5719-llvm-574dee6cac605ad8995d8d40b8e69872bf97acd2.zip | |
change more instances of QualType::getCanonicalType to call
ASTContext::getCanonicalType instead (PR2189)
llvm-svn: 54105
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 9420f95ad1c..448f7ec97c7 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -404,18 +404,20 @@ LValue CodeGenFunction::EmitUnaryOpLValue(const UnaryOperator *E) { if (E->getOpcode() == UnaryOperator::Extension) return EmitLValue(E->getSubExpr()); + QualType ExprTy=CGM.getContext().getCanonicalType(E->getSubExpr()->getType()); switch (E->getOpcode()) { default: assert(0 && "Unknown unary operator lvalue!"); case UnaryOperator::Deref: return LValue::MakeAddr(EmitScalarExpr(E->getSubExpr()), - E->getSubExpr()->getType().getCanonicalType()->getAsPointerType() - ->getPointeeType().getCVRQualifiers()); + ExprTy->getAsPointerType()->getPointeeType() + .getCVRQualifiers()); case UnaryOperator::Real: case UnaryOperator::Imag: LValue LV = EmitLValue(E->getSubExpr()); unsigned Idx = E->getOpcode() == UnaryOperator::Imag; return LValue::MakeAddr(Builder.CreateStructGEP(LV.getAddress(), - Idx, "idx"),E->getSubExpr()->getType().getCVRQualifiers()); + Idx, "idx"), + ExprTy.getCVRQualifiers()); } } @@ -501,9 +503,11 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) { // size is a VLA. if (!E->getType()->isConstantSizeType()) assert(0 && "VLA idx not implemented"); + QualType ExprTy = CGM.getContext().getCanonicalType(E->getBase()->getType()); + return LValue::MakeAddr(Builder.CreateGEP(Base, Idx, "arrayidx"), - E->getBase()->getType().getCanonicalType()->getAsPointerType() - ->getPointeeType().getCVRQualifiers()); + ExprTy->getAsPointerType()->getPointeeType() + .getCVRQualifiers()); } static |

