]> granicus.if.org Git - clang/commitdiff
print the computation type for compound assignment operators in dumps.
authorChris Lattner <sabre@nondot.org>
Fri, 24 Aug 2007 16:24:49 +0000 (16:24 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 24 Aug 2007 16:24:49 +0000 (16:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41361 91177308-0d34-0410-b5e6-96231b3b80d8

AST/StmtDumper.cpp
CodeGen/CGExprScalar.cpp

index cf1eab172e2b9b79e9b7f8c33b4f218df323f418..25caaef390768df1e939d98b551cb9c73603a94a 100644 (file)
@@ -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());
index 6bdcc930a3e3bf1c632abf4ec1dd4c2829960747..9c2aa368258f5caba27433b65efa454f92acb56f 100644 (file)
@@ -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*/,