This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by jdoerfert on Aug 12 2020, 11:29 PM.

Diff Detail

Event Timeline

jdoerfert created this revision.Aug 12 2020, 11:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2020, 11:29 PM
jdoerfert requested review of this revision.Aug 12 2020, 11:29 PM
ABataev added inline comments.Aug 13 2020, 9:16 AM
clang/lib/AST/OpenMPClause.cpp
2204–2208

Why it can be nullptr if it is required to be set?

clang/test/AST/ast-dump-openmp-begin-declare-variant_13.c
28–30

Does this comment match the test?

jdoerfert added inline comments.Aug 13 2020, 12:26 PM
clang/lib/AST/OpenMPClause.cpp
2204–2208

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.

clang/test/AST/ast-dump-openmp-begin-declare-variant_13.c
28–30

Leftover, good catch.

Remove leftover comment

JonChesterfield accepted this revision.Aug 16 2020, 11:15 AM

Seems OK to me as a local fix. I'm not sure about encoding 'missing condition' as 0, but that's a preexisting choice.

This revision is now accepted and ready to land.Aug 16 2020, 11:15 AM