summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtPrinter.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-09-11 04:54:28 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-09-11 04:54:28 +0000
commited5fb67ad1058880b8ecdc634f787b6709fd791c (patch)
tree306a1600927c3de6553f6c1a9dbb7e43530a7644 /clang/lib/AST/StmtPrinter.cpp
parentcf1baae6b8937cbfe3355554fa71f55494c8ee25 (diff)
downloadbcm5719-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.cpp8
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 << "]";
}
OpenPOWER on IntegriCloud