lebedev.ri added inline comments.

================
Comment at: lib/AST/StmtOpenMP.cpp:40
+  if (auto *LD = dyn_cast<OMPLoopDirective>(this))
+    return LD->getBody();
+  return getInnermostCapturedStmt()->getCapturedStmt();
----------------
@riccibruno
`getBody()` exists in `const`-only variant
`getInnermostCapturedStmt()` does exist in both the `const` and non-`const` 
variants,
but the `const` variant does `const_cast` and defers to non-`const` variant.
`getCapturedStmt()` is good though.

So at best i can add
```
Stmt *getStructuredBlock() {
  return const_cast<Stmt *>(const_cast<OMPExecutableDirective 
*>(this)->getStructuredBlock());
}
```
I'm not sure it's worth it?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59214/new/

https://reviews.llvm.org/D59214



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to