The attached patch add to LValueExprEvaluator the handling of
__real/__imag lvalue.
Ok to commit?
Index: lib/AST/ExprConstant.cpp
===================================================================
--- lib/AST/ExprConstant.cpp (revision 130660)
+++ lib/AST/ExprConstant.cpp (working copy)
@@ -390,6 +390,9 @@
bool VisitUnaryDeref(UnaryOperator *E);
bool VisitUnaryExtension(const UnaryOperator *E)
{ return Visit(E->getSubExpr()); }
+ bool VisitUnaryReal(UnaryOperator *E)
+ { return Visit(E->getSubExpr()); }
+ bool VisitUnaryImag(UnaryOperator *E);
bool VisitChooseExpr(const ChooseExpr *E)
{ return Visit(E->getChosenSubExpr(Info.Ctx)); }
@@ -484,6 +487,13 @@
return EvaluatePointer(E->getSubExpr(), Result, Info);
}
+bool LValueExprEvaluator::VisitUnaryImag(UnaryOperator *E) {
+ if (!Visit(E->getSubExpr()))
+ return false;
+ Result.Offset += Info.Ctx.getTypeSizeInChars(E->getType());
+ return true;
+}
+
//===----------------------------------------------------------------------===//
// Pointer Evaluation
//===----------------------------------------------------------------------===//
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits