[PATCH] D116022: [clang][dataflow] Add support for terminating virtual destructors

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 21 12:53:40 PST 2021


gribozavr2 added a comment.

> How resilient is this pattern matching?

Possibly it is not very robust. However it is very important for a certain style of precondition verification macros used by various Google projects. I can't find an exact open source copy, but they are generally similar to this one, but usually use a ternary instead of an if statement:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/re2/src/util/logging.h

Also similar to this one, but with an object that has a noreturn destructor instead of inline assembly that causes a trap:

https://source.chromium.org/chromium/chromium/src/+/main:base/check.h

If it wasn't for this "curious" coding pattern that is stamped into many function thanks to the macro, we wouldn't be bothering with this pattern matching at this point.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116022



More information about the cfe-commits mailing list