[clang][dataflow] Drop optional model's dependency on libc++ internals.
authorYitzhak Mandelbaum <yitzhakm@google.com>
Fri, 14 Apr 2023 21:00:24 +0000 (21:00 +0000)
committerYitzhak Mandelbaum <yitzhakm@google.com>
Mon, 17 Apr 2023 18:03:58 +0000 (18:03 +0000)
commit09b462ef8539433f56d1a6d2cc807db9a56072e6
treea22faef51506fdeb18c0931a4dbe28a208fd4a13
parentcd22e0dc9d0b5487eb2d54dd028a2aa439627159
[clang][dataflow] Drop optional model's dependency on libc++ internals.

Adjusts the matchers in the optional model to avoid dependency on internal
implementation details of libc++'s `std::optional`. In the process, factors out
the code to check the name of these types so that it's shared throughout.

Differential Revision: https://reviews.llvm.org/D148377
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp
clang/unittests/Analysis/FlowSensitive/UncheckedOptionalAccessModelTest.cpp