aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-24 16:24:49 +0000
committerChris Lattner <sabre@nondot.org>2007-08-24 16:24:49 +0000
commitdfce2a51a78455c915722bc05f07c41e600220c9 (patch)
tree6afe66a73ded7cd737da9438de812454bcf136d9
parent7f02f721d48772e4eee4fccd8af4f800be1bbc1e (diff)
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
-rw-r--r--AST/StmtDumper.cpp7
-rw-r--r--CodeGen/CGExprScalar.cpp2
2 files changed, 7 insertions, 2 deletions
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<CompoundAssignOperator>(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*/,