This patch adds basic modeling of __builtin_expect, just to propagate the
(first) argument, making the call transparent.
Driveby: adds tests for proper handling of some other builtins.
| Paths 
 |  Differential  D122908  
[clang][dataflow] Add support for clang's `__builtin_expect`. ClosedPublic Authored by ymandel on Apr 1 2022, 8:05 AM. 
Details Summary This patch adds basic modeling of __builtin_expect, just to propagate the Driveby: adds tests for proper handling of some other builtins. 
Diff Detail 
 Event TimelineThis revision is now accepted and ready to land.Apr 1 2022, 9:00 AM Comment Actions Nice! Speaking of builtins, it might be great to add tests for __builtin_unreachable, __builtin_trap, __builtin_debugtrap. The CFG might already have the right shape so we might not need to add any code to support them. But it would be nice to know :) Maybe we could even add a comment to VisitCallExpr why those wouldn't need explicit support. Closed by commit rG506ec85ba82a: [clang][dataflow] Add support for clang's `__builtin_expect`. (authored by ymandel).  ·  Explain WhyApr 4 2022, 5:21 AM This revision was automatically updated to reflect the committed changes. 
Revision Contents 
 
 
Diff 419761 clang/lib/Analysis/FlowSensitive/Transfer.cpp
 clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||