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

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 17 00:10:09 PDT 2019


lebedev.ri added inline comments.


================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:6421
+///
+/// Prerequisite: the executable directive must not be standalone directive.
+///
----------------
lebedev.ri wrote:
> 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.
Hmm, actually, i guess it would be best to return false here instead then. Will change.


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