[PATCH] D96268: [-Wcompletion-handler] Support checks with builtins

Valeriy Savchenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 8 23:32:28 PST 2021


vsavchenko added inline comments.


================
Comment at: clang/lib/Analysis/CalledOnceCheck.cpp:343
+    case Builtin::BI__builtin_expect_with_probability: {
+      assert(CE->getNumArgs() >= 2);
+
----------------
NoQ wrote:
> Otherwise it's a compile error and analysis based warnings aren't run when there are compile errors, right? If it was a normal function call there's no way we would have gotten away with such assertion. Like, even if it was a standard library function the user could still override that. But for builtins I guess that should work.
Exactly, we have a somewhat similar assertion in the analyzer


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96268



More information about the cfe-commits mailing list