[PATCH] D121797: [clang][dataflow] Add modeling of Chromium's CHECK functionality

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 16 07:08:02 PDT 2022


gribozavr2 added inline comments.


================
Comment at: clang/lib/Analysis/FlowSensitive/Models/ChromiumCheckModel.cpp:16-17
+namespace dataflow {
+/// Determines whether `D` is one of the methods used to implement Chromium's
+/// `CHECK` macros.
+bool isCheckLikeMethod(llvm::SmallDenseSet<const CXXMethodDecl *> &CheckDecls,
----------------
Please don't repeat the comment from the header in the cc file.


================
Comment at: clang/lib/Analysis/FlowSensitive/Models/ChromiumCheckModel.cpp:35
+
+    // Check whether "logging" is as a top-level namespace.
+    if (N->getParent() == nullptr || !N->getParent()->isTranslationUnit())
----------------



================
Comment at: clang/unittests/Analysis/FlowSensitive/ChromiumCheckModelTest.cpp:206
+
+        EXPECT_TRUE(Env.flowConditionImplies(*FooVal));
+      };
----------------
Sorry, could you explain how this works? I think the flow condition should not be implying 'Foo' since we're supposed to ignore this unrelated Check() call.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121797



More information about the cfe-commits mailing list