[PATCH] D33092: [analyzer] Add checker to model builtin functions

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 11 02:56:17 PDT 2017


xazax.hun created this revision.
Herald added subscribers: whisperity, mgorny.

I added a checker to model builtin functions. Only one builtin function is modelled so far. The motivation behind using `__builtin_assume` from the analyzers point of view is to add assumptions. The conventional way to express invariants is to use asserts (with correct annotations for noreturn functions). However on some platform the users do not want to pay the price of an assert, even in the debug build (especially in a hot code). This way we can express these invariants to the analyzer without runtime overhead.

What do you think?


Repository:
  rL LLVM

https://reviews.llvm.org/D33092

Files:
  include/clang/StaticAnalyzer/Checkers/Checkers.td
  lib/StaticAnalyzer/Checkers/CMakeLists.txt
  lib/StaticAnalyzer/Checkers/ModelBuiltinChecker.cpp
  test/Analysis/builtin-assume.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33092.98602.patch
Type: text/x-patch
Size: 3743 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170511/e5d32950/attachment.bin>


More information about the cfe-commits mailing list