mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-24 18:20:38 +00:00
implement codegen support for preinc as an lvalue, PR5514.
llvm-svn: 93076
This commit is contained in:
parent
116ce8f172
commit
bb8976e36e
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,3 +10,7 @@ void test1() {
|
||||
char *xpto;
|
||||
while ( true && xpto[0] );
|
||||
}
|
||||
|
||||
// PR5514
|
||||
int a;
|
||||
void test2() { ++a+=10; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user