diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-09-11 04:54:28 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-09-11 04:54:28 +0000 |
commit | ed5fb67ad1058880b8ecdc634f787b6709fd791c (patch) | |
tree | 306a1600927c3de6553f6c1a9dbb7e43530a7644 /clang/lib/AST/StmtPrinter.cpp | |
parent | cf1baae6b8937cbfe3355554fa71f55494c8ee25 (diff) | |
download | bcm5719-llvm-ed5fb67ad1058880b8ecdc634f787b6709fd791c.tar.gz bcm5719-llvm-ed5fb67ad1058880b8ecdc634f787b6709fd791c.zip |
[OPENMP] Fix printing of array section with single index.
llvm-svn: 247389
Diffstat (limited to 'clang/lib/AST/StmtPrinter.cpp')
-rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index f08e3a3a9b1..173b5c7fcfa 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -1300,9 +1300,11 @@ void StmtPrinter::VisitOMPArraySectionExpr(OMPArraySectionExpr *Node) { OS << "["; if (Node->getLowerBound()) PrintExpr(Node->getLowerBound()); - OS << ":"; - if (Node->getLength()) - PrintExpr(Node->getLength()); + if (Node->getColonLoc().isValid()) { + OS << ":"; + if (Node->getLength()) + PrintExpr(Node->getLength()); + } OS << "]"; } |