diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-09 21:44:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-09 21:44:40 +0000 |
commit | 197a338f57a9a44efd5f025ce3d462430d260016 (patch) | |
tree | 73a470f651787a00f470fe43e1b0f782f76e3acf /lib | |
parent | dd36d328730d8c02915d0884541b45ec6ca0049d (diff) |
implement codegen support for preinc as an lvalue, PR5514.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93076 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 2c2b76f2e4..5809d1e70d 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1120,8 +1120,16 @@ LValue CodeGenFunction::EmitUnaryOpLValue(const UnaryOperator *E) { MakeQualifiers(ExprTy)); } case UnaryOperator::PreInc: - case UnaryOperator::PreDec: - return EmitUnsupportedLValue(E, "pre-inc/dec expression"); + case UnaryOperator::PreDec: { + LValue LV = EmitLValue(E->getSubExpr()); + bool isInc = E->getOpcode() == UnaryOperator::PreInc; + + if (E->getType()->isAnyComplexType()) + EmitComplexPrePostIncDec(E, LV, isInc, true/*isPre*/); + else + EmitScalarPrePostIncDec(E, LV, isInc, true/*isPre*/); + return LV; + } } } |