From: Chris Lattner Date: Fri, 24 Aug 2007 16:24:49 +0000 (+0000) Subject: print the computation type for compound assignment operators in dumps. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dfce2a51a78455c915722bc05f07c41e600220c9;p=clang print the computation type for compound assignment operators in dumps. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41361 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/AST/StmtDumper.cpp b/AST/StmtDumper.cpp index cf1eab172e..25caaef390 100644 --- a/AST/StmtDumper.cpp +++ b/AST/StmtDumper.cpp @@ -425,7 +425,12 @@ void StmtDumper::VisitImplicitCastExpr(ImplicitCastExpr *Node) { } void StmtDumper::VisitBinaryOperator(BinaryOperator *Node) { DumpExpr(Node); - fprintf(F, " '%s'\n", BinaryOperator::getOpcodeStr(Node->getOpcode())); + fprintf(F, " '%s'", BinaryOperator::getOpcodeStr(Node->getOpcode())); + if (CompoundAssignOperator *CAO = dyn_cast(Node)) { + fprintf(F, " ComputeTy="); + DumpType(CAO->getComputationType()); + } + fprintf(F, "\n"); DumpSubTree(Node->getLHS()); fprintf(F, "\n"); DumpSubTree(Node->getRHS()); diff --git a/CodeGen/CGExprScalar.cpp b/CodeGen/CGExprScalar.cpp index 6bdcc930a3..9c2aa36825 100644 --- a/CodeGen/CGExprScalar.cpp +++ b/CodeGen/CGExprScalar.cpp @@ -293,7 +293,7 @@ Value *ScalarExprEmitter::EmitCastExpr(const Expr *E, QualType DestTy) { //===----------------------------------------------------------------------===// Value *ScalarExprEmitter::VisitPrePostIncDec(const UnaryOperator *E, - bool isInc, bool isPre) { + bool isInc, bool isPre) { LValue LV = EmitLValue(E->getSubExpr()); // FIXME: Handle volatile! Value *InVal = CGF.EmitLoadOfLValue(LV/* false*/,