[PATCH] D85875: [OpenMP][FIX] Do not crash trying to print a missing (demangled) user condition

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 13 12:26:02 PDT 2020


jdoerfert added inline comments.


================
Comment at: clang/lib/AST/OpenMPClause.cpp:2204-2207
+        if (Selector.ScoreOrCondition)
+          Selector.ScoreOrCondition->printPretty(OS, nullptr, Policy);
+        else
+          OS << "...";
----------------
ABataev wrote:
> Why it can be `nullptr` if it is required to be set?
It took me a while to realize why it is OK. This can only happen when we pretty print the name after we demangled it from the function. We could consider annotating the variant with the TI somehow but we never needed to so far.


================
Comment at: clang/test/AST/ast-dump-openmp-begin-declare-variant_13.c:27-29
+// Make sure:
+//  - we do not see the ast nodes for the gpu kind
+//  - we do not choke on the text in the kind(fpga) guarded scopes
----------------
ABataev wrote:
> Does this comment match the test?
Leftover, good catch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85875



More information about the cfe-commits mailing list