diff options
author | Chris Lattner <sabre@nondot.org> | 2007-08-26 21:41:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-08-26 21:41:21 +0000 |
commit | b633469e02c3aeb5f0087618dcc26ffb4be8c20b (patch) | |
tree | 4ac25819b5dad197351fb85157aaf8b7fa4de4b3 | |
parent | d65598daa3f1bd397ea2dd07155ac49f2497a24f (diff) | |
download | bcm5719-llvm-b633469e02c3aeb5f0087618dcc26ffb4be8c20b.tar.gz bcm5719-llvm-b633469e02c3aeb5f0087618dcc26ffb4be8c20b.zip |
compound assignment operators are of type CompoundAssignOperator
llvm-svn: 41460
-rw-r--r-- | clang/CodeGen/CGExprScalar.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/clang/CodeGen/CGExprScalar.cpp b/clang/CodeGen/CGExprScalar.cpp index 0f6e4044b48..ee0ccd644e2 100644 --- a/clang/CodeGen/CGExprScalar.cpp +++ b/clang/CodeGen/CGExprScalar.cpp @@ -188,16 +188,16 @@ public: } BinOpInfo EmitBinOps(const BinaryOperator *E); - Value *EmitCompoundAssign(const BinaryOperator *E, + Value *EmitCompoundAssign(const CompoundAssignOperator *E, Value *(ScalarExprEmitter::*F)(const BinOpInfo &)); // Binary operators and binary compound assignment operators. #define HANDLEBINOP(OP) \ - Value *VisitBin ## OP(const BinaryOperator *E) { \ - return Emit ## OP(EmitBinOps(E)); \ - } \ - Value *VisitBin ## OP ## Assign(const BinaryOperator *E) { \ - return EmitCompoundAssign(E, &ScalarExprEmitter::Emit ## OP); \ + Value *VisitBin ## OP(const BinaryOperator *E) { \ + return Emit ## OP(EmitBinOps(E)); \ + } \ + Value *VisitBin ## OP ## Assign(const CompoundAssignOperator *E) { \ + return EmitCompoundAssign(E, &ScalarExprEmitter::Emit ## OP); \ } HANDLEBINOP(Mul); HANDLEBINOP(Div); @@ -211,7 +211,7 @@ public: HANDLEBINOP(Or); #undef HANDLEBINOP Value *VisitBinSub(const BinaryOperator *E); - Value *VisitBinSubAssign(const BinaryOperator *E) { + Value *VisitBinSubAssign(const CompoundAssignOperator *E) { return EmitCompoundAssign(E, &ScalarExprEmitter::EmitSub); } @@ -545,7 +545,7 @@ BinOpInfo ScalarExprEmitter::EmitBinOps(const BinaryOperator *E) { return Result; } -Value *ScalarExprEmitter::EmitCompoundAssign(const BinaryOperator *E, +Value *ScalarExprEmitter::EmitCompoundAssign(const CompoundAssignOperator *E, Value *(ScalarExprEmitter::*Func)(const BinOpInfo &)) { QualType LHSTy = E->getLHS()->getType(), RHSTy = E->getRHS()->getType(); @@ -559,8 +559,7 @@ Value *ScalarExprEmitter::EmitCompoundAssign(const BinaryOperator *E, OpInfo.RHS = Visit(E->getRHS()); // Convert the LHS/RHS values to the computation type. - const CompoundAssignOperator *CAO = cast<CompoundAssignOperator>(E); - QualType ComputeType = CAO->getComputationType(); + QualType ComputeType = E->getComputationType(); // FIXME: it's possible for the computation type to be complex if the RHS // is complex. Handle this! |