[PATCH] D59463: [ASTMatchers][OpenMP] OpenMP Structured-block-related matchers

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 16 11:59:30 PDT 2019


lebedev.ri added inline comments.


================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:6421
+///
+/// Prerequisite: the executable directive must not be standalone directive.
+///
----------------
aaron.ballman wrote:
> What happens if this prereq is not met? Does the matcher return false, or does it do something worse (like assert)?
>From https://reviews.llvm.org/D59214#change-5GOe7CiMwWxl
```
const Stmt *OMPExecutableDirective::getStructuredBlock() const {
  assert(!isStandaloneDirective() &&
         "Standalone Executable Directives don't have Structured Blocks.");
```
It really doesn't make sense to return false/nullptr,
it would be like trying to find ForLoop in VarDecl, they are just really distinct types.


Repository:
  rC Clang

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

https://reviews.llvm.org/D59463





More information about the cfe-commits mailing list