diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-05-01 19:02:43 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-05-01 19:02:43 +0000 |
commit | 28fff5394fc9521ec0ee1d4f7ef4cca5e4f78071 (patch) | |
tree | 23bd75e2072693e780319400526ed92cec3f82f9 /lib/AST | |
parent | a07a6c3e756d0a6a5baa2cad9d165f79f0fb1b42 (diff) |
Fix spurious trailing comma when printing some of the __c11_atomic_* builtins. Patch by Joe Sprowes!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180867 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/StmtPrinter.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 95bacb64b3..a7177063ce 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -1113,24 +1113,25 @@ void StmtPrinter::VisitAtomicExpr(AtomicExpr *Node) { // AtomicExpr stores its subexpressions in a permuted order. PrintExpr(Node->getPtr()); - OS << ", "; if (Node->getOp() != AtomicExpr::AO__c11_atomic_load && Node->getOp() != AtomicExpr::AO__atomic_load_n) { - PrintExpr(Node->getVal1()); OS << ", "; + PrintExpr(Node->getVal1()); } if (Node->getOp() == AtomicExpr::AO__atomic_exchange || Node->isCmpXChg()) { - PrintExpr(Node->getVal2()); OS << ", "; + PrintExpr(Node->getVal2()); } if (Node->getOp() == AtomicExpr::AO__atomic_compare_exchange || Node->getOp() == AtomicExpr::AO__atomic_compare_exchange_n) { - PrintExpr(Node->getWeak()); OS << ", "; + PrintExpr(Node->getWeak()); } - if (Node->getOp() != AtomicExpr::AO__c11_atomic_init) + if (Node->getOp() != AtomicExpr::AO__c11_atomic_init) { + OS << ", "; PrintExpr(Node->getOrder()); + } if (Node->isCmpXChg()) { OS << ", "; PrintExpr(Node->getOrderFail()); |